You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is to plan and keep track on the effort to add support for CPython 3.13 .
See PEP 719 for the release schedule.
At the time of opening, version 3.13.0b2 is available, and NumPy is already publishing nightly wheels for it.
Here's the chronological task list to complete before we can declare support for it.
I'll also list which of our core dependencies already have compatible and stable wheels on PyPI, but note that it isn't a necessary condition to make our own.
Supporting the experimental free-threading (a.k.a "nogil") build is a non-goal for this issue (although I note that it's currently blocked by liberfa/pyerfa#152)
Relevant PRs are to be linked in this message.
#16596 currently fixes all first 3 points. The last one needs to wait until 2024-07-30 (about a month from now) when 3.13.0rc1 is (hopefully) available.
It is definitely earlier than previous years (because numpy is getting better at catching up with Python's development), but my reasoning is that, as always, the cost of fixing problems increases with time; if we wait for rc1 then we renounce reporting a whole category of avoidable bugs to CPython folks (i.e. bugs that aren't fixable without breaking ABI). The chance that we encounter such bugs is admittedly very small, but I still think it's worth testing now, especially considering how simple the patch currently needs to be.
In other words, my opinion is that we should start testing as soon as our dependencies allow us to.
Another thing to keep in mind is that Python 3.13 will be the first version to come in two flavors: GIL edition and free-threading edition. The latter is an entirely new kind of beast in the Python world and I have no idea how long it'll take for us to build compatibility for it, so the sooner we can establish we're at least compatible with the GIL build, the better.
Also, anecdotally, last year we found a serious memory leak while testing yt on Python 3.12 betas, which turned out to be a bug in Cython, but we only found out like 2 weeks before 3.12.0 final was scheduled. It was much more stressful because of how short a window we had to even look for it, so I don't look forward to getting this kind of late surprises this year.
Not necessarily. The first release candidate is sufficient because it's guaranteed to be ABI stable. We should be able to provide cp313 wheels whenever our next release is.
Thanks @manodeep ! Though as I wrote in the OP, freethreading is out of scope for this issue. I mean to open a separate tracker issue for it soon, but it's a pretty wide topic and we could probably get a couple easy wins now.
Was it the initial motivation for your work on WCS' thread safety ?
Yeah taking advantage of free-threading while not introducing data races will probably be tricky. Definitely needs a wider discussion (or waiting for a bit).
No the motivation for WCS' thread-safety came from the reproject memory race error (that turned out to be wcs thread-race error). (Which reminds me - I need to review Mark's latest patch for the thread-safe wcs code)
Activity
neutrinoceros commentedon Jun 21, 2024
#16596 currently fixes all first 3 points. The last one needs to wait until 2024-07-30 (about a month from now) when 3.13.0rc1 is (hopefully) available.
pllim commentedon Jun 21, 2024
Maybe a little too early for a PR? According to https://peps.python.org/pep-0719/#schedule , stable release not till Oct 2024. I think we can wait for RC.
neutrinoceros commentedon Jun 22, 2024
It is definitely earlier than previous years (because numpy is getting better at catching up with Python's development), but my reasoning is that, as always, the cost of fixing problems increases with time; if we wait for rc1 then we renounce reporting a whole category of avoidable bugs to CPython folks (i.e. bugs that aren't fixable without breaking ABI). The chance that we encounter such bugs is admittedly very small, but I still think it's worth testing now, especially considering how simple the patch currently needs to be.
In other words, my opinion is that we should start testing as soon as our dependencies allow us to.
neutrinoceros commentedon Jun 22, 2024
Another thing to keep in mind is that Python 3.13 will be the first version to come in two flavors: GIL edition and free-threading edition. The latter is an entirely new kind of beast in the Python world and I have no idea how long it'll take for us to build compatibility for it, so the sooner we can establish we're at least compatible with the GIL build, the better.
neutrinoceros commentedon Jun 22, 2024
Also, anecdotally, last year we found a serious memory leak while testing yt on Python 3.12 betas, which turned out to be a bug in Cython, but we only found out like 2 weeks before 3.12.0 final was scheduled. It was much more stressful because of how short a window we had to even look for it, so I don't look forward to getting this kind of late surprises this year.
astrofrog commentedon Jun 22, 2024
I think testing as soon as our required dependencies support a prerelease seems reasonable.
pllim commentedon Jun 24, 2024
Strictly speaking, that is only numpy and pyerfa. So you might not want to use all the
devdeps?neutrinoceros commentedon Jun 25, 2024
wait I think
devdepsis indeed restricted topyerfa,numpyandscipy(which is now also making cp313 wheels btw) ?neutrinoceros commentedon Jun 25, 2024
Oh I get it.
devdepsindeed includes matplotlib (not ready) by default but it's really controlled by thenoscipyfactor 🙃pllim commentedon Jun 25, 2024
Yes, welcome to Dependency Hell™️ !
pllim commentedon Jul 16, 2024
FWIW https://labs.quansight.org/blog/free-threaded-python-rollout
neutrinoceros commentedon Jul 16, 2024
Also FYI; I just opened liberfa/pyerfa#154, which will be needed if we plan to experiment/test against free-threaded Python sometimes this year.
pllim commentedon Aug 20, 2024
For the item "publish cp313 wheels to PyPI" -- Is that for after Python 3.13 stable is out?
neutrinoceros commentedon Aug 20, 2024
Not necessarily. The first release candidate is sufficient because it's guaranteed to be ABI stable. We should be able to provide cp313 wheels whenever our next release is.
manodeep commentedon Aug 21, 2024
Y'all probably know about this but here is a bit of useful info on how to adapt + compile the CPython extensions for the free-threaded python - https://py-free-threading.github.io/porting/#__tabbed_1_1
Effectively add the function
PyUnstable_Module_SetGIL()to enable GIL on free-threaded python (though GIL enabled seems to be set as the default)neutrinoceros commentedon Aug 21, 2024
Thanks @manodeep ! Though as I wrote in the OP, freethreading is out of scope for this issue. I mean to open a separate tracker issue for it soon, but it's a pretty wide topic and we could probably get a couple easy wins now.
Was it the initial motivation for your work on WCS' thread safety ?
manodeep commentedon Aug 21, 2024
Yeah taking advantage of free-threading while not introducing data races will probably be tricky. Definitely needs a wider discussion (or waiting for a bit).
No the motivation for WCS' thread-safety came from the reproject memory race error (that turned out to be wcs thread-race error). (Which reminds me - I need to review Mark's latest patch for the thread-safe wcs code)
neutrinoceros commentedon Sep 2, 2024
Re:free-threading: the dedicated issue is #16916