Repository navigation
Build: Replace oldest-supported-numpy - #14949
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
| "setuptools_scm>=6.2", | ||
| "cython==0.29.34", | ||
| "oldest-supported-numpy", | ||
| "numpy==1.25", |
There was a problem hiding this comment.
I wonder if this should perhaps also include <2 though I haven't had time to check if the backward compatibility is 'forever' or could break in 2.0
There was a problem hiding this comment.
"A major release is highly unusual (NumPy is still at version 1.xx) and if it happens it will likely indicate an ABI break"
I think we should perhaps do >=1.25,<2
There was a problem hiding this comment.
I thought someone once said that we should always do == pins on the build requirements? Isn't that why we do == for cython? Then why cython but not numpy?
There was a problem hiding this comment.
Agreed about the >=1.25,<2.0 pin for Numpy,
For Cython, Numpy uses Cython>=0.29.34,<3.0 which seems better to me than pinning a specific version.
There was a problem hiding this comment.
Hmmmpf, I guess you will have to compile it against our dev wheel, you don't even have to pass tests on it to do that.
The problem is, only if you use the 2.x wheel, can I provide updated headers to ensure compatibility (and force you to remove API that is I want to stop dragging around).
There was a problem hiding this comment.
Sorry, somehow slipped me: Right now, NumPy doesn't actually enforce this! For precisely that reason. As long as we just remove things for the most part, I am happy to gamble that the wheels are effectively ABI compatible (even if that is a lie).
There might come a day where we want to do something that makes this impossible, but I am not sure that will come...
As soon as there is an actual NumPy rc1, that would be enforced though.
There was a problem hiding this comment.
you will have to compile it against our dev wheel
I guess it is theoretically possible for our unreleased 6.0.dev. But we cannot do that for release branches; so does this mean we have to pin numpy maxversion for v5.3.x ? Though I also have no seen any failures related to this in our CI set up. My head hurts. 😆
There was a problem hiding this comment.
Thanks for the info, @seberg ! I'll see what @astropy/astropy-project-release-team has to say since they are the ones doing releases. 🤞
There was a problem hiding this comment.
Sorry, yes, just repeating in case it got lost: The NumPy dev wheels do not actually enforce this, they just pretend they are still 1.x ABI (it's a lie, but who cares). Maybe that will just stay that way, maybe I will find a big enough reason to break that "promise".
4a0d0af to
c7e3bf8
Compare
|
Ideally we should also use but I don't think we have an easy way to do that right now with extension-helpers ... |
|
Actually might be easy to do by looping on the result of |
|
@saimn , do you want to take over? You probably knows exactly what to do in the loop and stuff. Thanks! |
This is nasty 😆 Extension helpers has the ability to drop the setup.py file completely now, so relying on logic in there is a bad idea. I don't have an alternative for you though so 🤷 |
0cd824f to
6fd7ebd
Compare
|
Well there are various things for which a |
|
Can't we just add an option in extension helpers to do this automatically for all extensions if it's going to be something common? |
|
@astrofrog - Yes, I guess this could be done. |
| # Specify the minimum version for the Numpy C-API | ||
| for ext in ext_modules: | ||
| if ext.include_dirs and "numpy" in ext.include_dirs[0]: | ||
| ext.define_macros.append(("NPY_TARGET_VERSION", "NPY_1_21_API_VERSION")) |
There was a problem hiding this comment.
Does it crash if the extension code already has its own NPY_TARGET_VERSION somehow?
There was a problem hiding this comment.
Also... so much for getting rid of setup.py lol
|
So... Are we keeping the stuff in |
|
I am revisiting Python 3.12 related stuff. I realized that some upstream stuff with oldest-supported-numpy is giving us troubles if we have to build them from source. So this means we're affecting our downstream the same way if for whatever reason they cannot use our dev wheels (we don't have py312 wheels yet but I want to make it happen). tl;dr -- Can I merge this??? |
astrofrog
left a comment
There was a problem hiding this comment.
Go forth and merge! I will think about how to avoid the setup.py code here, I think we can do it via extension-helpers. But this is fine for now.
c5e6804 to
a208132
Compare
This comment was marked as resolved.
This comment was marked as resolved.
with numpy 1.25 that guarantee backward compatible C-API. But we do not want exact pin. Specify the minimum version for the Numpy C-API Co-authored-by: Simon Conseil <[email protected]>
a208132 to
6aba670
Compare
|
Let's run all the exotic stuff too, just in case. |
| "setuptools_scm>=6.2", | ||
| "cython==0.29.34", | ||
| "oldest-supported-numpy", | ||
| "numpy>=1.25,<2", |
There was a problem hiding this comment.
I would recommend adding a temporary version cap on the runtime dependency as well, see scipy/oldest-supported-numpy#76 (comment)
There was a problem hiding this comment.
You mean install_requires? But then we won't be able to test against numpy dev in CI, no?
There was a problem hiding this comment.
Yes I mean install_requires, and it won't be blocking for future-compatibility tests because 2.0.0dev0 compares as < 2.0 :)
There was a problem hiding this comment.
So you are guarding against... numpy 3.0?
There was a problem hiding this comment.
I guess I do not understand the logic of allowing 2.0.dev but preventing users from using the actual 2.0 later.
There was a problem hiding this comment.
Thanks for your concern, which is valid. But I would like to discuss it separate from this one. Can you please propose a PR at your convenience?
I don't mind max pinning numpy in release branches, but I would rather not do it in the main branch. I think scipy only pin maxversion when they branch for release (at least the last I look and I don't look very often).
Description
This pull request is to replace oldest-supported-numpy with numpy 1.25 that guarantee backward compatible C-API.
Fixes #14915