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 versions below 3.11 #54

Closed
surajpaib opened this issue Mar 10, 2024 · 3 comments
Closed

Support Python versions below 3.11 #54

surajpaib opened this issue Mar 10, 2024 · 3 comments

Comments

@surajpaib
Copy link

It would be useful to support highly used Python versions so that the end-user does not need to create a separate environment to try out MIRP.

PyPI stats indicate that most packages are downloaded for 3.8/3.9/3.10: https://pypistats.org/packages/__all__
However, 3.8 goes EOL very soon, but 3.9 and 3.10 have quite some time before EOL (1.5yrs and 2.5yrs) https://devguide.python.org/versions/

@alexzwanenburg
Copy link
Member

Thanks for suggestion. The supported Python versions are currently constrained by functionality in the typing library. Notably, MIRP makes use of the following, newer features:

  • Self type introduced with PEP 673 in 3.11.
  • Short union types introduced with PEP 604 in 3.10.
  • Type hinting generics introduced with PEP 585 in 3.9.

The use of Self could be made backward compatible by (conditionally) importing Self from typing_extensions.

After some searching, I don't think there is a suitable way to make PEP 604 and 585 backward compatible with older Python versions. from __future__ import annotations (PEP 563 introduced in 3.7) does not seem to work, according to this thread, and using it may cause issues in upcoming Python versions, see PEP 649.

Realistically -- that is without forgoing typing entirely -- MIRP can be updated to support Python version 3.10 as the earliest version.

@alexzwanenburg
Copy link
Member

For reference, also see Scientific Python SPEC 0, which recommends time-based policies for dropping support for dependencies. In case of python versions, their recommendation is 3 years. This recommendation provides for deprecating support for 3.10 late 2024, with earlier versions already having been deprecated.

@alexzwanenburg
Copy link
Member

Added support for Python 3.10 in version 2.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants