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

Use oldest-supported-numpy as build dependency? #1836

Closed
takluyver opened this issue Mar 2, 2021 · 2 comments · Fixed by #1993
Closed

Use oldest-supported-numpy as build dependency? #1836

takluyver opened this issue Mar 2, 2021 · 2 comments · Fixed by #1993

Comments

@takluyver
Copy link
Member

I just discovered the oldest-supported-numpy metapackage, meant for use as a build dependency, to build packages against the... oldest supported version of NumPy on any platform & Python version. It tracks the versions we already use pretty closely (except we have NumPy 1.17.5 for Python 3.8, whereas it has 1.17.3). Should we use this?

Advantages:

  • Less to update on a new Python version (assuming someone continues to maintain the metapackage)
  • More specific rules for which NumPy version to use on e.g. aarch64 or PyPy (see the list here)

Drawbacks:

  • No easy way (that I can see) to make the oldest supported numpy the minimum runtime requirement, as we currently do in setup.py. This tells packaging tools not to install h5py with NumPy older than the version it was built with. I don't know how often that would otherwise arise, but it probably avoids at least the occasional bug report.
  • Harder to change if we need to specify a different version, e.g. if h5py really needs NumPy 1.17.5 instead of 1.17.3 on Python 3.8. Scipy copies the rules from oldest-supported-numpy instead of using it, probably so that it can set different minimum versions.
@aragilar
Copy link
Member

aragilar commented Mar 8, 2021

I'm slightly wary of depending on oldest-supported-numpy, mainly because it has come out of the astropy ecosystem, which hasn't always been ideal in terms of the packaging/tooling system they have developed (I would note that I'm biased here: most of my interactions with the astropy ecosystem packaging/tooling have been fixing collogues' systems where they've tried installing something and it has really messed things up...). On the other hand, I think oldest-supported-numpy has been part of their move to a more standard packaging/tooling setup, so maybe it's fine.

@takluyver
Copy link
Member Author

I think it's conceptually the same as what we're doing with build dependencies already. My main hesitation is that I think it's useful to say "build with numpy ==x, install with numpy >=x", and I don't see how you do that without duplicating all of the rules from o-s-n.

I wondered about loading numpy in the setup.py and making a requirement on f"numpy >={np.__version__}". But that's wrong for sdists, so then you have to set up dependencies differently based on whether you're making a wheel or not, which gets messy.

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 a pull request may close this issue.

2 participants