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

Switch to use oldest_supported_numpy for build-time requirements #1993

Merged
merged 6 commits into from
Nov 10, 2021

Conversation

TylerADavis
Copy link
Contributor

@TylerADavis TylerADavis commented Nov 3, 2021

This should fix #1934 . pip install h5py is currently broken on arm64 Macs because h5py requests to build with an old version of NumPy that can't compile from source on arm64 Macs. While this has been fixed in NumPy 1.21 and 1.20, the devs say they will not be making another release of NumPy 1.19.

The NumPy devs I spoke with recommended oldest_supported_numpy, which lets us easily specify build-time requirements that are aware of platform specific requirements. I have tested this on my own arm64 Mac, and I can now build locally.

This PR moves the build time NumPy requirements out of SETUP_REQUIRES in setup.py and into the build-system requires in pyproject.toml. Based on the oldest_supported_numpy documentation, I believe this shouldn't cause issues even if h5py requests a newer version at runtime.

tox -e pre-commit and tox -e py39-test-deps both pass.

Closes #1836

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #1993 (f09cabe) into master (dfb29a0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1993   +/-   ##
=======================================
  Coverage   89.91%   89.91%           
=======================================
  Files          17       17           
  Lines        2311     2311           
=======================================
  Hits         2078     2078           
  Misses        233      233           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfb29a0...f09cabe. Read the comment docs.

@NAThompson
Copy link

@TylerADavis : Could you also test this MR against python3.10?

@TylerADavis
Copy link
Contributor Author

Sure, I just made a new Python 3.10 virtual environment, installed pkgconfig, and built h5py without issue.

tox -e py310-test-deps works as well

@aragilar
Copy link
Member

aragilar commented Nov 4, 2021

I think sticking oldest-supported-numpy in SETUP_REQUIRES would allow H5PY_SETUP_REQUIRES to keep working for numpy.

@TylerADavis
Copy link
Contributor Author

@aragilar You're saying to put oldest-supported-numpy into SETUP_REQUIRES, and then it'll get pulled into pyproject.toml anyways thanks to PEP 517?

@aragilar
Copy link
Member

aragilar commented Nov 4, 2021

It won't get put into the contents of the file, but the idea would be it would be used for get_requires_for_build_wheel (we don't need the get_requires_for_build_sdist hook). I've filed an issue with setuptools to be able to set it at pypa/setuptools#2854 FYI.

@takluyver
Copy link
Member

If we're going to use oldest-supported-numpy, I'm happy with just putting it in pyproject.toml as a static build dependency. If we do that, then we should have a single numpy >=1.14.5 in install_requires, so we don't have to duplicate the information from oldest-supported-numpy for runtime requirements.

@takluyver
Copy link
Member

I've moved everything except mpi4py from setup_requires to the static list in pyproject.toml.

@takluyver takluyver added this to the 3.6 milestone Nov 10, 2021
@takluyver takluyver merged commit b6e3047 into h5py:master Nov 10, 2021
@takluyver
Copy link
Member

Thanks @TylerADavis !

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.

h5py install fails on M1 Use oldest-supported-numpy as build dependency?
4 participants