From 9fdd6b60e5a0b3f833773bb8887e9a8cf9552ed3 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Tue, 7 May 2024 10:46:36 -0400 Subject: [PATCH] build+docs: use Python 3.8 - 3.11 and pin pytest 8.1.1 - `conda create -n plotly-dev python` currently gives Python 3.12.3. - `pytest -v packages/python/plotly/plotly/tests/` then fails with `ModuleNotFoundError: No module named 'imp'`. - `pip install imp` fails: the `imp` module was deprecated in Python 3.11 and has been removed in Python 3.12. - So update `contributing.md` to specify `conda create -n plotly-dev python=3.11` - But now `pytest` fails - `File "", line 1072, in _find_spec` - `AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec'` - Problem was `pytest==3.5.1` in `packages/python/plotly/optional-requirements.txt` - Update to `pytest==8.1.1` and `pytest` runs - Some tests are failing (orca problems, `statsmodels` not installed, etc.) - Will fix these in separate PRs - Update `contributing.md` to state that we've tested changes against Python 3.8-3.11 - Specifically 3.8.19, 3.9.19, 3.10.14, and 3.11.9 on MacOS Sonoma 14.4.1 - Update `CHANGELOG.md` --- CHANGELOG.md | 5 +++++ contributing.md | 7 +++++-- packages/python/plotly/optional-requirements.txt | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adad2f3cbae..da08517d6b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [5.23.0] - TBD + +### Updated +- Specify Python version 3.8-3.11 for development virtual environments and pin `pytest` at version 8.1.1 to match. + ## [5.22.0] - 2024-05-01 ### Updated diff --git a/contributing.md b/contributing.md index c7b271cfa75..15c8560bc52 100644 --- a/contributing.md +++ b/contributing.md @@ -125,13 +125,16 @@ learn and become confident about git, like http://try.github.io/. ### Create a virtual environment for plotly development -You can use either [conda][conda-env] or [virtualenv][virtualenv] to create a virtual environment for plotly development, e.g. +You can use either [conda][conda-env] or [virtualenv][virtualenv] to create a virtual environment for plotly development, e.g.: ```bash -conda create -n plotly-dev python +conda create -n plotly-dev python=3.11 conda activate plotly-dev ``` +As of May 2024 our dependencies have been tested against Python versions 3.8 to 3.11. +We will support Python 3.12 and higher versions soon. + [conda-env]: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands [virtualenv]: http://docs.python-guide.org/en/latest/dev/virtualenvs/ diff --git a/packages/python/plotly/optional-requirements.txt b/packages/python/plotly/optional-requirements.txt index 3a02a440624..ba3c0549121 100644 --- a/packages/python/plotly/optional-requirements.txt +++ b/packages/python/plotly/optional-requirements.txt @@ -14,7 +14,7 @@ numpy ## testing dependencies ## coverage==4.3.1 mock==2.0.0 -pytest==3.5.1 +pytest==8.1.1 backports.tempfile==1.0 xarray pytz