Skip to content

Update live docs with Plotly.py 6.0.1 (merge changes on main to doc-prod) #5093

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

Merged
merged 201 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
7eb6dfd
move plotly-geo and chart-studio to their own repos
emilykl Jan 11, 2025
a6f02b7
Move package metadata into pyproject.toml and all other python code i…
marthacryan Jan 14, 2025
7be470b
Cleanup extra changes
marthacryan Jan 14, 2025
7170a51
Revert changes to command names
marthacryan Jan 14, 2025
6a2d9bc
Add version attr
marthacryan Jan 14, 2025
37807da
Add correct output directory for artifacts
marthacryan Jan 14, 2025
989e974
remove references to plotly-geo and chart-studio as subdirectories of…
emilykl Jan 14, 2025
41cd025
Move version into separate file
marthacryan Jan 15, 2025
7fd6870
Attempt to fix version issues
marthacryan Jan 16, 2025
cdd0204
Attempt to fix version issues
marthacryan Jan 16, 2025
85ac208
Merge branch 'master' into move-chart-studio-and-plotly-geo
emilykl Jan 29, 2025
3abd6d4
fix: custom category order was hard-coded
MarcoGorelli Jan 30, 2025
9043fff
add go.Pie comparison
MarcoGorelli Jan 30, 2025
99cbc45
remove unnecessary paragraph
emilykl Jan 30, 2025
d974535
Merge pull request #5000 from MarcoGorelli/hardcoded-var
emilykl Jan 30, 2025
9910078
Merge pull request #4972 from plotly/move-chart-studio-and-plotly-geo
emilykl Jan 30, 2025
48cc36a
Merge with master
marthacryan Jan 30, 2025
9795406
Add pip install editable to CI config
marthacryan Jan 30, 2025
39750d5
Add version attribute
marthacryan Jan 30, 2025
937ad46
Remove extra reference to version.py
marthacryan Jan 30, 2025
0d06ded
Code format
marthacryan Jan 30, 2025
ca9aa0a
Explicitly import importlib.metadata
marthacryan Jan 30, 2025
32adcc3
move packages/python/plotly to top level
emilykl Jan 30, 2025
ec7c557
Add __name__ == main wrapper around command line arg parsing
marthacryan Jan 30, 2025
6ea167d
update to python 3.9 for dev build to fix importlib error
marthacryan Jan 30, 2025
6f40cdc
Remove unnecessary widget version
marthacryan Jan 30, 2025
cb01379
adjust paths
emilykl Jan 30, 2025
2ef2559
Update version of python for dev build CI
marthacryan Jan 30, 2025
634c787
Add pip install editable
marthacryan Jan 30, 2025
8abdeaf
Add pyproject.toml to conda recipe
marthacryan Jan 30, 2025
dafa57f
Fix filepath in conda recipe
marthacryan Jan 30, 2025
f642b58
update paths in setup.py
emilykl Jan 30, 2025
54d076b
update paths in codegen
emilykl Jan 31, 2025
76ca2a3
re-add missing geojson data file
emilykl Feb 3, 2025
17e0147
add test for loading px datasets
emilykl Feb 3, 2025
bfd6d07
add v6 migration to migration guide
emilykl Feb 3, 2025
370efcd
Fix accessing of pyproject.toml version in conda recipe
marthacryan Feb 3, 2025
b818373
update .gitignore for widget
emilykl Feb 4, 2025
7cd04fb
add link to plotly-geo to README
emilykl Feb 4, 2025
9e15334
update paths in Makefile
emilykl Feb 4, 2025
5813a8a
Merge pull request #5002 from plotly/simplify-dir-structure
emilykl Feb 4, 2025
dc1b55b
Merge with master
marthacryan Feb 4, 2025
011d410
Remove setup.py from root
marthacryan Feb 4, 2025
48e7de3
Fix filepath in commands.py
marthacryan Feb 4, 2025
6076305
remove
emilykl Feb 4, 2025
c85c576
remove tox instructions
emilykl Feb 4, 2025
d1905cb
Use new variable name for project root in commands.py
marthacryan Feb 4, 2025
f68d997
Remove conda from CI and release
marthacryan Feb 4, 2025
2a366ef
Add license file and pytest to pyproject.toml
marthacryan Feb 4, 2025
69897ae
Fix syntax issues with pyproject.toml
marthacryan Feb 4, 2025
bcfa6a7
Update release instructions
marthacryan Feb 4, 2025
5d51c80
remove pre-commit file
emilykl Feb 4, 2025
86a7e12
Merge pull request #5010 from plotly/more-cleanup
gvwilson Feb 5, 2025
1f1dae9
remove versioneer from manifest.in
marthacryan Feb 5, 2025
2ca6dae
Pin narwhals version
marthacryan Feb 5, 2025
a7499c1
Update pyproject.toml
marthacryan Feb 5, 2025
56d2096
Remove wheel install from CI
marthacryan Feb 5, 2025
ac57d7d
Merge branch 'use-pyprojecttoml' of github.com:plotly/plotly.py into …
marthacryan Feb 5, 2025
c6992fc
Update pin of pandas instead of narwhals
marthacryan Feb 5, 2025
5111cfa
Merge branch 'master' of github.com:plotly/plotly.py into use-pyproje…
marthacryan Feb 5, 2025
5d539a0
test: working on PyArrow datetime test
gvwilson Feb 5, 2025
410d30e
Update plotly/tests/test_optional/test_px/test_px_hover.py
gvwilson Feb 6, 2025
c58e73a
fix: PyArrow datetime issue in test
gvwilson Feb 6, 2025
12b47e0
Update plotly/tests/test_optional/test_px/test_px_input.py
gvwilson Feb 6, 2025
72bc179
fix: conditionally remove '"template"' key from test JSON
gvwilson Feb 6, 2025
15a7028
Move tests out of the plotly directory
marthacryan Feb 6, 2025
f3db071
Rename any references to plotly/tests with just tests
marthacryan Feb 6, 2025
6acd25a
Move plotly_utils tests into root tests directory
marthacryan Feb 6, 2025
0c343ef
Reset filepath to one that will cause import to fail
marthacryan Feb 6, 2025
a94517c
fix: remove xfail for PyArrow timezone test
gvwilson Feb 6, 2025
98f2c8f
Fix filepath in optional_imports test
marthacryan Feb 6, 2025
28a5b74
Update filepaths to plotly_utils tests
marthacryan Feb 6, 2025
39032fb
Black
marthacryan Feb 6, 2025
4573074
Black
marthacryan Feb 6, 2025
86bb1a8
Update plotly/tests/test_optional/test_px/test_px_input.py
gvwilson Feb 6, 2025
742f592
Update plotly/tests/test_optional/test_px/test_px_hover.py
gvwilson Feb 6, 2025
19b611d
Merge pull request #4977 from plotly/updates-to-tests
gvwilson Feb 7, 2025
10b2b87
Merge with master
marthacryan Feb 7, 2025
e41dcab
Merge pull request #4970 from plotly/use-pyprojecttoml
marthacryan Feb 7, 2025
f356c8a
Unpin test requirements and use the same requirements for all python …
marthacryan Feb 7, 2025
27c0e9d
Remove extra requirements files
marthacryan Feb 7, 2025
fab49c7
remove plotly-geo install and orca tests from circleci config
marthacryan Feb 7, 2025
73bc82a
Remove _plotly_future_ and all references to it
marthacryan Feb 7, 2025
e9523e8
Merge pull request #5020 from plotly/remove-plotly-futures
gvwilson Feb 7, 2025
397b1ef
pin fiona version for python<=3.8
emilykl Feb 7, 2025
93df541
Change md file names to all caps for consistency
marthacryan Feb 7, 2025
4a9cc7e
Merge pull request #5021 from plotly/capitalize-md
gvwilson Feb 7, 2025
190a6c0
Use correct filepath for README.md in pyproject.toml
marthacryan Feb 10, 2025
60ada7c
Merge pull request #5024 from plotly/marthacryan-patch-1
gvwilson Feb 10, 2025
24fe0ee
Only install vaex for python<=3.9
marthacryan Feb 10, 2025
c2af57b
Prevent running vaex tests if vaex isn't installed
marthacryan Feb 10, 2025
7855fa6
Code formatting
marthacryan Feb 10, 2025
508135f
Update tests/test_optional/test_px/test_px_input.py
marthacryan Feb 11, 2025
7ca7295
try only running vaex with python 3.9
marthacryan Feb 11, 2025
71c6a95
Merge branch 'unpin-requirements' of github.com:plotly/plotly.py into…
marthacryan Feb 11, 2025
d282c49
Set vaex tests to run on only python 3.9
marthacryan Feb 11, 2025
ebd06f8
Use uv instead of pip for CI download
marthacryan Feb 11, 2025
d69f1dc
Update dependencies download to use uv
marthacryan Feb 11, 2025
84dde9e
Fix plotly-geo install
marthacryan Feb 11, 2025
69a39b9
Use correct venv activate step
marthacryan Feb 11, 2025
4fc33b5
Run pytest through python to fix dependency issue
marthacryan Feb 11, 2025
632cf32
Add uv for doc build
marthacryan Feb 11, 2025
5981bfb
Remove flag that doesn't work for uv
marthacryan Feb 11, 2025
ef4abb8
Only run vaex tests if vaex is installed
marthacryan Feb 11, 2025
ffb2b25
Remove flag that doesn't work for uv
marthacryan Feb 11, 2025
fe8b92e
Remove unnecessary uninstall step
marthacryan Feb 11, 2025
cfce34f
Make calls to pytest wrapped by python -m
marthacryan Feb 11, 2025
82736ad
Merge pull request #5029 from plotly/uv-ci
marthacryan Feb 11, 2025
f06ed71
Merge with master
marthacryan Feb 11, 2025
fe3740e
Fix handling of vaex not being present
marthacryan Feb 11, 2025
323cc80
Merge test and tests folder and clean up files
marthacryan Feb 11, 2025
a95ed3f
Fix broken filepath
marthacryan Feb 11, 2025
3ddf627
Merge pull request #5023 from plotly/update-test-dir
marthacryan Feb 10, 2025
719292e
remove extraneous import of ipython display
marthacryan Feb 11, 2025
cae9d77
remove unnecessary py parameter and add numpy_installed parameter
marthacryan Feb 12, 2025
cff6314
Delete binder configuration
marthacryan Feb 12, 2025
946d96c
Merge branch 'master' into remove-binder
marthacryan Feb 12, 2025
bcdc224
Update conditional in circleci config
marthacryan Feb 12, 2025
c493669
Fix syntax of conditional
marthacryan Feb 13, 2025
1367fa4
Fix conditional
marthacryan Feb 13, 2025
f239366
Merge pull request #5031 from plotly/remove-binder
marthacryan Feb 13, 2025
7095710
Parameterize jobs
marthacryan Feb 13, 2025
acc61b4
Fix python versions
marthacryan Feb 13, 2025
8c3bb2e
Fix indentation
marthacryan Feb 13, 2025
707bf68
Rename job for readability of CI output
marthacryan Feb 13, 2025
777e376
Switch to uv for other tests
marthacryan Feb 13, 2025
19e2c9a
Merge branch 'main' of github.com:plotly/plotly.py into unpin-require…
marthacryan Feb 13, 2025
f780164
Revert to pip for pandas downgrade
marthacryan Feb 13, 2025
f140060
Address review
marthacryan Feb 13, 2025
c9215f0
Revert changes to black version
marthacryan Feb 13, 2025
4664d15
Add pandas version as parameter
marthacryan Feb 13, 2025
d9c9c5e
Use pip for downgrade
marthacryan Feb 13, 2025
36c0437
Use easier to read name for jobs
marthacryan Feb 13, 2025
29f984b
Try different pandas version
marthacryan Feb 13, 2025
2a63724
Remove numpy config
marthacryan Feb 13, 2025
fcbcc07
update references to master brach
LiamConnors Feb 13, 2025
3850056
Merge pull request #5036 from plotly/update-master-references
LiamConnors Feb 13, 2025
7b90bb6
Handle pd.NA in clean_to_json_compatible
DavidKatz-il Feb 16, 2025
775734e
update changelog
DavidKatz-il Feb 16, 2025
ab90b80
Add back in express extra dependencies and required dependencies
marthacryan Feb 18, 2025
a6ee27c
Merge pull request #5040 from DavidKatz-il/fix-5039
marthacryan Feb 18, 2025
75b5106
Remove deleted files from MANIFEST.in
marthacryan Feb 18, 2025
954db31
Prevent pandas install step if default
marthacryan Feb 18, 2025
037956a
Merge branch 'main' into merge-docs-changes-to-main
LiamConnors Feb 18, 2025
156559d
Merge branch 'main' into merge-docs-changes-to-main
LiamConnors Feb 18, 2025
45a8fca
Update pyproject.toml
marthacryan Feb 18, 2025
f878224
Merge pull request #5044 from plotly/add-express-dep
marthacryan Feb 18, 2025
396b066
Merge branch 'main' of github.com:plotly/plotly.py into unpin-require…
marthacryan Feb 18, 2025
60d8682
Remove narwhals from dependencies
marthacryan Feb 18, 2025
c54a2bd
Merge pull request #5043 from plotly/merge-docs-changes-to-main
LiamConnors Feb 19, 2025
5e90e7d
Remove narwhals from core requirements
marthacryan Feb 20, 2025
cab519c
Update .circleci/config.yml
marthacryan Feb 26, 2025
c29f6a4
Add check for pandas version to confirm correct install
marthacryan Feb 26, 2025
e54f99c
Use uv for pip
marthacryan Feb 26, 2025
2750aa0
Add numpy version pin
marthacryan Mar 6, 2025
53dc043
Switch to use uv in core tests as well
marthacryan Mar 6, 2025
f5c2bec
Use uv for percy tests
marthacryan Mar 6, 2025
d3de0b1
Use later version of numpy for scipy compatibility
marthacryan Mar 6, 2025
b89f793
Use version of numpy from before switch to uv
marthacryan Mar 6, 2025
0a74d1b
Use different version of numpy
marthacryan Mar 6, 2025
801dde1
Update name of test for consistency with other CI jobs
marthacryan Mar 6, 2025
2799251
Merge pull request #5019 from plotly/unpin-requirements
marthacryan Mar 6, 2025
84e0eff
remove [all] extra from ipython, and add comment explaining fiona pin
emilykl Mar 7, 2025
df55242
remove ipykernel; it's installed by jupyter anyway and we don't impor…
emilykl Mar 7, 2025
f2d08bc
bump python versions in ci and add python 3.13
emilykl Mar 7, 2025
40c1004
build-doc won't run on python 3.12, rip
emilykl Mar 7, 2025
f96c25f
bump python version from 3.9 to 3.12 for percy tests (will this work?)
emilykl Mar 7, 2025
02a23ff
remove scipy pin
emilykl Mar 7, 2025
e8cb1f0
try 3.11 for percy tests
emilykl Mar 7, 2025
533f5f7
use python 3.9 for build-doc
emilykl Mar 10, 2025
3e0a46c
bump pandas 1 version for Percy tests
emilykl Mar 10, 2025
18f8444
re-pin scipy version
emilykl Mar 10, 2025
8876fab
Merge pull request #5073 from plotly/test-python-3.13-in-ci
emilykl Mar 10, 2025
bb932b5
Merge branch 'main' into update-test-requirements-optional
emilykl Mar 10, 2025
e3f8c1a
Merge pull request #5072 from plotly/update-test-requirements-optional
emilykl Mar 10, 2025
c555d57
suppress DeprecationWarnings when updating template.data
emilykl Mar 12, 2025
cf3e901
edit comment
emilykl Mar 12, 2025
9243f6d
add tests for mapbox deprecation warnings
emilykl Mar 12, 2025
2a0241d
format
emilykl Mar 12, 2025
237648d
Remove 6.0.1 from changelog
LiamConnors Mar 13, 2025
816e5d8
Add fix to changelog
LiamConnors Mar 13, 2025
e07ef35
Merge pull request #5083 from plotly/LiamConnors-patch-3
LiamConnors Mar 13, 2025
5fe330d
Merge pull request #5084 from plotly/update-changelog-mar
LiamConnors Mar 13, 2025
0968434
Merge pull request #5080 from plotly/fix-bogus-deprecationwarning
emilykl Mar 13, 2025
47cfafa
Add issue links to changelog
LiamConnors Mar 13, 2025
b3aab37
modify codegen instead of modifying autogenerated _template.py file
emilykl Mar 13, 2025
22aa9ba
format
emilykl Mar 13, 2025
ded1322
Merge pull request #5086 from plotly/fix-deprecationwarning-fix
emilykl Mar 14, 2025
7d7548b
bump plotly.js to 3.0.1
emilykl Mar 14, 2025
385c1a7
update changelog
emilykl Mar 14, 2025
36a99ce
update package-lock
emilykl Mar 14, 2025
5a68ce3
Merge pull request #5088 from plotly/plotlyjs-3.0.1
emilykl Mar 14, 2025
40a34d8
Merge pull request #5085 from plotly/tidy-changelog
LiamConnors Mar 14, 2025
db73f5d
Update CHANGELOG.md
emilykl Mar 14, 2025
d4bf06a
Merge pull request #5089 from plotly/update-changelog-depr
emilykl Mar 14, 2025
58e33fc
version changes for v6.0.1
emilykl Mar 14, 2025
ff43e4a
Merge pull request #5090 from plotly/release-6.0.1
emilykl Mar 14, 2025
bc826a2
Merge branch 'main' into merge-recent-changes-main
LiamConnors Mar 17, 2025
834d36c
Merge pull request #5091 from plotly/merge-recent-changes-main
LiamConnors Mar 17, 2025
e265bf0
Update Plotly version
LiamConnors Mar 17, 2025
909f1fb
Merge pull request #5092 from plotly/update-plotly-version
LiamConnors Mar 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
535 changes: 180 additions & 355 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ below :-).
### Documentation PR

- [ ] I've [seen the `doc/README.md` file](https://github.com/plotly/plotly.py/blob/master/doc/README.md)
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `master` branch
- [ ] This change runs in the current version of Plotly on PyPI and targets the `doc-prod` branch OR it targets the `main` branch
- [ ] If this PR modifies the first example in a page or adds a new one, it is a `px` example if at all possible
- [ ] Every new/modified example has a descriptive title and motivating sentence or paragraph
- [ ] Every new/modified example is independently runnable
Expand All @@ -27,7 +27,7 @@ below :-).

## Code PR

- [ ] 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.
- [ ] 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.
- [ ] I have added tests (if submitting a new feature or correcting a bug) or
modified existing tests.
- [ ] For a new feature, I have added documentation examples in an existing or
Expand Down
19 changes: 8 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
0
0.html
iframe_figures/
packages/python/plotly/plotly/tests/test_orca/images/linux/failed/
tests/test_orca/images/linux/failed/

*.egg-info

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

# Don't ignore dataset files
!*.csv.gz
!*.geojson.gz

*.ipynb

Expand Down Expand Up @@ -48,21 +49,17 @@ plotly.egg-info/
# macOS utility file
**/.DS_Store

plotly/tests/test_orca/images/*/failed
plotly/tests/test_orca/images/*/tmp
/plotly-package/plotly/tests/test_core/test_offline/plotly.min.js
tests/test_orca/images/*/failed
tests/test_orca/images/*/tmp
tests/test_core/test_offline/plotly.min.js
temp-plot.html
.vscode
doc/python/.ipynb_checkpoints
doc/python/.mapbox_token
doc/.ipynb_checkpoints
tags
doc/check-or-enforce-order.py
plotly/package_data/widgetbundle.js

packages/javascript/jupyterlab-plotly/lib/
packages/python/plotly/jupyterlab_plotly/labextension/
packages/python/plotly/jupyterlab_plotly/nbextension/index.js*
packages/python/plotly/plotly/package_data/widgetbundle.js

test/percy/*.html
test/percy/pandas2/*.html
tests/percy/*.html
tests/percy/pandas2/*.html
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml

This file was deleted.

16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [6.0.1] - 2025-03-14

### Updated
- 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.


### Fixed
- Fix `TypeError` when using `orjson` to serialize `pandas.NA` [[#5040](https://github.com/plotly/plotly.py/pull/5040)].
- Fix issue where using `category_orders` on `px.pie` raised `ColumnNotFoundError` [[#5000](https://github.com/plotly/plotly.py/pull/5000)].
- 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)]


## [6.0.0] - 2025-01-28

### Added
Expand Down Expand Up @@ -716,7 +728,7 @@ This version includes several performance improvements ([#2368](https://github.c
- Introduce range breaks on date axes (for example, to remove week-ends) via `layout.xaxis.rangebreaks`
- 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
- Add `node.customdata` and `link.customdata` to sankey traces
- 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!
- 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!
- 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).
- Special thanks to [@SylwiaOliwia2](https://github.com/SylwiaOliwia2) and [@dangercrow](https://github.com/dangercrow) for improving our documentation!

Expand Down Expand Up @@ -1738,7 +1750,7 @@ This is a major version with many exciting updates. See the [Introducing plotly.
- 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.

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



Expand Down
94 changes: 22 additions & 72 deletions contributing.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ There are many ways to contribute to plotly.py. To contribute effectively, it is
is [generated from the Plotly.js schema](https://plotly.com/python/figure-structure/),
so changes to be made in this package need to be
[contributed to Plotly.js](https://github.com/plotly/plotly.js) or to the `codegen` system
in `packages/python/plotly/codegen`. Most of the codegen code concerns the generation of docstrings from
in `codegen/`. Most of the codegen code concerns the generation of docstrings from
the schema JSON in Plotly.js. Traces and
Layout classes have a direct correspondence with their Javascript
counterpart. Higher-level methods that work on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `packages/python/plotly/plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
counterpart. Higher-level methods that work on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
`update_layout`, `add_trace`, etc.

- [the `plotly.express` module](https://plotly.com/python/plotly-express/) (usually imported as `px`) is a high-level
functional API that uses `graph_objects` under the hood. Its code is in `packages/python/plotly/plotly/express`.
functional API that uses `graph_objects` under the hood. Its code is in `plotly/express/`.
Plotly Express functions
are designed to be highly consistent with each other, and to do *as little computation
in Python as possible*, generally concerning themselves with formatting data and creating
Expand All @@ -49,13 +49,13 @@ There are many ways to contribute to plotly.py. To contribute effectively, it is
as we are introducing more features into `plotly.express`. Some issues in the
tracker are labeled "figure_factory" and can be good issues to work on. More
instructions on figure factories are found
[here](packages/python/plotly/plotly/figure_factory/README.md).
[here](plotly/figure_factory/README.md).

- other pure-Python submodules are: `plotly.io` (low-level interface for
displaying, reading and writing figures), `plotly.subplots` (helper function
for layout of multi-plot figures)

- tests are found in `packages/python/plotly/plotly/tests`. Different
- tests are found in `plotly/tests`. Different
directories correspond to different test jobs (with different dependency sets)
run in continuous integration. More is explained about tests
in the following "Technical aspects" section.
Expand Down Expand Up @@ -138,27 +138,25 @@ We will support Python 3.12 and higher versions soon.

### Install development requirements (Non-Windows)
```bash
(plotly_dev) $ pip install -r packages/python/plotly/requires-optional.txt
(plotly_dev) $ pip install -r requires-optional.txt
```
### Install development requirements (Windows + Conda)
Because Windows requires Visual Studio libraries to compile some of the optional dependencies, follow these steps to
complete installation and avoid gdal-config errors.

```bash
(plotly_dev) $ conda install fiona
(plotly_dev) $ pip install -r packages/python/plotly/requires-optional.txt
(plotly_dev) $ pip install -r requires-optional.txt
```

### Editable install of plotly packages
```bash
(plotly_dev) $ pip install -e packages/python/plotly/
(plotly_dev) $ pip install -e packages/python/chart-studio/
(plotly_dev) $ pip install -e packages/python/plotly-geo/
(plotly_dev) $ pip install -e .
```

**Note**: To test `go.FigureWidget` locally, you'll need to generate the javascript bundle as follows:
```
cd packages/python/plotly/js
cd js
npm install && npm run build
```

Expand All @@ -176,7 +174,7 @@ documentation on _development mode_.
This repo uses the [Black](https://black.readthedocs.io/en/stable/) code formatter,
and the [pre-commit](https://pre-commit.com/) library to manage a git commit hook to
run Black prior to each commit. Both pre-commit and black are included in the
`packages/python/plotly/requires-optional.txt` file, so you should have them
`requires-optional.txt` file, so you should have them
installed already if you've been following along.

To enable the Black formatting git hook, run the following from within your virtual
Expand All @@ -200,7 +198,7 @@ a PR as follows.

### Making a Development Branch

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

**DO THIS (but change the branch name)**
```bash
Expand All @@ -216,13 +214,12 @@ make that pull request!


## Update to a new version of Plotly.js
First update the version of the `plotly.js` dependency in `packages/python/plotly/js/package.json`.
First update the version of the `plotly.js` dependency in `js/package.json`.

Then run the `updateplotlyjs` command with:

```bash
$ cd packages/python/plotly
$ python setup.py updateplotlyjs
$ python commands.py updateplotlyjs
```

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

If your devbranch is part of the official plotly.js repository, you can use
```bash
python setup.py updateplotlyjsdev --devrepo reponame --devbranch branchname
python commands.py updateplotlyjsdev --devrepo reponame --devbranch branchname
```
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.

Expand All @@ -251,16 +248,13 @@ $ npm run build
$ npm pack
$ mv plotly.js-*.tgz plotly.js.tgz

# In your plotly.py/packages/python/plotly/ directory:
$ python setup.py updateplotlyjsdev --local /path/to/your/plotly.js/
# In your plotly.py/ directory:
$ python commands.py updateplotlyjsdev --local /path/to/your/plotly.js/
```

## Testing

We take advantage of two tools to run tests:

* [`tox`](https://tox.readthedocs.io/en/latest/), which is both a virtualenv management and test tool.
* [`pytest`](https://docs.pytest.org/en/latest/), a powerful framework for unit testing.
To run tests, we use [`pytest`](https://docs.pytest.org/en/latest/), a powerful framework for unit testing.

### Running Tests with `pytest`

Expand All @@ -269,79 +263,35 @@ Since our tests cover *all* the functionality, to prevent tons of errors from sh
After you've done that, go ahead and run the test suite!

```bash
pytest packages/python/plotly/plotly/tests/
pytest tests/
```

Or for more *verbose* output:

```bash
pytest -v packages/python/plotly/plotly/tests/
pytest -v tests/
```

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

```bash
pytest packages/python/plotly/plotly/tests/test_core/
pytest tests/test_core/
```

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

```bash
pytest plotly/tests/test_plotly/test_plot.py
pytest tests/test_plotly/test_plot.py
```

or for a specific test function

```bash
pytest plotly/tests/test_plotly/test_plot.py::test_function
```

### Running tests with `tox`

Running tests with tox is much more powerful, but requires a bit more setup.

You'll need to export an environment variable for *each* tox environment you wish to test with. For example, if you want to test with `Python 3.9` and
`Python 3.6`, but only care to check the `core` specs, you would need to ensure that the following variables are exported:

```
export PLOTLY_TOX_PYTHON_39=<python binary>
export PLOTLY_TOX_PYTHON_36=<python binary>
```

Where the `<python binary` is going to be specific to your development setup. As a more complete example, you might have this loaded in a `.bash_profile` (or equivalent shell loader):

```bash
############
# tox envs #
############

export PLOTLY_TOX_PYTHON_39=python3.9
export PLOTLY_TOX_PYTHON_36=python3.6
export TOXENV=py39-core,py36-core
```

Where `TOXENV` is the environment list you want to use when invoking `tox` from the command line. Note that the `PLOTLY_TOX_*` pattern is used to pass in variables for use in the `tox.ini` file. Though this is a little setup, intensive, you'll get the following benefits:

* `tox` will automatically manage a virtual env for each environment you want to test in.
* You only have to run `tox` and know that the module is working in all included Python versions.

Finally, `tox` allows you to pass in additional command line arguments that are formatted in (by us) in the `tox.ini` file, see `{posargs}`. This is setup to help with our configuration of [pytest markers](http://doc.pytest.org/en/latest/example/markers.html), which are set up in `packages/python/plotly/pytest.ini`. To run only tests that are *not* tagged with `nodev`, you could use the following command:

```bash
tox -- -a '!nodev'
```

Note that anything after `--` is substituted in for `{posargs}` in the tox.ini. For completeness, because it's reasonably confusing, if you want to force a match for *multiple* `pytest` marker tags, you comma-separate the tags like so:

```bash
tox -- -a '!nodev','!matplotlib'
pytest tests/test_plotly/test_plot.py::test_function
```

### Writing Tests

You're *strongly* encouraged to write tests that check your added functionality.

When you write a new test anywhere under the `tests` directory, if your PR gets accepted, that test will run in a virtual machine to ensure that future changes don't break your contributions!

Test accounts include: `PythonTest`, `PlotlyImageTest`, and `PlotlyStageTest`.

3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include LICENSE.txt
include README.md
include plotly/package_data/widgetbundle.js
3 changes: 3 additions & 0 deletions migration-guide.md → MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Migration to Version 6
See https://plotly.com/python/v6-migration/

# Migration to Version 5
See https://community.plotly.com/t/introducing-plotly-py-5-0-0-a-new-federated-jupyter-extension-icicle-charts-and-bar-chart-patterns/54039

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
---

- [Online Documentation](https://plotly.com/python/)
- [Contributing to plotly](https://github.com/plotly/plotly.py/blob/master/contributing.md)
- [Contributing to plotly](https://github.com/plotly/plotly.py/blob/master/CONTRIBUTING.md)
- [Changelog](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md)
- [Code of Conduct](https://github.com/plotly/plotly.py/blob/master/CODE_OF_CONDUCT.md)
- [Community forum](https://community.plotly.com)
Expand Down Expand Up @@ -141,6 +141,8 @@ or conda
conda install -c plotly plotly-geo=1.0.0
```

`plotly-geo` can be found on Github at https://github.com/plotly/plotly-geo.

## Copyright and Licenses

Code and documentation copyright 2019 Plotly, Inc.
Expand Down
Loading