From 5652cd2058e724fe6d94f2e3b11eb03bd7ef2505 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Fri, 19 Jul 2024 12:34:06 +0100 Subject: [PATCH] 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. --- .github/workflows/build_upload_pypi_wheels.yml | 17 +++++++++-------- CHANGELOG.rst | 8 ++++---- setup.py | 3 ++- .../minimum_euphonic_requirements.txt | 2 +- tox.ini | 4 +--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_upload_pypi_wheels.yml b/.github/workflows/build_upload_pypi_wheels.yml index d7c08a0da..70163c2c4 100644 --- a/.github/workflows/build_upload_pypi_wheels.yml +++ b/.github/workflows/build_upload_pypi_wheels.yml @@ -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: @@ -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} @@ -61,7 +62,7 @@ jobs: uses: pypa/cibuildwheel@v2.12.0 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 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index afbb54649..4852ce70d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/setup.py b/setup.py index 0b2cf2df1..68b06a35c 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/tests_and_analysis/minimum_euphonic_requirements.txt b/tests_and_analysis/minimum_euphonic_requirements.txt index d7ba1efd8..8e4bf9558 100644 --- a/tests_and_analysis/minimum_euphonic_requirements.txt +++ b/tests_and_analysis/minimum_euphonic_requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 4b36e2afc..9e0e2ccc2 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,6 @@ install_command = {opts} \ {packages} deps = - numpy -r{toxinidir}/tests_and_analysis/tox_requirements.txt commands_pre = python -m pip install \ @@ -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