Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.8k
Clean up pyproject.toml and build pipeline#5540
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
1c6204e77aeae4ef2359e0cfdc0d09d817a18c6b753adab20a650b154e06ef0796a9b30352c8a6a70d14ed73ee37c5c8841a13239a98060d754dfe7482a9799717f12ac9e496File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,61 +2,60 @@ 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 | ||
| uses: actions/setup-node@v4 | ||
| 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/ | ||
emilykl marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - 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 | ||
| npm ls | ||
| - name: Check JupyterLab build artifacts | ||
| run: | | ||
| # 1. Hash contents of all static files, sort by content hash | ||
| find plotly/labextension/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > new_hashes.txt | ||
| find plotly/labextension-tmp/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > old_hashes.txt | ||
| # 2. Compare the sorted content hashes | ||
| diff old_hashes.txt new_hashes.txt > content_diff.txt | ||
| # Remove the "load" line from both package.json files before comparing | ||
| grep -v '"load": "static/' plotly/labextension/package.json > pkg1.json | ||
| grep -v '"load": "static/' plotly/labextension-tmp/package.json > pkg2.json | ||
| # Compare stripped versions | ||
| diff pkg1.json pkg2.json > package_json_diff.txt | ||
| # Compare the plotly/labextension and plotly/labextension-tmp directories | ||
| diff -r --brief plotly/labextension/ plotly/labextension-tmp/ > labextension_diff.txt | ||
| # 5. Final check | ||
| if [ -s content_diff.txt ] || [ -s package_json_diff.txt ]; then | ||
| # Check for differences | ||
| if [ -s labextension_diff.txt ]; then | ||
| echo "❌ Build artifacts differ:" | ||
| echo "--- Unexpected diffs ---" | ||
| cat content_diff.txt | ||
| echo "--- Unexpected package.json diffs ---" | ||
| cat package_json_diff.txt | ||
| cat labextension_diff.txt | ||
| echo "Please replace the 'plotly/labextension' directory with the artifacts of this CI run." | ||
| exit 1 | ||
| else | ||
| echo "✅ Build artifacts match expected output (ignoring known 'load' hash in package.json)." | ||
| echo "✅ Build artifacts match expected output" | ||
| fi | ||
| - name: Store the build artifacts from plotly/labextension | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| cff-version: 1.2.0 | ||
| message: "If you use this software, please cite it as below." | ||
| authors: | ||
| - family-names: "Kruchten" | ||
| given-names: "Nicolas" | ||
| orcid: https://orcid.org/0000-0002-8416-789X | ||
| - family-names: "Seier" | ||
| given-names: "Andrew" | ||
| - family-names: "Parmer" | ||
| given-names: "Chris" | ||
| title: "An interactive, open-source, and browser-based graphing library for Python" | ||
| version: 6.6.0 | ||
| doi: 10.5281/zenodo.14503524 | ||
| date-released: 2026-03-02 | ||
| url: "https://github.com/plotly/plotly.py" | ||
| cff-version: 1.2.0 | ||
| message: "If you use this software, please cite it as below." | ||
| authors: | ||
| - family-names: "Kruchten" | ||
| given-names: "Nicolas" | ||
| orcid: https://orcid.org/0000-0002-8416-789X | ||
| - family-names: "Seier" | ||
| given-names: "Andrew" | ||
| - family-names: "Parmer" | ||
| given-names: "Chris" | ||
| title: "An interactive, open-source, and browser-based graphing library for Python" | ||
| version: 6.6.0 | ||
| doi: 10.5281/zenodo.14503524 | ||
| date-released: 2026-03-02 | ||
| url: "https://github.com/plotly/plotly.py" |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be good to port some of these changes to plotly.js. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @camdecoster Sure, which parts? I'd be happy to open a PR. Most of this PR is only relevant to Python though. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.