Repository navigation
python: mypy version bump - #56274
Conversation
|
Failure: Looks unrelated to my changes. Mypy was ok. Will rerun make check later to see if the failure was transient. |
|
jenkins test make check |
Tests that touch this enum fail for me locally but pass in the CI. This seems to be due to new enum related behavior in Python 3.11. See: https://blog.pecar.me/python-enum Instead of fixing it as suggested in the above blog, adding a __str__ method works on all python versions I care to know about. Signed-off-by: John Mulligan <[email protected]>
In PR ceph#55255 I updated various files to be valid on newer versions of mypy. Update the constrains file to specify mypy 1.1.1. This certainly is not the newest version of mypy, but because ceph uses various older versions of python I am being cautious and trying to only incrementally update the mypy version. This version fixed an issue or two I hit while working on a prototype manager module compared to the previous version in the mypy-constrains.txt file. Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
tox supports automatically running tools with different python versions if you name your envs properly. Continue to permit the use of `mypy` as an env (as the default) but also allow a selection of python versions like `py38-mypy`. Signed-off-by: John Mulligan <[email protected]>
In the tox.ini file the modules validated by mypy are explicitly listed. Fix one item which was indented differently than the others. Sort the list. Signed-off-by: John Mulligan <[email protected]>
f60f39a to
40906dd
Compare
|
jenkins test api |
|
|
||
|
|
||
| [testenv:mypy] | ||
| [testenv:{,py37-,py38-,py39-,py310-}mypy] |
There was a problem hiding this comment.
to be clear, this gives us the ability to run something like tox -e py37-mypy, but by default we'll still just run mypy?
There was a problem hiding this comment.
Yep. tox supports expansions like those of bash. So {,py37-,py38-,py39-,py310-}mypy expands to mypy, py37-mypy, py38-mypy, py39-mypy, py310-mypy. I got lazy and didn't figure we'd need anything newer than 3.10 for now.
|
Other than the Nothing to block merging the PRs in the run |
|
jenkins test api |
1 similar comment
|
jenkins test api |
NOTE: This is a draft initially because, despited being "done", I only have tried it locally. I know the ci env is quite different from mine. Once I'm certain this doesn't interfere with normal make check (and other) jobs in the CI I'll move it out of draft.In PR #55255 I updated various files to be valid on newer versions of
mypy. Update the constrains file to specify mypy 1.1.1. This certainly
is not the newest version of mypy, but because ceph uses various older
versions of python I am being cautious and trying to only incrementally
update the mypy version. This version fixed an issue or two I hit while
working on a prototype manager module compared to the previous version
in the mypy-constrains.txt file.
In addition, I am cleaning some small mypy and related annoyances I bumped into while working on a new mgr module in the src/pybind/mgr tox.ini file.
Lastly, there's a commit in here that's a duplicate of one in #55068 . I did this because the python versions on my local machine default to versions that fail without the change. Depending on which PR is merged first I will end up dropping it from the other.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e