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

Add Python 3.12 #12361

Merged
merged 11 commits into from
Jan 17, 2024
Merged

Add Python 3.12 #12361

merged 11 commits into from
Jan 17, 2024

Conversation

cbrnr
Copy link
Contributor

@cbrnr cbrnr commented Jan 15, 2024

I've replaced Python 3.11 with Python 3.12 in our pip-pre test on ubuntu-latest.

Which versions do we want to test explicitly? Currently (with this change), we're testing 3.9 (ubuntu-latest/minimal, macos-latest/mamba, ubuntu-20.04/old), 3.10 (ubuntu-latest/conda, windows-latest/mamba), and 3.12.

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 16, 2024

Package dependency hell:

The user requested numpy>=2.0.0.dev0
scikit-learn 1.4.dev0 depends on numpy>=1.19.5
scipy 1.12.0rc1 depends on numpy<1.29.0 and >=1.22.4

@larsoner
Copy link
Member

I wouldn't do it on the pip-pre job but instead bump a different job. One of the conda ones might actually be easiest

Which versions do we want to test explicitly? Currently (with this change), we're testing 3.9 (ubuntu-latest/minimal, macos-latest/mamba, ubuntu-20.04/old), 3.10 (ubuntu-latest/conda, windows-latest/mamba), and 3.12.

That sounds reasonable. We want to test oldest and newest at a minimum. Beyond that having some coverage is desirable but I don't think full Python version coverage is required.

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 16, 2024

I wouldn't do it on the pip-pre job but instead bump a different job. One of the conda ones might actually be easiest

OK, I bumped the three conda-based jobs. However, conceptually it would make a lot of sense to also use the latest Python for pip-pre IMO.

@larsoner
Copy link
Member

However, conceptually it would make a lot of sense to also use the latest Python for pip-pre IMO.

I agree, ideally we can make that switch soon. But the complications added by NumPy 2.0 make it too difficult, and testing against NumPy 2.0 is important -- it has been a pain, but it has also found all sorts of stuff for us and upstream packages to fix and change over the last 6 months or so.

@larsoner
Copy link
Member

Looks like numba is a problem on those conda runs. Maybe conda isn't the way to go, then. These CI configs can be a pain and require lots of experimentation and adjustment!

@larsoner
Copy link
Member

(Or maybe it's just numba-on-windows-3.12 -- you could try putting that one back to whatever version it was before and see if the Linux and macOS jobs work!)

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 16, 2024

Numba 0.59, which hasn't been released yet, will support Python 3.12 (numba/numba#9246).

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 16, 2024

0.59RC1 is available on PyPI, so maybe use that with pip-pre?

@larsoner
Copy link
Member

One solution would be to change just one job (conda linux?) to use 3.12 and before the setup-miniconda or whatever we use nowadays, modify environment.yml inplace to remove the numba line (only in that job) until a compatible numba is released.

@larsoner
Copy link
Member

0.59RC1 is available on PyPI, so maybe use that with pip-pre?

I thought pip-pre was the job with the incompat due to NumPy 2.0.0.dev0+Py3.12, no? It's unlikely that that RC is NumPy2.0 compatible in any case (and I do think we want to keep testing NumPy 2.0 in the pre job if possible).

Another option since they're already on RC is just to wait a week or two or whatever, then bump a conda job (or a few as done here).

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 16, 2024

Yes, but the incompatibility was because of SciPy. You're probably right that Numba won't support NumPy 2, but who knows, maybe they have already made their code compatible. So it's probably best to wait a couple of days.

@larsoner
Copy link
Member

@cbrnr can I push a commit to try my idea of editing environment.yml? Then when numba lands we can just remove the 4-5 lines in tests.yml that I'd be adding (and would have 3.12 in the meantime)

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 16, 2024

Yes, sure!

@larsoner larsoner enabled auto-merge (squash) January 16, 2024 17:44
@larsoner
Copy link
Member

Okay enabling auto-merge, but will need to manually adjust CI reqs in branch protection rules once it comes back green. I'll try to remember to check back in a bit but if someone sees everything green feel free to ping me

@cbrnr cbrnr requested a review from drammock as a code owner January 16, 2024 18:28
@cbrnr cbrnr requested a review from sappelhoff as a code owner January 16, 2024 19:13
@larsoner larsoner merged commit 52a9059 into mne-tools:main Jan 17, 2024
29 checks passed
@larsoner
Copy link
Member

Thanks @cbrnr !

@cbrnr
Copy link
Contributor Author

cbrnr commented Jan 17, 2024

Thank you @larsoner, you did all the work!

@cbrnr cbrnr deleted the python312 branch January 17, 2024 07:26
snwnde pushed a commit to snwnde/mne-python that referenced this pull request Mar 20, 2024
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.

3 participants