Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/check-js-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,45 @@ on: push

jobs:
check-js-build:
name: Check JS build artifacts
name: Check JS version number and build artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"


- name: Check that version number for JS project matches version number for Python project
run: |
PYPROJECT_PATH="pyproject.toml"
PKGJSON_PATH="js/package.json"
PYPROJECT_VERSION=$(awk -F'"' '/^version/ {print $2; exit}' $PYPROJECT_PATH)
JSPROJECT_VERSION=$(cat $PKGJSON_PATH | jq -r '.version')
if [ "$PYPROJECT_VERSION" != "$JSPROJECT_VERSION" ]; then
echo "❌ Version number $JSPROJECT_VERSION in $PKGJSON_PATH does not match version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
exit 1
else
echo "✅ Version number $JSPROJECT_VERSION in $PKGJSON_PATH matches version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
fi
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: '22'

- name: Copy current files to a temporary directory
run: |
cp -R plotly/labextension/ plotly/labextension-tmp/
mv plotly/labextension/ plotly/labextension-tmp/

- name: Install dependencies and build
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install jupyter
uv pip install jupyterlab
cd js
npm ci
jupyter labextension build --show-config-json .
npm run build
npm ls
- name: Check JupyterLab build artifacts
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ a link to the plotly.js CHANGELOG.
- Manually update the versions to `X.Y.Z` in the files specified below:
- `pyproject.toml`
- update version
- `js/package.json`
- update version (`"version"` key at top of file)
- `CHANGELOG.md`
- update version and release date
- finalize changelog entries according to instructions above
Expand Down
9 changes: 2 additions & 7 deletions js/install.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"schemaVersion": 1,
"packageName": "jupyterlab-plotly",
"version": "6.0.1",
"packageManager": "python",
"jupyterlab": {
"mimeExtension": "lib/mimeExtension.js"
}
"packageName": "plotly",
"packageManager": "python"
}
4 changes: 2 additions & 2 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jupyterlab-plotly",
"main": "lib/mimeExtension.js",
"version": "6.0.1",
"version": "6.6.0",
"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.py"
Expand All @@ -12,7 +12,7 @@
"scripts": {
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
"build:labextension": "jupyter labextension build .",
"build:labextension": "jupyter labextension build --debug .",
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
"watch": "npm run build -- --watch --sourcemap=inline",
"typecheck": "tsc --noEmit"
Expand Down
6 changes: 3 additions & 3 deletions plotly/labextension/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jupyterlab-plotly",
"main": "lib/mimeExtension.js",
"version": "6.0.1",
"version": "6.6.0",
"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.py"
Expand All @@ -12,7 +12,7 @@
"scripts": {
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
"build:labextension": "jupyter labextension build .",
"build:labextension": "jupyter labextension build --debug .",
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
"watch": "npm run build -- --watch --sourcemap=inline",
"typecheck": "tsc --noEmit"
Expand All @@ -32,7 +32,7 @@
"mimeExtension": true,
"outputDir": "../plotly/labextension",
"_build": {
"load": "static/remoteEntry.d9ed7f5a4589fd6764e9.js",
"load": "static/remoteEntry.6213e23b3bdd99ae0b34.js",
"mimeExtension": "./mimeExtension"
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 19 additions & 45 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[build-system]
requires = ["setuptools>=71"]
build-backend = "setuptools.build_meta"
requires = ["hatchling >= 1.26"]
build-backend = "hatchling.build"

[project.urls]
"HomePage" = "https://plotly.com/python/"
"Homepage" = "https://plotly.com/python/"
"Documentation" = "https://plotly.com/python/"
"Github" = "https://github.com/plotly/plotly.py"
"GitHub" = "https://github.com/plotly/plotly.py"
"Changelog" = "https://github.com/plotly/plotly.py/blob/main/CHANGELOG.md"

[project]
Expand All @@ -18,7 +18,6 @@ maintainers = [
{ name="Emily Kellison-Linn", email="emily@plot.ly" }
]
description = "An open-source interactive data visualization library for Python"
readme = {file = "README.md", content-type = "text/markdown"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.8",
Expand All @@ -31,7 +30,8 @@ classifiers = [
"License :: OSI Approved :: MIT License"
]
requires-python = ">=3.8"
license = {file="LICENSE.txt"}
license = "MIT"
license-files = ["LICENSE.txt"]
version = "6.6.0"
dependencies = [
"narwhals>=1.15.1",
Expand All @@ -50,7 +50,7 @@ dev_core = [
dev_build = [
"plotly[dev_core]",
"build",
"jupyter"
"jupyterlab"
]
dev_optional = [
"plotly[dev_build]",
Expand Down Expand Up @@ -91,43 +91,17 @@ markers = [
"matplotlib: mark a test as matplotlib"
]

[tool.setuptools.packages.find]
where = ["."]
include = ["plotly*", "_plotly*"]
exclude = ["__pycache__*", "tests*"]

[tool.setuptools.package-data]
plotly = [
"package_data/*",
"package_data/templates/*",
"package_data/datasets/*",
"validators/_validators.json"
]

[tool.jupyter-packaging.builder]
factory = "jupyter_packaging.npm_builder"
auto_data_files = true

[tool.jupyter-packaging.build-args]
build_cmd = "build:prod"
npm = ["jlpm"]

[tool.hatch.build.hooks.jupyter-builder]
editable-frontend = true

[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
build_cmd = "build"
npm = ["jlpm"]
source_dir = "js"
build_dir = "plotly/labextension"
skip_symlink = true

[tool.setuptools.data-files]
"share/jupyter/labextensions/jupyterlab-plotly" = [
"plotly/labextension/package.json",
"js/install.json"
[tool.hatch.build]
include = [
"/plotly*",
"/_plotly*",
"js/install.json", # used by Jupyter extension
]

"share/jupyter/labextensions/jupyterlab-plotly/static" = [
"plotly/labextension/static/*.js"
]
[tool.hatch.build.targets.wheel.shared-data]
# Specify files from this package which will be copied to the user's system on install
# This is how the jupyterlab extension gets installed
# Left path is the path within this package
# Right path is the path on the user's system
"plotly/labextension" = "share/jupyter/labextensions/jupyterlab-plotly"
"js/install.json" = "share/jupyter/labextensions/jupyterlab-plotly/install.json"
Loading
Loading