Skip to content

Commit de7f742

Browse files
authored
Merge branch 'main' into patch-2
2 parents a67ec54 + 062809c commit de7f742

File tree

240 files changed

+1089
-15706
lines changed

Some content is hidden

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

240 files changed

+1089
-15706
lines changed

Diff for: .circleci/config.yml

+173-304
Large diffs are not rendered by default.

Diff for: .gitattributes

-1
This file was deleted.

Diff for: .github/pull_request_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ below :-).
77
### Documentation PR
88
99
- [ ] 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
10+
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `main` branch
1111
- [ ] If this PR modifies the first example in a page or adds a new one, it is a `px` example if at all possible
1212
- [ ] Every new/modified example has a descriptive title and motivating sentence or paragraph
1313
- [ ] Every new/modified example is independently runnable
@@ -27,7 +27,7 @@ below :-).
2727
2828
## Code PR
2929
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.
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.
3131
- [ ] I have added tests (if submitting a new feature or correcting a bug) or
3232
modified existing tests.
3333
- [ ] For a new feature, I have added documentation examples in an existing or

Diff for: .github/workflows/test-release.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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: '18'
24+
25+
- name: Install npm dependencies
26+
run: |
27+
cd js
28+
npm ci --verbose
29+
npm run build --verbose
30+
31+
- name: Install pypa/build
32+
run: >-
33+
python3 -m
34+
pip install
35+
build
36+
--user
37+
- name: Build a binary wheel and a source tarball
38+
run: python3 -m build
39+
- name: Store the distribution packages
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: python-package-distributions
43+
path: dist/
44+
45+
publish-to-testpypi:
46+
name: Publish Python 🐍 distribution 📦 to TestPyPI
47+
needs:
48+
- build
49+
runs-on: ubuntu-latest
50+
51+
environment:
52+
name: testpypi
53+
url: https://test.pypi.org/p/plotly
54+
55+
permissions:
56+
id-token: write # IMPORTANT: mandatory for trusted publishing
57+
58+
steps:
59+
- name: Download all the dists
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: python-package-distributions
63+
path: dist/
64+
- name: Publish distribution 📦 to TestPyPI
65+
uses: pypa/gh-action-pypi-publish@release/v1
66+
with:
67+
repository-url: https://test.pypi.org/legacy/

Diff for: .gitignore

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
0
22
0.html
33
iframe_figures/
4-
plotly/tests/test_orca/images/linux/failed/
4+
tests/test_orca/images/linux/failed/
55

66
*.egg-info
77

@@ -49,20 +49,17 @@ plotly.egg-info/
4949
# macOS utility file
5050
**/.DS_Store
5151

52-
plotly/tests/test_orca/images/*/failed
53-
plotly/tests/test_orca/images/*/tmp
54-
/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
5555
temp-plot.html
5656
.vscode
5757
doc/python/.ipynb_checkpoints
5858
doc/python/.mapbox_token
5959
doc/.ipynb_checkpoints
6060
tags
6161
doc/check-or-enforce-order.py
62-
63-
jupyterlab_plotly/labextension/
64-
jupyterlab_plotly/nbextension/index.js*
6562
plotly/package_data/widgetbundle.js
6663

67-
test/percy/*.html
68-
test/percy/pandas2/*.html
64+
tests/percy/*.html
65+
tests/percy/pandas2/*.html

Diff for: CHANGELOG.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
# Change Log
1+
# Changelog
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## Unreleased
6+
7+
### Fixed
8+
- Fix third-party widget display issues in v6 [[#5102]https://github.com/plotly/plotly.py/pull/5102]
9+
10+
## [6.0.1] - 2025-03-14
11+
12+
### Updated
13+
- Updated Plotly.js from version 3.0.0 to version 3.0.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#301----2025-02-18) for more information.
14+
15+
16+
### Fixed
17+
- Fix `TypeError` when using `orjson` to serialize `pandas.NA` [[#5040](https://github.com/plotly/plotly.py/pull/5040)].
18+
- Fix issue where using `category_orders` on `px.pie` raised `ColumnNotFoundError` [[#5000](https://github.com/plotly/plotly.py/pull/5000)].
19+
- Fix incorrect `DeprecationWarning` shown when creating a `px` chart [[#5080](https://github.com/plotly/plotly.py/pull/5080), [#5086](https://github.com/plotly/plotly.py/pull/5086)]
20+
21+
522
## [6.0.0] - 2025-01-28
623

724
### Added
@@ -716,7 +733,7 @@ This version includes several performance improvements ([#2368](https://github.c
716733
- Introduce range breaks on date axes (for example, to remove week-ends) via `layout.xaxis.rangebreaks`
717734
- Introduce a new unified x (or y) hovermode (`layout.hovermode="x unified"`), in which the hover box shows the information for all traces at a given x (or y) position
718735
- Add `node.customdata` and `link.customdata` to sankey traces
719-
- Updated [contributing notes](https://github.com/plotly/plotly.py/blob/master/contributing.md) for more explanations on how to contribute to plotly.py [#2290](https://github.com/plotly/plotly.py/pull/2290). Please give feedback on these notes!
736+
- Updated [contributing notes](https://github.com/plotly/plotly.py/blob/master/CONTRIBUTING.md) for more explanations on how to contribute to plotly.py [#2290](https://github.com/plotly/plotly.py/pull/2290). Please give feedback on these notes!
720737
- Updated documentation examples [#2325](https://github.com/plotly/plotly.py/pull/2325), and to show how to color links in Sankey diagrams [#2291](https://github.com/plotly/plotly.py/pull/2291).
721738
- Special thanks to [@SylwiaOliwia2](https://github.com/SylwiaOliwia2) and [@dangercrow](https://github.com/dangercrow) for improving our documentation!
722739

@@ -1738,7 +1755,7 @@ This is a major version with many exciting updates. See the [Introducing plotly.
17381755
- Error message for `plotly.figure_factory.create_choropleth` is now helpful to Anaconda users who do not have the correct modules installed for the County Choropleth figure factory.
17391756

17401757
### Changed / Deprecated
1741-
Please see the [migration guid](migration-guide.md) for a full list of the changes and deprecations in version 3.0.0
1758+
Please see the [migration guide](MIGRATION_GUIDE.md) for a full list of the changes and deprecations in version 3.0.0
17421759

17431760

17441761

Diff for: contributing.md renamed to CONTRIBUTING.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ a PR as follows.
198198

199199
### Making a Development Branch
200200

201-
Third, *don't* work in the `master` branch. As soon as you get your master branch ready, run:
201+
Third, *don't* work in the `main` branch. As soon as you get your main branch ready, run:
202202

203203
**DO THIS (but change the branch name)**
204204
```bash
@@ -219,7 +219,7 @@ First update the version of the `plotly.js` dependency in `js/package.json`.
219219
Then run the `updateplotlyjs` command with:
220220

221221
```bash
222-
$ python setup.py updateplotlyjs
222+
$ python commands.py updateplotlyjs
223223
```
224224

225225
This will download new versions of `plot-schema.json` and `plotly.min.js` from
@@ -233,7 +233,7 @@ For dev branches, it is also possible to use `updateplotlyjsdev` in two configur
233233

234234
If your devbranch is part of the official plotly.js repository, you can use
235235
```bash
236-
python setup.py updateplotlyjsdev --devrepo reponame --devbranch branchname
236+
python commands.py updateplotlyjsdev --devrepo reponame --devbranch branchname
237237
```
238238
to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.
239239

@@ -249,7 +249,7 @@ $ npm pack
249249
$ mv plotly.js-*.tgz plotly.js.tgz
250250

251251
# In your plotly.py/ directory:
252-
$ python setup.py updateplotlyjsdev --local /path/to/your/plotly.js/
252+
$ python commands.py updateplotlyjsdev --local /path/to/your/plotly.js/
253253
```
254254

255255
## Testing
@@ -263,31 +263,31 @@ Since our tests cover *all* the functionality, to prevent tons of errors from sh
263263
After you've done that, go ahead and run the test suite!
264264

265265
```bash
266-
pytest plotly/tests/
266+
pytest tests/
267267
```
268268

269269
Or for more *verbose* output:
270270

271271
```bash
272-
pytest -v plotly/tests/
272+
pytest -v tests/
273273
```
274274

275275
Either of those will run *every* test we've written for the Python API. You can get more granular by running something like:
276276

277277
```bash
278-
pytest plotly/tests/test_core/
278+
pytest tests/test_core/
279279
```
280280

281281
... or even more granular by running something like:
282282

283283
```bash
284-
pytest plotly/tests/test_plotly/test_plot.py
284+
pytest tests/test_plotly/test_plot.py
285285
```
286286

287287
or for a specific test function
288288

289289
```bash
290-
pytest plotly/tests/test_plotly/test_plot.py::test_function
290+
pytest tests/test_plotly/test_plot.py::test_function
291291
```
292292

293293
### Writing Tests

Diff for: MANIFEST.in

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
include LICENSE.txt
22
include README.md
3-
include versioneer.py
4-
include plotly/_version.py
5-
include requires-install.txt
6-
include requires-express.txt
73
include plotly/package_data/widgetbundle.js

Diff for: migration-guide.md renamed to MIGRATION_GUIDE.md

File renamed without changes.

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
6767
---
6868

6969
- [Online Documentation](https://plotly.com/python/)
70-
- [Contributing to plotly](https://github.com/plotly/plotly.py/blob/master/contributing.md)
70+
- [Contributing to plotly](https://github.com/plotly/plotly.py/blob/master/CONTRIBUTING.md)
7171
- [Changelog](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md)
7272
- [Code of Conduct](https://github.com/plotly/plotly.py/blob/master/CODE_OF_CONDUCT.md)
7373
- [Community forum](https://community.plotly.com)
@@ -85,7 +85,7 @@ pip install plotly
8585
or conda.
8686

8787
```
88-
conda install -c plotly plotly
88+
conda install -c conda-forge plotly
8989
```
9090

9191
### Jupyter Widget Support

Diff for: release.md renamed to RELEASE.md

+8-44
Original file line numberDiff line numberDiff line change
@@ -24,47 +24,30 @@ a link to the plotly.js CHANGELOG.
2424

2525
Manually update the versions to `X.Y.Z` in the files specified below.
2626

27+
- `pyproject.toml`
28+
+ update version
2729
- `CHANGELOG.md`
2830
+ update the release date
29-
- `plotly/_widget_version.py`:
30-
+ Update `__frontend_version__` to `^X.Y.Z` (Note the `^` prefix)
3131
- Commit your changes on the branch:
3232
+ `git commit -a -m "version changes for vX.Y.Z"`
33-
34-
### Triggering (and Retriggering) the build
35-
36-
- Commit and add this specific tag which `versioneer` will pick up, and push to Github so that CI will build the release artifacts. This is an atomic push so that CI will read the tag on the commit:
33+
- Create a tag for Github release
3734
+ `git tag vX.Y.Z`
3835
+ `git push --atomic origin release-X.Y.Z vX.Y.Z`
39-
- Create a Github pull request from `release-X.Y.Z` to `master` and wait for CI to be green
40-
- *If something goes wrong below*, you'll need to trigger the build process again after a fix. You'll need to commit your changes in the release branch, move the tag and atomically force push:
41-
+ `git commit ....`
42-
+ `git tag -f vX.Y.Z`
43-
+ `git push --force --atomic origin release-X.Y.Z vX.Y.Z`
36+
- Create a Github pull request from `release-X.Y.Z` to `main` and wait for CI to be green
4437

4538
### Download and QA CI Artifacts
4639

4740
The `full_build` job in the `release_build` workflow in CircleCI produces a tarball of artifacts `output.tgz` which you should download and decompress, which will give you a directory called `output`. The filenames contained within will contain version numbers.
4841

49-
**Note: if any of the version numbers are not simply `X.Y.Z` but include some kind of git hash, then this is a dirty build and you'll need to clean up whatever is dirtying the tree and follow the instructions above to trigger the build again.** (That said, you can do QA on dirty builds, you just can't publish them.)
50-
5142
To locally install the PyPI dist, make sure you have an environment with JupyterLab installed (maybe one created with `conda create -n condatest python=3.10 jupyter anywidget pandas`):
5243

5344
- `tar xzf output.tgz`
5445
- `pip uninstall plotly`
5546
- `conda uninstall plotly` (just in case!)
5647
- `pip install path/to/output/dist/plotly-X.Y.X-py3-none-any.whl`
5748

58-
To locally install the Conda dist (generally do this in a different, clean environment from the one above!):
59-
60-
- `conda uninstall plotly`
61-
- `pip uninstall plotly` (just in case!)
62-
- `conda install path/to/output/plotly-X.Y.Z.tar.bz2`
63-
6449
You'll want to check, in both Lab and Notebook, **in a brand new notebook in each** so that there is no caching of previous results, that `go.Figure()` and `go.FigureWidget()` work without error.
6550

66-
If something is broken, you'll need to fix it and trigger the build again (see above section).
67-
6851
### Publishing
6952

7053
Once you're satisfied that things render in Lab and Notebook in Widget and regular mode,
@@ -73,34 +56,24 @@ you can publish the artifacts. **You will need special credentials from Plotly l
7356

7457
Publishing to PyPI:
7558
```bash
76-
(plotly_dev) $ cd path/to/output/dist
77-
(plotly_dev) $ twine upload plotly-X.Y.Z*
78-
```
79-
80-
Publishing to `plotly` conda channel (make sure you have run `conda install anaconda-client` to get the `anaconda` command):
81-
82-
```
8359
(plotly_dev) $ cd path/to/output
84-
(plotly_dev) $ anaconda upload plotly-X.Y.Z.tar.bz2
60+
(plotly_dev) $ twine upload plotly-X.Y.Z*
8561
```
8662

87-
8863
### Merge the PR and make a Release
8964

90-
1. Merge the pull request you created above into `master`
65+
1. Merge the pull request you created above into `main`
9166
2. Go to https://github.com/plotly/plotly.py/releases and "Draft a new release"
9267
3. Enter the `vX.Y.Z` tag you created already above and make "Release title" the same string as the tag.
9368
4. Copy the changelog section for this version as the "Describe this release"
9469

9570
### Update documentation site
9671

9772
1. Search for the previous version string in the docs and replace it with the new version string, including but not necessarily limited to the following files:
98-
- `doc/python/getting-started.md`
9973
- `doc/apidoc/conf.py`
10074
- `doc/requirements.txt`
101-
- `binder/requirements.txt`
102-
2. `doc-prod` should already have been merged on a regular basis into `master`, but
103-
start by doing it first if not. Then merge `master` into `doc-prod` to deploy the doc related
75+
2. `doc-prod` should already have been merged on a regular basis into `main`, but
76+
start by doing it first if not. Then merge `main` into `doc-prod` to deploy the doc related
10477
to features in the release.
10578
3. in a clone of the [`graphing-library-docs` repo](https://github.com/plotly/graphing-library-docs):
10679
1. bump the version of Plotly.py in `_data/pyversion.json`
@@ -131,12 +104,3 @@ PyPI RC (no special flags, just the `rc1` suffix):
131104

132105
The `--tag next` part ensures that users won't install this version unless
133106
they explicitly ask for the version or for the version with the `next` tag.
134-
135-
Conda RC:
136-
137-
```
138-
$ anaconda upload --label test plotly-*.tar.bz2
139-
```
140-
141-
The `--label test` part ensures that users won't install this version unless
142-
they explicitly ask for the version or for the version with the `next` tag.

0 commit comments

Comments
 (0)