Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1c6204e
migrate build system to hatchling from setuptools
emilykl Mar 16, 2026
77aeae4
remove unused keys from install.json
emilykl Mar 16, 2026
ef2359e
update version in js/package.json to match plotly.py version
emilykl Mar 16, 2026
0cfdc0d
add instruction to update js/package.json version when bumping plotly…
emilykl Mar 16, 2026
09d817a
update js build artifact
emilykl Mar 16, 2026
18c6b75
remove jupyter from dev_optional since we already have jupyterlab und…
emilykl Mar 16, 2026
3adab20
update uv lockfile
emilykl Mar 16, 2026
a650b15
install jupyterlab instead of jupyter
emilykl Mar 17, 2026
4e06ef0
print more debug info for jupyter labextension build
emilykl Mar 17, 2026
796a9b3
add CI step to check that versions match
emilykl Mar 17, 2026
0352c8a
fix issue introduced in check-js-build.yml
emilykl Mar 17, 2026
6a70d14
add webpack config for consistent builds across platforms
emilykl Mar 18, 2026
ed73ee3
remove some flags used for debugging
emilykl Mar 18, 2026
7c5c884
update package-lock.json to match package version in package.json
emilykl Mar 18, 2026
1a13239
try simplified check-js-build step
emilykl Mar 18, 2026
a98060d
add back readme key in metadata
emilykl Mar 19, 2026
754dfe7
change line endings from CRLF to LF
emilykl Mar 19, 2026
482a979
add bumpversion script in commands.py for updating version numbers
emilykl Mar 19, 2026
9717f12
better error handling: print failure message and exit 1 if version bu…
emilykl Mar 20, 2026
ac9e496
add documentation for commands.py to CONTRIBUTING.md
emilykl Mar 20, 2026
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
20 changes: 16 additions & 4 deletions .github/workflows/check-js-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,42 @@ 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
npm run build
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.

5 changes: 3 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 Down Expand Up @@ -30,6 +30,7 @@
},
"jupyterlab": {
"mimeExtension": true,
"outputDir": "../plotly/labextension"
"outputDir": "../plotly/labextension",
"webpackConfig": "./webpack.config.js"
}
}
10 changes: 10 additions & 0 deletions js/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
// Note: This config has no effect on the lab extension functionality,
// but it helps ensure that webpack uses the same module and chunk IDs
// across platforms, which makes it easier to compare build artifacts.
optimization: {
moduleIds: 'natural',
chunkIds: 'natural',
realContentHash: true
},
};
5 changes: 3 additions & 2 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 Down Expand Up @@ -31,8 +31,9 @@
"jupyterlab": {
"mimeExtension": true,
"outputDir": "../plotly/labextension",
"webpackConfig": "./webpack.config.js",
"_build": {
"load": "static/remoteEntry.d9ed7f5a4589fd6764e9.js",
"load": "static/remoteEntry.a90ef69e866c18565afe.js",
"mimeExtension": "./mimeExtension"
}
}
Expand Down
2 changes: 2 additions & 0 deletions plotly/labextension/static/1.f29faa6937f75272d9d5.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions plotly/labextension/static/340.330950829c5d59eca692.js

This file was deleted.

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

This file was deleted.

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