Skip to content

Add back the mime renderer JL extension #5096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 72 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5cb5754
Default to notebook connected mode
marthacryan Mar 17, 2025
e5e2994
Add back JL extension for mimerenderer ability
marthacryan Mar 18, 2025
583dea9
Use original code to maintain image load
marthacryan Mar 19, 2025
bed4c45
Move js into labextension directory
marthacryan Mar 20, 2025
1cd7c4f
update gitignore
marthacryan Mar 20, 2025
aa13a97
remove print statement
marthacryan Mar 20, 2025
23dad18
Update npm build to include jupyter lab extension build
marthacryan Mar 21, 2025
74724a5
Update paths and build for CI
marthacryan Mar 21, 2025
b8375f3
Replace pip with uv in plotly.js dev build CI
marthacryan Mar 21, 2025
df3970f
Update path to js in commands
marthacryan Mar 21, 2025
4353bba
Add labextension to additional package data
marthacryan Mar 21, 2025
ef5add1
Add labextension to additional package data
marthacryan Mar 21, 2025
14b5a0d
Fix CI
marthacryan Mar 27, 2025
af46e25
Change pin so that jupyterlab is >= 4
marthacryan Mar 28, 2025
5ced43e
Fix filepath in docs ci
marthacryan Mar 28, 2025
847b87c
Make extension compatible with jupyterlab 3 and 4
marthacryan Apr 4, 2025
00a794b
Merge branch 'main' of github.com:plotly/plotly.py into notebook-conn…
marthacryan Apr 4, 2025
61df8d7
Update test for slightly different value
marthacryan Apr 4, 2025
8f32ac5
Update test for slightly different value
marthacryan Apr 4, 2025
0ee60e7
Pin shapely version in test requirements
marthacryan Apr 4, 2025
4a2f699
Make default renderer in jupyterlab/notebook plotly_mimetype
marthacryan Apr 7, 2025
18f70ac
AUpdate file structure and make package include jupyterlab files
marthacryan Apr 11, 2025
ca54548
Update js access to use new filepaths
marthacryan Apr 11, 2025
b827f02
Update path of js output
marthacryan Apr 11, 2025
c67cada
Add metadata about jupyterlab extension
marthacryan Apr 11, 2025
e3afcf7
Add version into package
marthacryan Apr 11, 2025
62721e9
Add js build to dev build
marthacryan Apr 11, 2025
3a6f3ee
Revert changes to requirements
marthacryan Apr 11, 2025
0859aef
Merge branch 'main' of github.com:plotly/plotly.py into notebook-conn…
marthacryan Apr 11, 2025
1260612
Update node root path in commands.py
marthacryan Apr 11, 2025
1db6c81
Add js build to CI
marthacryan Apr 11, 2025
4bcbd30
Black
marthacryan Apr 11, 2025
b8cc069
Update build files included in output
marthacryan Apr 11, 2025
cbfddad
Add CI to check for changes to js build files
marthacryan Apr 11, 2025
5254258
Add build step to check for js build changes in CI
marthacryan Apr 11, 2025
f51b3dc
Add build file
marthacryan Apr 11, 2025
b4cd36c
Make js uncommitted files check its own job
marthacryan Apr 11, 2025
5d0aa9c
Make js uncommitted files check its own job
marthacryan Apr 11, 2025
56433a7
Add jupyter to env before running npm run build
marthacryan Apr 11, 2025
a7cf8e1
Commit built widget js
marthacryan Apr 11, 2025
54cc73f
Use tmp to compare the build files before and after build
marthacryan Apr 11, 2025
afc511a
Remove extra call to check js build job
marthacryan Apr 11, 2025
87c5260
Update diff and only run CI when there are changes in the js directory
marthacryan Apr 14, 2025
f167e6f
Attempt running CI
marthacryan Apr 14, 2025
daac60e
Try different approach to only running on changes to js/
marthacryan Apr 14, 2025
024325e
Add debugging statements to the diff checker
marthacryan Apr 14, 2025
0df9265
Add special handling for package.json
marthacryan Apr 14, 2025
e26d9da
Update ignore pattern
marthacryan Apr 14, 2025
ab922bf
Add debugging print statements
marthacryan Apr 14, 2025
a56c55a
update diff method
marthacryan Apr 14, 2025
f7df6a8
update diff method
marthacryan Apr 14, 2025
ce27281
Add artifact upload when ci finds differences between build and src
marthacryan Apr 14, 2025
f918835
Dummy commit to check CI
marthacryan Apr 14, 2025
cd26c8f
Use github actions instead of circleci for checking js build files
marthacryan Apr 15, 2025
585cf4a
fix syntax error
marthacryan Apr 15, 2025
4fdca55
Dummy js commit
marthacryan Apr 15, 2025
d7157f6
Fix artifact upload
marthacryan Apr 15, 2025
d10fd16
Update labextension source
marthacryan Apr 15, 2025
ce161d9
Update CONTRIBUTING.md
marthacryan Apr 15, 2025
48c510c
Add back npm build to full release build
marthacryan Apr 15, 2025
2dbb09c
Remove extraneous or true
marthacryan Apr 15, 2025
9e097ec
Update CONTRIBUTING.md
marthacryan Apr 15, 2025
f3a4278
Update logic for deciding whether js has changed
marthacryan Apr 15, 2025
5baedf3
Update name of CI step
marthacryan Apr 15, 2025
2e9a296
Update CONTRIBUTING.md
emilykl Apr 15, 2025
15ea2d7
Update .github/workflows/check-js-build.yml
marthacryan Apr 15, 2025
a4b0c42
Merge pull request #5144 from plotly/js-contributing-md-updates
marthacryan Apr 15, 2025
35506f3
remove check for changes in js folder to avoid missing CI failures
marthacryan Apr 15, 2025
ce867a1
Update node version in github actions
marthacryan Apr 15, 2025
8f3227e
remove extraneous persist_credentials flag
marthacryan Apr 15, 2025
3ac4224
Update version to match plotly.py version
marthacryan Apr 15, 2025
60735fe
Update build files
marthacryan Apr 15, 2025
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
74 changes: 50 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ commands:
source .venv/bin/activate
uv pip install .
uv pip install -r ./test_requirements/requirements_optional.txt
cd js
npm ci
npm run build

- when:
condition:
Expand Down Expand Up @@ -166,6 +163,42 @@ jobs:
pandas_version: <<parameters.pandas_version>>
numpy_version: <<parameters.numpy_version>>

check-js-build:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this something more specific, e.g. check-jupyterlab-extension-js-build

docker:
- image: cimg/python:3.12-node
environment:
LANG: en_US.UTF-8
resource_class: large

steps:
- checkout
- run:
name: Copy current files to a temporary directory
command: |
cp -R plotly/labextension/ plotly/labextension-tmp/
- run:
name: Install dependencies
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install jupyter
cd js
npm ci
npm run build
- run:
name: Check JupyterLab build artifacts
command: |
diff -qr plotly/labextension-tmp/ plotly/labextension/ | grep -v '^Only in' > build_diff.txt

if [ -s build_diff.txt ]; then
echo "Build artifacts differ from committed files:"
cat build_diff.txt
exit 1
else
echo "Build artifacts are identical to committed files."
fi

# Percy
python_311_percy:
docker:
Expand Down Expand Up @@ -269,22 +302,13 @@ jobs:

steps:
- checkout

- run:
name: initial NPM Build
command: |
python -m venv venv
. venv/bin/activate
cd js
npm ci
npm run build
git status

- run:
name: PyPI Build
command: |
. venv/bin/activate
pip install build
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv pip install build
python -m build --sdist --wheel -o dist
cp -R dist output
git status
Expand All @@ -310,7 +334,6 @@ jobs:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver

- run:
name: Install dependencies
command: |
Expand All @@ -319,16 +342,11 @@ jobs:
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
cd ..
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
uv pip uninstall plotly
cd ..
uv pip install -e .
cd js
npm ci
npm run build
cd ../doc
fi
cd ..

- run:
name: make html
Expand Down Expand Up @@ -420,6 +438,14 @@ workflows:
release_build:
jobs:
- full_build

check_js_build:
filters:
paths:
only:
- js/**
jobs:
- check-js-build

build:
jobs:
Expand Down Expand Up @@ -449,4 +475,4 @@ workflows:
pandas_version: "1.2.4"
numpy_version: "1.26.4"
- python_311_percy
- build-doc
- build-doc
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ doc/python/.mapbox_token
doc/.ipynb_checkpoints
tags
doc/check-or-enforce-order.py
plotly/package_data/widgetbundle.js

tests/percy/*.html
tests/percy/pandas2/*.html
9 changes: 9 additions & 0 deletions js/install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"schemaVersion": 1,
"name": "jupyterlab-plotly",
"version": "6.0.1",
"jupyterlab": {
"mimeExtension": "lib/mimeExtension.js"
}
}

3,865 changes: 3,865 additions & 0 deletions js/lib/mimeExtension.js

Large diffs are not rendered by default.

Loading