oncoray/mirp

Support Python versions below 3.11

Closed this issue · 3 comments

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/

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.

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.

Added support for Python 3.10 in version 2.1.2.