Skip to content
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

Support python 3.11 #2107

Merged
merged 4 commits into from
May 11, 2023
Merged

Support python 3.11 #2107

merged 4 commits into from
May 11, 2023

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented Oct 26, 2022

Python 3.11 changed the behavior of the format string for a class Foo(str, Enum) but also introduced a new class StrEnum that keeps the old behavior.

I added a ctapipe.compat module that encapsulates the version dependent behavior needed for ctapipe and added the previous implementation for StrEnum there.

Numba also needs to be at least 0.57 for python 3.11.

@maxnoe
Copy link
Member Author

maxnoe commented Oct 26, 2022

Seems we have to wait for a numba release adding python 3.11 support

@kosack
Copy link
Contributor

kosack commented Jan 24, 2023

just rebased this on master - let's see if there are still issues

@maxnoe
Copy link
Member Author

maxnoe commented Jan 24, 2023

Yes, still no numba for 3.11

@maxnoe maxnoe changed the title Add pip-based 3.11 ci workflow Support python 3.11 Apr 21, 2023
@maxnoe maxnoe marked this pull request as ready for review April 21, 2023 15:28
@maxnoe
Copy link
Member Author

maxnoe commented Apr 21, 2023

Tests are now passing using the 0.57rc1 numba pre release

.github/workflows/ci.yml Outdated Show resolved Hide resolved
ctapipe/tools/apply_models.py Outdated Show resolved Hide resolved
Tobychev
Tobychev previously approved these changes May 2, 2023
@maxnoe
Copy link
Member Author

maxnoe commented May 8, 2023

I am not sure if the CI system allows for such conclusions, but: the python 3.11 test suite ran 1.5 minute faster than the python 3.10 tests (11:37 min vs. 10:03 min).

If this is real and not just different workloads / hardware / vms in the CI system, it would be a really nice improvement for just updating to a new python minor version release (ca. 14 %, which is in line with what is promised in the release notes)!

@maxnoe maxnoe requested a review from LukasNickel May 11, 2023 08:02
@@ -33,7 +33,7 @@ install_requires=
importlib_metadata ; python_version < "3.10"
joblib
matplotlib ~=3.0
numba ~=0.56.0
numba >=0.56
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wrote that we need at least numba 0.57, is that not correct anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 3.11, 3.10 and below is fine with 0.56

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And since versions 0.56 correctly specifies that it is not compatible with 3.11, there is no issue.

The conda-forge package for 0.57 is not yet out, so prescribing 0.57 is not a good idea.

@kosack kosack merged commit da82fa3 into main May 11, 2023
@maxnoe maxnoe deleted the py311 branch May 11, 2023 08:21
@maxnoe maxnoe mentioned this pull request Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants