Skip to content

Commit

Permalink
Bump numpy requirement to 1.24, matching Mantid
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ajjackson committed Jul 19, 2024
1 parent 833d7a2 commit 5652cd2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 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
8 changes: 4 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

- 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

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ 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',
Expand Down
2 changes: 1 addition & 1 deletion tests_and_analysis/minimum_euphonic_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy==1.21.3
numpy==1.24.0
scipy==1.10.0
spglib==1.9.4.2
seekpath==1.1.0
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ install_command =
{opts} \
{packages}
deps =
numpy
-r{toxinidir}/tests_and_analysis/tox_requirements.txt
commands_pre =
python -m pip install \
Expand Down Expand Up @@ -90,8 +89,7 @@ install_command =
python -m pip install --force-reinstall {opts} {packages}
platform =
linux: linux
deps =
numpy==1.21.3
deps = {[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 5652cd2

Please sign in to comment.