Skip to content

Commit b06d9af

Browse files
authored
Merge branch 'main' into subplot_font
2 parents d2818c7 + 4d590f3 commit b06d9af

738 files changed

Lines changed: 113617 additions & 105447 deletions

File tree

Some content is hidden

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

.circleci/config.yml

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

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a bug report for a plotly.py issue
4+
title: "[BUG]: "
5+
labels: bug
6+
7+
---
8+
9+
### Instructions (remove this section before submitting report)
10+
11+
Thanks for your interest in plotly.py!
12+
13+
- Before submitting a new bug report, please search for existing and closed issues. If your bug is not addressed yet, fill out the sections below and submit a new issue.
14+
- Implementation questions ("How do I do ...?") should be asked on our [Community Forum](https://community.plotly.com/c/plotly-python/5) or on [Stack Overflow](https://stackoverflow.com/questions/tagged/plotly) (tagged 'plotly').
15+
- Comments should add content to the discussions. Approbation comments such as *+1* or *I would like this feature to be implemented as well* will be deleted by the maintainers. Please use [GitHub reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead.
16+
17+
### Description
18+
19+
_Add a clear description of the issue that you're having._
20+
21+
### Screenshots/Video
22+
23+
_Add screenshots or a video of the issue._
24+
25+
### Steps to reproduce
26+
27+
_Reports **must** include steps to reproduce the issue. Please use the [latest version](https://github.com/plotly/plotly.py/releases) of plotly.py in your report unless not applicable._
28+
29+
- Go to '...'
30+
- Click on X
31+
- Note the issue with Y
32+
33+
### Notes
34+
35+
_Add info here that doesn't fit in the other sections._
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Feature request
3+
about: Submit a new feature request for plotly.py
4+
title: "[FEATURE]: "
5+
labels: feature
6+
7+
---
8+
9+
### Instructions (remove this section before submitting an issue)
10+
11+
Thanks for your interest in plotly.py!
12+
13+
- Before submitting a new feature request, please search for existing and closed requests. If your request is novel, fill out the sections below and submit a new request.
14+
- Comments should add content to the discussions. Approbation comments such as *+1* or *I would like this feature to be implemented as well* will be deleted by the maintainers. Please use [GitHub reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead.
15+
16+
### Description
17+
18+
_Add a clear description of the feature that you're requesting._
19+
20+
21+
### Why should this feature be added?
22+
23+
_Provide an argument for why this feature should be added. We can't add everything, so this will help us determine what gets worked on. Please also consider creating a PR and adding the feature yourself. Help is always appreciated._
24+
25+
### Mocks/Designs
26+
27+
_Please add any mocks or designs you might have for the feature._
28+
29+
### Notes
30+
31+
_Add info here that doesn't fit in the other sections._
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Set up Chrome for pytest
2+
description: Install Chrome/Chromedriver, set BROWSER, and verify the setup
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Set up Chrome
7+
id: setup-chrome
8+
uses: browser-actions/setup-chrome@4f8e94349a351df0f048634f25fec36c3c91eded # v2.1.1
9+
with:
10+
install-chromedriver: true
11+
- name: Set BROWSER env var
12+
shell: bash
13+
run: |
14+
echo "BROWSER=${{ steps.setup-chrome.outputs.chrome-path }}" >> $GITHUB_ENV
15+
- name: Check Chrome setup
16+
shell: bash
17+
run: |
18+
CHROME_PATH="${{ steps.setup-chrome.outputs.chrome-path }}"
19+
CHROMEDRIVER_PATH="${{ steps.setup-chrome.outputs.chromedriver-path }}"
20+
echo "Chrome path: $CHROME_PATH"
21+
echo "Chrome version: $($CHROME_PATH --version)"
22+
echo "Chromedriver path: $CHROMEDRIVER_PATH"
23+
echo "Chromedriver version: $($CHROMEDRIVER_PATH --version)"
24+
echo "chrome --version: $(chrome --version)"
25+
echo "BROWSER = $BROWSER"
26+
python -c "import webbrowser; webbrowser.register_standard_browsers(); print(webbrowser._tryorder)"
27+
python -c "import webbrowser; webbrowser.get()"

.github/pull_request_template.md

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
<!--
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.
2+
Thank you for your contribution to plotly.py!
373
4+
Please complete each section below.
385
-->
6+
7+
### Link to issue
8+
<!-- Link to the issue closed by this PR. If the issue doesn't exist yet, create it. -->
9+
10+
Closes #(issue number)
11+
12+
### Description of change
13+
<!-- Provide a clear 1-2 sentence description of what this PR does. -->
14+
15+
### Demo
16+
17+
<!-- Include screenshots or screen recordings of this PR in action. -->
18+
19+
### Testing strategy
20+
21+
<!-- Provide 1-2 sentences explaining tests added or changed by this PR. If testing changes are not needed, explain why. -->
22+
23+
### Additional information (optional)
24+
25+
<!-- Include any additional context, background, or explanation which doesn't fit in the previous sections. -->
26+
27+
### Guidelines
28+
29+
- [ ] I have reviewed the [pull request guidelines](https://github.com/plotly/plotly.py/blob/main/CONTRIBUTING.md#opening-a-pull-request) and the [Code of Conduct](https://github.com/plotly/plotly.py/blob/main/CODE_OF_CONDUCT.md) and confirm that this PR follows them.
30+
- [ ] I have added an entry to the [changelog](https://github.com/plotly/plotly.py/blob/main/CHANGELOG.md) if needed (not required for documentation PRs).

.github/workflows/build-doc.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- doc-prod
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
10+
jobs:
11+
build-doc:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15+
16+
- name: Set up uv
17+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
18+
with:
19+
python-version: "3.9"
20+
21+
- name: Install system dependencies
22+
run: sudo apt-get update && sudo apt-get install rename
23+
24+
- name: Install doc dependencies
25+
run: |
26+
cd doc
27+
uv venv
28+
source .venv/bin/activate
29+
uv pip install -r requirements.txt
30+
31+
- name: Install plotly in editable mode
32+
if: github.ref_name != 'doc-prod'
33+
run: |
34+
cd doc
35+
source .venv/bin/activate
36+
uv pip uninstall plotly
37+
uv pip install -e ..
38+
39+
40+
- name: Build HTML docs
41+
env:
42+
MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
43+
run: |
44+
cd doc
45+
source .venv/bin/activate
46+
echo "${MAPBOX_TOKEN}" > python/.mapbox_token
47+
make -kj8 || make -kj8
48+
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/front-matter-ci.py > front-matter-ci.py
49+
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/check-or-enforce-order.py > check-or-enforce-order.py
50+
python front-matter-ci.py build/html
51+
python check-or-enforce-order.py build/html
52+
53+
- name: Upload HTML docs artifact
54+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
55+
with:
56+
name: doc-html
57+
path: doc/build/html/
58+
59+
- name: Create GitHub App token
60+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
61+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
62+
id: app-token
63+
with:
64+
app-id: ${{ vars.GRAPHING_LIBRARIES_CI_GHAPP_ID }}
65+
private-key: ${{ secrets.GRAPHING_LIBRARIES_CI_GHAPP_PRIVATE_KEY }}
66+
owner: ${{ github.repository_owner }}
67+
repositories: plotly.py-docs,graphing-library-docs
68+
69+
- name: Checkout plotly.py-docs (built)
70+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
71+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
72+
with:
73+
repository: plotly/plotly.py-docs
74+
ref: built
75+
token: ${{ steps.app-token.outputs.token }}
76+
path: plotly.py-docs-html
77+
78+
- name: Deploy HTML docs
79+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
80+
run: |
81+
git config --global user.name plotlydocbot
82+
git config --global user.email accounts@plot.ly
83+
rm -rf plotly.py-docs-html/*
84+
cp -r doc/build/html/* plotly.py-docs-html/
85+
cd plotly.py-docs-html
86+
git add .
87+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${{ github.sha }}" || echo "No changes to commit"
88+
git push --force
89+
90+
- name: Checkout plotly.py-docs (built_ipynb)
91+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
92+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
93+
with:
94+
repository: plotly/plotly.py-docs
95+
ref: built_ipynb
96+
token: ${{ steps.app-token.outputs.token }}
97+
path: plotly.py-docs-ipynb
98+
99+
- name: Deploy notebooks
100+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
101+
run: |
102+
rm -rf plotly.py-docs-ipynb/*
103+
cp -r doc/build/ipynb/* plotly.py-docs-ipynb/
104+
cd plotly.py-docs-ipynb
105+
git add .
106+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${{ github.sha }}" || echo "No changes to commit"
107+
git push --force
108+
109+
- name: Checkout graphing-library-docs
110+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
111+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
112+
with:
113+
repository: plotly/graphing-library-docs
114+
ref: master
115+
token: ${{ steps.app-token.outputs.token }}
116+
path: graphing-library-docs
117+
118+
- name: Trigger downstream doc build
119+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
120+
run: |
121+
cd graphing-library-docs
122+
git commit --allow-empty -m "deploying https://github.com/plotly/plotly.py/commit/${{ github.sha }}"
123+
git push
124+
125+
- name: Build API docs
126+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
127+
run: |
128+
cd doc
129+
source .venv/bin/activate
130+
# For the API doc, we need to use the local version of plotly
131+
# since we are tweaking the source because of
132+
# graph_objs/graph_objects
133+
uv pip uninstall plotly
134+
uv pip install -e ..
135+
cd apidoc
136+
make html
137+
138+
- name: Checkout plotly.py-docs (gh-pages)
139+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
140+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
141+
with:
142+
repository: plotly/plotly.py-docs
143+
ref: gh-pages
144+
token: ${{ steps.app-token.outputs.token }}
145+
path: plotly.py-docs-api
146+
147+
- name: Deploy API docs
148+
if: github.ref_name == 'doc-prod' && github.event_name == 'push'
149+
run: |
150+
rm -rf plotly.py-docs-api/*
151+
cp -r doc/apidoc/_build/html/* plotly.py-docs-api/
152+
touch plotly.py-docs-api/.nojekyll
153+
cd plotly.py-docs-api
154+
git add .
155+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${{ github.sha }}" || echo "No changes to commit"
156+
git push --force

0 commit comments

Comments
 (0)