Skip to content

Commit

Permalink
Bump numpy requirement to 1.24, matching Mantid (#309)
Browse files Browse the repository at this point in the history
* Bump numpy requirement to 1.24, matching Mantid

While transitioning to Numpy 2.0 it is helpful to reduce the range of
versions being used and tested. As we are changing other requirements
in this release, it is a good time to bump Numpy.

Here we also update the build/release workflow to add Python 3.12 and
build with Numpy 2.0; these builds _should_ also work with all the
supported numpy 1.x.

* Bump threadpoolctl requirement to 3.0

"Min requirements" tests were throwing up some warnings suggesting that the openblas API wasn't being accessed succesfully. This seems to be resolved in version 3 and there are no knock-on effects to other dependencies.
  • Loading branch information
ajjackson committed Jul 24, 2024
1 parent 833d7a2 commit 8c87ed6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build_upload_pypi_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-13, ubuntu-latest]
python-version: ['3.10', '3.11']
os: [windows-latest, macos-13, macos-latest, ubuntu-latest]
python-version: ['3.10', '3.11', '3.12']
include:
- os: windows-latest
wheelname: win
- os: macos-13
wheelname: macos
wheelname: macos-intel
- os: macos-latest
wheelname: macos-arm
- os: ubuntu-latest
wheelname: manylinux
# Build wheels against the lowest compatible Numpy version
- python-version: '3.10'
manylinux-version-tag: cp310
numpy-version: 1.21.3
- python-version: '3.11'
manylinux-version-tag: cp311
numpy-version: 1.23.2
- python-version: '3.11'
manylinux-version-tag: cp311
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -50,7 +51,7 @@ jobs:
if: matrix.os != 'ubuntu-latest'
shell: bash -l {0}
env:
NUMPY_VERSION: ${{ matrix.numpy-version }}
NUMPY_VERSION: 2.0
run: |
# Build against lowest required Numpy version
python -m pip install numpy==${NUMPY_VERSION}
Expand All @@ -61,7 +62,7 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.manylinux-version-tag}}-manylinux*
CIBW_BEFORE_BUILD: python -mpip install numpy==${{ matrix.numpy-version }}
CIBW_BEFORE_BUILD: python -mpip install numpy==2.0
CIBW_ARCHS: x86_64
with:
output-dir: wheelhouse
Expand Down
12 changes: 7 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@

- Python 3.12 is supported

- Python 3.10+ requires numpy >= 1.21.3

- importlib_resources backport is no longer required

- Some other dependency requirements have been increased because
older versions are difficult to test against Python 3.10:
- Some other dependency requirements have been increased in order
to simplify maintenance and testing:

- Minimum version of numpy increased from 1.19.3 to 1.24.0

- Minimum version of matplotlib increased from 3.2 to 3.8

- Minimum version of Pint increased from 0.19 to 0.22

- Minimum version of PyYAML increased from 3.13 to 6.0

- Minimum version of h5py increaased form 2.10 to 3.6
- Minimum version of h5py increaased from 2.10 to 3.6

- Minimum version of threadpoolctl increased from 1.0 to 3.0.

- Big fixes

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ def run_setup():
include_package_data=True,
install_requires=[
'packaging',
'scipy>=1.10', # requires numpy >= 1.19.5; py3.10 requires 1.21.3
'numpy>=1.24.0',
'scipy>=1.10',
'seekpath>=1.1.0',
'spglib>=1.9.4',
'pint>=0.22',
'threadpoolctl>=1.0.0'
'threadpoolctl>=3.0.0'
],
extras_require={
'matplotlib': ['matplotlib>=3.8.0'],
Expand Down
4 changes: 2 additions & 2 deletions tests_and_analysis/minimum_euphonic_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
numpy==1.21.3
numpy==1.24.0
scipy==1.10.0
spglib==1.9.4.2
seekpath==1.1.0
pint==0.22
matplotlib==3.8
h5py==3.6
PyYAML==6.0
threadpoolctl==1.0.0
threadpoolctl==3.0.0
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ install_command =
platform =
linux: linux
deps =
numpy==1.21.3
numpy==1.24.0
{[testenv:py310]deps}
commands_pre =
python -m pip install --force-reinstall \
-r{toxinidir}/tests_and_analysis/minimum_euphonic_requirements.txt
Expand Down

0 comments on commit 8c87ed6

Please sign in to comment.