Skip to content

Commit 3afc03b

Browse files
gvwilsonShallow Copy Bot
authored andcommitted
Merge pull request #5303 from plotly/add-missing-imports
Add missing imports and variable definitions (for main)
0 parents  commit 3afc03b

File tree

1,822 files changed

+860036
-0
lines changed

Some content is hidden

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

1,822 files changed

+860036
-0
lines changed

.circleci/config.yml

Lines changed: 479 additions & 0 deletions
Large diffs are not rendered by default.

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: plotly
2+
custom: https://plot.ly/products/consulting-and-oem/

.github/ISSUE_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Thanks for your interest in Plotly.py.
2+
Before opening an issue, please:
3+
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.
7+
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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
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.
5+
6+
If your PR modifies code of the `plotly` package, we have a different checklist below.
7+
8+
## Documentation PR
9+
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`.
29+
30+
## Code PR
31+
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.
37+
38+
-->
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: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
0
2+
0.html
3+
iframe_figures/
4+
tests/test_orca/images/linux/failed/
5+
6+
*.egg-info
7+
8+
*.pyc
9+
10+
*.gz
11+
12+
*~
13+
14+
doc/python/raw.githubusercontent.com/
15+
16+
# Don't ignore dataset files
17+
!*.csv.gz
18+
!*.geojson.gz
19+
20+
*.ipynb
21+
22+
*.coverage
23+
24+
*.tox
25+
26+
debug_script.py
27+
28+
test_output.txt
29+
30+
plotly/api/v2/spectacle_presentations.py
31+
32+
plotly/presentation_objs/
33+
34+
.idea
35+
36+
node_modules/
37+
38+
.pytest_cache
39+
40+
# virtual envs
41+
vv
42+
venv*
43+
44+
# dist files
45+
build
46+
dist
47+
plotly.egg-info/
48+
49+
# macOS utility file
50+
**/.DS_Store
51+
52+
tests/test_orca/images/*/failed
53+
tests/test_orca/images/*/tmp
54+
tests/test_core/test_offline/plotly.min.js
55+
temp-plot.html
56+
.vscode
57+
doc/python/.ipynb_checkpoints
58+
doc/python/.mapbox_token
59+
doc/.ipynb_checkpoints
60+
tags
61+
doc/check-or-enforce-order.py
62+
63+
tests/percy/*.html
64+
tests/percy/pandas2/*.html
65+
test_path.png

0 commit comments

Comments
 (0)