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

RFC: support python 3.12 (but drop 3.8) #82

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

muxator
Copy link

@muxator muxator commented Feb 24, 2024

This is an experiment aimed at supporting python 3.12, which is already at its second point release.

Formally, python 3.8 is still going to be supported for 6 months (https://devguide.python.org/versions). However, some packages have already dropped it.

In particular, there is no scipy version supporting 3.8 and 3.12 at the same time, and this forces us to make a choice.

After bumping scipy to >= 1.11, poetry is able to resolve the dependencies.

At install time there were 2 more problems:

  1. numpy did not install because python 3.12 dropped support for distutils (https://peps.python.org/pep-0632/). There are workarounds for this (https://numpy.org/devdocs/reference/distutils_status_migration.html), but bumping to 1.26 seems to be an official solution
  2. statsmodels 0.13 did not compile under python 3.12, probably because it is compiled with -Werror, and there are some deprecation warnings when compiling its wheel. Bumping to 0.14 solved the issue.

This is just the easiest set of actions for allowing the project to run on python3.12. There might be ways to keep a more relaxed set of dependencies (for example, only install numpy 1.26 under python 3.12) if we want to be more permissive.

Local tests on my Fedora with python 3.12 completed fine. Opening the PR to see what the CI (and the fellow devs) think about it.

muxator added 2 commits February 24, 2024 10:41
….8 due to scipy

As of 2024-02, Python 3.8 is still going to be supproted for 6 months (until
2024-10, see https://devguide.python.org/versions).

At the same time, Python 3.12 was released four months ago, on 2023-10, and will
be supported for five years.

We cannot support both, because scipy 1.10 does not work with python 3.12, and
scipy 1,11 drops python 3.8.

Having to make a choiche, it is probably better to go with the more recent
versions, thus 3.8 has to go down the drain.
Maybe there are wiser ways of only requiring updated packages for python 3.12,
while still allowing older package versions for python <= 3.11, but I was only
looking for the minimum set of working packages.

The issue with numpy is documented here, and officially solved with numpy 1.26:
https://numpy.org/devdocs/reference/distutils_status_migration.html

This commit needs to be reworked, and either squashed in the one updating the
python compatibility, or better moved BEFORE dropping python 3.8 and introducing
3.12.
@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 88.83%. Comparing base (c8b2cc3) to head (554a754).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
- Coverage   89.22%   88.83%   -0.40%     
==========================================
  Files          42       42              
  Lines        1782     1791       +9     
==========================================
+ Hits         1590     1591       +1     
- Misses        192      200       +8     
Files Coverage Δ
black_it/calibrator.py 94.11% <50.00%> (-0.56%) ⬇️
black_it/loss_functions/base.py 97.95% <66.66%> (-2.05%) ⬇️
black_it/plot/plot_results.py 98.00% <50.00%> (-0.99%) ⬇️
black_it/samplers/halton.py 96.25% <50.00%> (-1.22%) ⬇️
black_it/schedulers/base.py 87.87% <50.00%> (-2.75%) ⬇️
black_it/utils/json_pandas_checkpointing.py 93.75% <50.00%> (-1.49%) ⬇️
black_it/utils/sqlite3_checkpointing.py 95.45% <50.00%> (-1.10%) ⬇️
black_it/schedulers/rl/rl_scheduler.py 24.67% <33.33%> (-0.33%) ⬇️

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

Successfully merging this pull request may close these issues.

None yet

2 participants