-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
build+docs: use Python 3.11 and pin a recent version of pytest #4605
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
build+docs: use Python 3.11 and pin a recent version of pytest #4605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good as far as I'm concerned. Thanks @gvwilson .
Have you been able to determine yet which dependency(ies) relies on imp
?
@emilykl not yet - I'd like to fix the broken tests on Python 3.11 first, then switch back to Python 3.12 and tackle the |
|
||
### Updated | ||
- Specify Python 3.11 in virtual environment for development and pin `pytest` at version 8.1.1 to match | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LiamConnors which version we used for the last plotly.py release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wondering perhaps we wanna mention the version in release docs below? https://github.com/plotly/plotly.py/blob/master/release.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release build uses 3.9 and the docs build also currently uses 3.9, though I have a PR to upgrade the docs build to 3.10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://docs.python.org/3/whatsnew/3.11.html
3.11 seems to run faster when compared to 3.10.
Do you think we could/should upgrade those to 3.10 or 3.11?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you like me to check that the newly-pinned version of pytest (8.1.1) works with Python 3.9 and Python 3.10 as well as Python 3.11? contributing.md
explicitly mentions Python 3.6 and Python 3.9 in conjunction with tox
, which I haven't been using so far, but I could set that up and test it later today or tomorrow. RSVP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great.
Yeah, I guess the tox
stuff is potentially out of date now. I haven't tried those steps https://github.com/plotly/plotly.py/blob/master/contributing.md#running-tests-with-tox but I'll try with a few different Python versions.
contributing.md
Outdated
conda activate plotly-dev | ||
``` | ||
|
||
Please note that our dependencies require Python 3.11 as of May 2024. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should still work with Python3.8 - 3.10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing with Python 3.8-3.10 now…
Results on MacOS Sonoma 14.4.1 - I will update my PR tomorrow to (a) pin the pytest version and (b) modify
|
PR updated: @LiamConnors can you please take a look at |
CHANGELOG.md
Outdated
## [5.23.0] - TBD | ||
|
||
### Updated | ||
- Specify Python version 8-11 for development virtual environments and pin `pytest` at version 8.1.1 to match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Specify Python version 8-11 for development virtual environments and pin `pytest` at version 8.1.1 to match. | |
- Specify Python version 3.8-3.11 for development virtual environments and pin `pytest` at version 8.1.1 to match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
- `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 "<frozen importlib._bootstrap>", 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`
@LiamConnors pushed a fix for the CHANGELOG (sorry about |
conda create -n plotly-dev python
currently gives Python 3.12.3.pytest -v packages/python/plotly/plotly/tests/
then fails withModuleNotFoundError: No module named 'imp'
.pip install imp
fails: theimp
module was deprecated in Python 3.11 and has been removed in Python 3.12.contributing.md
to specifyconda create -n plotly-dev python=3.11
pytest
failsFile "<frozen importlib._bootstrap>", line 1072, in _find_spec
AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec'
pytest==3.5.1
inpackages/python/plotly/optional-requirements.txt
pytest==8.1.1
andpytest
runsstatsmodels
not installed, etc.)pytest
also solves the problem with theimp
module not being available in Python 3.12.Code PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
closes #4591