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

bump up numpy min version to 1.20 #3737

Merged
merged 5 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
full-deps: false
install_hole: false
codecov: false
numpy: numpy=1.19.0
numpy: numpy=1.20.0
- name: asv_check
os: ubuntu-latest
python-version: 3.8
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ matrix:
group: edge
if: type = cron
before_install:
- python -m pip install cython "numpy>=1.19.2" scipy
- python -m pip install cython "numpy>=1.20.0" scipy
- python -m pip install --no-build-isolation hypothesis matplotlib packaging pytest pytest-cov pytest-xdist tqdm threadpoolctl fasteners
install:
- cd package
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ jobs:
PYTHON_VERSION: '3.9'
PYTHON_ARCH: 'x64'
BUILD_TYPE: 'wheel'
NUMPY_MIN: '1.19.3'
NUMPY_MIN: '1.20.0'
imageName: 'windows-2019'
Win-Python38-64bit-full-wheel:
PYTHON_VERSION: '3.8'
PYTHON_ARCH: 'x64'
BUILD_TYPE: 'wheel'
NUMPY_MIN: '1.19.0'
NUMPY_MIN: '1.20.0'
imageName: 'windows-2019'
Linux-Python39-64bit-full-wheel:
PYTHON_VERSION: '3.9'
PYTHON_ARCH: 'x64'
BUILD_TYPE: 'wheel'
NUMPY_MIN: '1.19.3'
NUMPY_MIN: '1.20.0'
imageName: 'ubuntu-latest'
Linux-Python38-64bit-full-wheel:
PYTHON_VERSION: '3.8'
PYTHON_ARCH: 'x64'
BUILD_TYPE: 'wheel'
NUMPY_MIN: '1.19.3'
NUMPY_MIN: '1.20.0'
imageName: 'ubuntu-latest'
pool:
vmImage: $(imageName)
Expand Down
2 changes: 1 addition & 1 deletion maintainer/conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- mmtf-python
- mock
- networkx
- numpy>=1.19
- numpy>=1.20
- pytest
- python==3.8
- scikit-learn
Expand Down
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Enhancements
(CZI Performance track, PR #3683)

Changes
* Minimum supported NumPy version is now 1.20 as per NEP29 (PR #3737)
IAlibay marked this conversation as resolved.
Show resolved Hide resolved
* Narrowed variable scope to reduce use of OpenMP `private` clause (PR #3706, PR
#3728)

Expand Down
9 changes: 3 additions & 6 deletions package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ requires = [
"Cython>=0.28",
"packaging",
# lowest NumPy we can use for a given Python,
# except for more exotic platforms (linux/Mac ARM flavors)
"numpy==1.19; python_version=='3.8' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerjereddy I wasn't 100% sure of the logic here, we seem to have entries specfic for "not ((arm64 or Darwin) and aarch64)" and "arm64 and Darwin" but nothing for aarch64. Is there a specific reason we were restricting aarch64 to py3.10 only?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Older Python versions should be "ok" with aarch64 I think. This is a good reference as always: https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg#L29

Of course, there's no substitute for actually trying it with pip install .., but my original draft was probably incomplete anyway, especially for the more exotic platforms.

"numpy==1.19.3; python_version=='3.9' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
# arm65 on Darwin supports py3.8 and above and requires numpy>=1.20.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "arm65" a thing? OR should this be "arm64"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo definitely

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# arm65 on Darwin supports py3.8 and above and requires numpy>=1.20.0
# arm64 on Darwin supports py3.8 and above and requires numpy>=1.21.0

and then change below

"numpy==1.20.0; python_version=='3.8'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"numpy==1.20.0; python_version=='3.8'",
"numpy==1.21.0; python_version=='3.8'",

"numpy==1.20.0; python_version=='3.9'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"numpy==1.20.0; python_version=='3.9'",
"numpy==1.21.0; python_version=='3.9'",

"numpy==1.21.4; python_version=='3.10' and platform_python_implementation != 'PyPy'",
"setuptools",
"wheel",
# arm64 on Darwin supports Python 3.8 and above and requires numpy>=1.20.0
"numpy==1.20.0; python_version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'",
"numpy==1.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darwin'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember this tripping up a user on Discord because it forces a from-source build of NumPy on M1 macs--perhaps we should consider doing the same thing as oldest-supported-numpy and just requiring 1.21.0 as described here: https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg#L37 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah reading the comment re: universal2 I'm pretty happy bumping up the darwin + arm64 requirements to 1.21.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds sensible.

And thank you @tylerjereddy for linking to the setup.cfg... might be good to keep the link around somewhere.... maybe a wiki page of tips of the trade for packaging? ;-)

]
2 changes: 1 addition & 1 deletion package/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mmtf-python
msmb_theme==1.2.0
netcdf4
networkx
numpy>=1.19.0
numpy>=1.20.0
packaging
parmed
pytest
Expand Down
6 changes: 3 additions & 3 deletions package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def get_numpy_include():
import numpy as np
except ImportError:
print('*** package "numpy" not found ***')
print('MDAnalysis requires a version of NumPy (>=1.19.0), even for setup.')
print('MDAnalysis requires a version of NumPy (>=1.20.0), even for setup.')
print('Please get it from http://numpy.scipy.org/ or install it through '
'your package manager.')
sys.exit(-1)
Expand Down Expand Up @@ -597,7 +597,7 @@ def long_description(readme):
exts, cythonfiles = extensions(config)

install_requires = [
'numpy>=1.19.0',
'numpy>=1.20.0',
'biopython>=1.71',
'networkx>=2.0',
'GridDataFormats>=0.4.0',
Expand Down Expand Up @@ -646,7 +646,7 @@ def long_description(readme):
# all standard requirements are available through PyPi and
# typically can be installed without difficulties through setuptools
setup_requires=[
'numpy>=1.19.0',
'numpy>=1.20.0',
'packaging',
],
install_requires=install_requires,
Expand Down