CLIMADA-project / climada_python

Python (3.8+) version of CLIMADA
GNU General Public License v3.0
291 stars 115 forks source link

Drop support of Python 3.9 and adopt 3.12 instead #868

Open peanutfun opened 2 months ago

peanutfun commented 2 months ago

Python 3.9 reaches its "end of life" in October 2025. However, the "Scientific Python" community promotes a more eager support cycle. As of 5 April 2024, packages are recommended to drop Python 3.9 support. The latest release of numpy also supports Python 3.12, but we currently run no tests against this version of Python.

Does somebody have particular opinions on whether we should switch Python versions rather quickly or rather slowly?

peanutfun commented 2 months ago

Side note: On Euler, we are working with Python 3.10 already

chahank commented 2 months ago

Opinion: I would rather update quickly if it is possible, but probably not to the latest version always as other packages need to catch-up.

spjuhel commented 2 months ago

but probably not to the latest version always as other packages need to catch-up.

Completely agree!

peanutfun commented 2 months ago

Python 3.12 was released on 02 Oct 2023, so you can't really say we would be early adopters 😅

I'll give it a try in a new PR and see what the checks tell.

peanutfun commented 2 months ago

Python 3.12 requires upgrading either cfgrib or eccodes:

├─ cfgrib >=0.9.9,<0.9.10  is installable with the potential options
│  ├─ cfgrib 0.9.9.0 would require
│  │  └─ python-eccodes with the potential options
...
│  │     ├─ python-eccodes [1.6.1|1.7.0] would require
│  │     │  └─ eccodes >=2.31.0 , which can be installed;
...
│  └─ cfgrib 0.9.9.1 would require
│     └─ python-eccodes >=0.9.8 , which can be installed (as previously explained);
├─ eccodes >=2.27,<2.28  is not installable because it conflicts with any installable versions previously reported;

We would either need to lift the restriction on cfgrib or allow eccodes >=2.31. Both package restrictions are related to StormEurope, see #811

See https://github.com/CLIMADA-project/climada_python/actions/runs/8632858011/job/23664532641?pr=870

emanuel-schmid commented 2 months ago

Actually it was even already decided at the last "climada days" to make the standard python version 3.10 . So no objections to drop python 3.9.

peanutfun commented 2 months ago

The dependency restrictions currently do not permit us to adopt Python 3.12. On the other hand, I see no point in dropping Python 3.9 support only for the sake of it. I suggest to keep things as they are for now and see if we progress with StormEurope within the next couple of weeks.

@ThomasRoosli, could you give us a time frame regarding any updates to the StormEurope module and especially its dependencies?

peanutfun commented 1 week ago

From #899: Maybe switch to Python 3.11 as recommended version right away? We are and will be using 3.11 on Euler, even after the Ubuntu transition