Skip to content

Commit 58a7511

Browse files
authored
Merge branch 'main' into master
2 parents 36345ce + 3ab4eb4 commit 58a7511

File tree

16,911 files changed

+643664
-969747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

16,911 files changed

+643664
-969747
lines changed

.circleci/config.yml

Lines changed: 219 additions & 367 deletions
Large diffs are not rendered by default.

.flake8

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
Thanks for your interest in Plotly.py!
1+
Thanks for your interest in Plotly.py.
2+
Before opening an issue, please:
23

3-
Before opening an issue, please search for existing and closed issues :)
4+
- Use the [latest version](https://github.com/plotly/plotly.py/blob/main/CHANGELOG.md) of plotly.py in your report unless not applicable.
5+
- Search for existing and closed issues.
6+
- Include a minimal reproducible example with bug reports.
47

5-
**Please** accompany bug reports with a reproducible example. Please use the [latest version](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md) of plotly.py in your report unless not applicable.
6-
7-
Note that GitHub Issues are meant to be used for bug reports and feature requests only. Implementation or usage questions should be asked on [community.plotly.com](https://community.plotly.com/c/graphing-libraries/python/10) or on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
8+
Note that GitHub Issues are meant to be used for bug reports and feature requests.
9+
Questions about usage should be asked on [community.plotly.com](https://community.plotly.com/c/graphing-libraries/python/10).

.github/pull_request_template.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
<!--
2-
Please uncomment this block and take a look at this checklist if your PR is making substantial changes to **documentation**/impacts files in the `doc` directory. Check all that apply to your PR, and leave the rest unchecked to discuss with your reviewer! Not all boxes must be checked for every PR :)
2+
Please uncomment this block and fill in this checklist if your PR makes substantial changes to documentation in the `doc` directory.
3+
Not all boxes must be checked for every PR:
4+
check those that apply to your PR and leave the rest unchecked to discuss with your reviewer.
35
4-
If your PR modifies code of the `plotly` package, we have a different checklist
5-
below :-).
6+
If your PR modifies code of the `plotly` package, we have a different checklist below.
67
7-
### Documentation PR
8+
## Documentation PR
89
9-
- [ ] I've [seen the `doc/README.md` file](https://github.com/plotly/plotly.py/blob/master/doc/README.md)
10-
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `master` branch
11-
- [ ] If this PR modifies the first example in a page or adds a new one, it is a `px` example if at all possible
12-
- [ ] Every new/modified example has a descriptive title and motivating sentence or paragraph
13-
- [ ] Every new/modified example is independently runnable
14-
- [ ] Every new/modified example is optimized for short line count and focuses on the Plotly/visualization-related aspects of the example rather than the computation required to produce the data being visualized
15-
- [ ] Meaningful/relatable datasets are used for all new examples instead of randomly-generated data where possible
16-
- [ ] The random seed is set if using randomly-generated data in new/modified examples
17-
- [ ] New/modified remote datasets are loaded from https://plotly.github.io/datasets and added to https://github.com/plotly/datasets
18-
- [ ] Large computations are avoided in the new/modified examples in favour of loading remote datasets that represent the output of such computations
19-
- [ ] Imports are `plotly.graph_objects as go` / `plotly.express as px` / `plotly.io as pio`
20-
- [ ] Data frames are always called `df`
21-
- [ ] `fig = <something>` call is high up in each new/modified example (either `px.<something>` or `make_subplots` or `go.Figure`)
22-
- [ ] Liberal use is made of `fig.add_*` and `fig.update_*` rather than `go.Figure(data=..., layout=...)` in every new/modified example
23-
- [ ] Specific adders and updaters like `fig.add_shape` and `fig.update_xaxes` are used instead of big `fig.update_layout` calls in every new/modified example
24-
- [ ] `fig.show()` is at the end of each new/modified example
25-
- [ ] `plotly.plot()` and `plotly.iplot()` are not used in any new/modified example
26-
- [ ] Hex codes for colors are not used in any new/modified example in favour of [these nice ones](https://github.com/plotly/plotly.py/issues/2192)
10+
- [ ] I have seen the [`doc/README.md`](https://github.com/plotly/plotly.py/blob/main/doc/README.md) file.
11+
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `main` branch.
12+
- [ ] If this PR modifies the first example in a page or adds a new one, it is a `px` example if at all possible.
13+
- [ ] Every new/modified example has a descriptive title and motivating sentence or paragraph.
14+
- [ ] Every new/modified example is independently runnable.
15+
- [ ] Every new/modified example is optimized for short line count and focuses on the Plotly/visualization-related aspects of the example rather than the computation required to produce the data being visualized.
16+
- [ ] Meaningful/relatable datasets are used for all new examples instead of randomly-generated data where possible.
17+
- [ ] The random seed is set if using randomly-generated data.
18+
- [ ] New/modified remote datasets are loaded from https://plotly.github.io/datasets and added to https://github.com/plotly/datasets.
19+
- [ ] Large computations are avoided in the new/modified examples in favour of loading remote datasets that represent the output of such computations.
20+
- [ ] Imports are `plotly.graph_objects as go`, `plotly.express as px`, and/or `plotly.io as pio`.
21+
- [ ] Data frames are always called `df`.
22+
- [ ] `fig = <something>` is called high up in each new/modified example (either `px.<something>` or `make_subplots` or `go.Figure`).
23+
- [ ] Liberal use is made of `fig.add_*` and `fig.update_*` rather than `go.Figure(data=..., layout=...)`.
24+
- [ ] Specific adders and updaters like `fig.add_shape` and `fig.update_xaxes` are used instead of big `fig.update_layout` calls.
25+
- [ ] `fig.show()` is at the end of each example.
26+
- [ ] `plotly.plot()` and `plotly.iplot()` are not used in any example.
27+
- [ ] Named colors are used instead of hex codes wherever possible.
28+
- [ ] Code blocks are marked with `&#96;&#96;&#96;python`.
2729
2830
## Code PR
2931
30-
- [ ] I have read through the [contributing notes](https://github.com/plotly/plotly.py/blob/master/contributing.md) and understand the structure of the package. In particular, if my PR modifies code of `plotly.graph_objects`, my modifications concern the `codegen` files and not generated files.
31-
- [ ] I have added tests (if submitting a new feature or correcting a bug) or
32-
modified existing tests.
33-
- [ ] For a new feature, I have added documentation examples in an existing or
34-
new tutorial notebook (please see the doc checklist as well).
35-
- [ ] I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
36-
- [ ] For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).
32+
- [ ] I have read through the [contributing notes](https://github.com/plotly/plotly.py/blob/main/CONTRIBUTING.md) and understand the structure of the package. In particular, if my PR modifies code of `plotly.graph_objects`, my modifications concern the code generator and *not* the generated files.
33+
- [ ] I have added tests or modified existing tests.
34+
- [ ] For a new feature, I have added documentation examples (please see the doc checklist as well).
35+
- [ ] I have added a CHANGELOG entry if changing anything substantial.
36+
- [ ] For a new feature or a change in behavior, I have updated the relevant docstrings in the code.
3737
3838
-->

.github/workflows/check-js-build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on: push
2+
3+
jobs:
4+
check-js-build:
5+
name: Check JS build artifacts
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Set up Python
10+
uses: actions/setup-python@v5
11+
with:
12+
python-version: "3.x"
13+
14+
- name: Install Node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '22'
18+
19+
- name: Copy current files to a temporary directory
20+
run: |
21+
cp -R plotly/labextension/ plotly/labextension-tmp/
22+
23+
- name: Install dependencies and build
24+
run: |
25+
curl -LsSf https://astral.sh/uv/install.sh | sh
26+
uv venv
27+
source .venv/bin/activate
28+
uv pip install jupyter
29+
cd js
30+
npm ci
31+
npm run build
32+
- name: Check JupyterLab build artifacts
33+
run: |
34+
# 1. Hash contents of all static files, sort by content hash
35+
find plotly/labextension/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > new_hashes.txt
36+
find plotly/labextension-tmp/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > old_hashes.txt
37+
38+
# 2. Compare the sorted content hashes
39+
diff old_hashes.txt new_hashes.txt > content_diff.txt
40+
41+
# Remove the "load" line from both package.json files before comparing
42+
grep -v '"load": "static/' plotly/labextension/package.json > pkg1.json
43+
grep -v '"load": "static/' plotly/labextension-tmp/package.json > pkg2.json
44+
45+
# Compare stripped versions
46+
diff pkg1.json pkg2.json > package_json_diff.txt
47+
48+
# 5. Final check
49+
if [ -s content_diff.txt ] || [ -s package_json_diff.txt ]; then
50+
echo "❌ Build artifacts differ:"
51+
echo "--- Unexpected diffs ---"
52+
cat content_diff.txt
53+
echo "--- Unexpected package.json diffs ---"
54+
cat package_json_diff.txt
55+
echo "Please replace the 'plotly/labextension' directory with the artifacts of this CI run."
56+
exit 1
57+
else
58+
echo "✅ Build artifacts match expected output (ignoring known 'load' hash in package.json)."
59+
fi
60+
61+
- name: Store the build artifacts from plotly/labextension
62+
uses: actions/upload-artifact@v4
63+
if: failure()
64+
with:
65+
name: labextension
66+
path: plotly/labextension

.github/workflows/test-release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
build:
8+
name: Build distribution 📦
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.x"
19+
20+
- name: Install Node
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: '22'
24+
25+
- name: Install npm dependencies
26+
run: |
27+
curl -LsSf https://astral.sh/uv/install.sh | sh
28+
uv venv
29+
source .venv/bin/activate
30+
uv pip install jupyter
31+
cd js
32+
npm ci --verbose
33+
npm run build --verbose
34+
35+
- name: Install pypa/build
36+
run: >-
37+
python3 -m
38+
pip install
39+
build
40+
--user
41+
- name: Build a binary wheel and a source tarball
42+
run: python3 -m build
43+
- name: Store the distribution packages
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
49+
publish-to-testpypi:
50+
name: Publish Python 🐍 distribution 📦 to TestPyPI
51+
needs:
52+
- build
53+
runs-on: ubuntu-latest
54+
55+
environment:
56+
name: testpypi
57+
url: https://test.pypi.org/p/plotly
58+
59+
permissions:
60+
id-token: write # IMPORTANT: mandatory for trusted publishing
61+
62+
steps:
63+
- name: Download all the dists
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: python-package-distributions
67+
path: dist/
68+
- name: Publish distribution 📦 to TestPyPI
69+
uses: pypa/gh-action-pypi-publish@release/v1
70+
with:
71+
repository-url: https://test.pypi.org/legacy/

.gitignore

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
0
22
0.html
33
iframe_figures/
4-
packages/python/plotly/plotly/tests/test_orca/images/linux/failed/
4+
tests/test_orca/images/linux/failed/
55

66
*.egg-info
77

@@ -15,6 +15,7 @@ doc/python/raw.githubusercontent.com/
1515

1616
# Don't ignore dataset files
1717
!*.csv.gz
18+
!*.geojson.gz
1819

1920
*.ipynb
2021

@@ -48,9 +49,9 @@ plotly.egg-info/
4849
# macOS utility file
4950
**/.DS_Store
5051

51-
plotly/tests/test_orca/images/*/failed
52-
plotly/tests/test_orca/images/*/tmp
53-
/plotly-package/plotly/tests/test_core/test_offline/plotly.min.js
52+
tests/test_orca/images/*/failed
53+
tests/test_orca/images/*/tmp
54+
tests/test_core/test_offline/plotly.min.js
5455
temp-plot.html
5556
.vscode
5657
doc/python/.ipynb_checkpoints
@@ -59,10 +60,6 @@ doc/.ipynb_checkpoints
5960
tags
6061
doc/check-or-enforce-order.py
6162

62-
packages/javascript/jupyterlab-plotly/lib/
63-
packages/python/plotly/jupyterlab_plotly/labextension/
64-
packages/python/plotly/jupyterlab_plotly/nbextension/index.js*
65-
packages/python/plotly/plotly/package_data/widgetbundle.js
66-
67-
test/percy/*.html
68-
test/percy/pandas2/*.html
63+
tests/percy/*.html
64+
tests/percy/pandas2/*.html
65+
test_path.png

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)