From 1e35124d2746a183c2fe1ccd70b24d508fe335ba Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 17 Aug 2023 00:07:12 -0400 Subject: [PATCH 1/8] MNT: Update minimum Python and build requirements --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7bf1cb47..19250128 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ requires = [ "setuptools_scm[toml]>=6.2", "cython", # Newer than NEP29-minimum: compile against oldest numpy available - "numpy==1.24; python_version >= '3.11'", - "numpy==1.22; python_version >= '3.10' and python_version < '3.11'", - # NEP29-minimum as of Jan 31, 2023 - "numpy==1.21; python_version >= '3.7' and python_version < '3.10'", + "numpy==1.26b1; python_version >= '3.12rc1'", + "numpy==1.24; python_version >= '3.11' and python_version < '3.12.dev0'", + # NEP29-minimum as of Aug 17, 2023 + "numpy==1.22; python_version >= '3.8' and python_version < '3.11'", ] build-backend = "setuptools.build_meta" @@ -17,7 +17,7 @@ dynamic = ["version"] description = "Nitime: timeseries analysis for neuroscience data" readme = "README.txt" license = { file = "LICENSE" } -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "Nitime developers", email = "neuroimaging@python.org" }, ] From d4d5dcd7f095bb67fa94ae7d5a1b06a1d37498d9 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 17 Aug 2023 00:07:52 -0400 Subject: [PATCH 2/8] CI: Build on Python 3.12, drop 3.7 [build wheels] --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5c64b33b..c9157f68 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -61,7 +61,7 @@ jobs: - [ubuntu-20.04, musllinux_x86_64] - [macos-12, macosx_*] - [windows-2019, win_amd64] - python: ["cp37", "cp38", "cp39", "cp310", "cp311"] + python: ["cp38", "cp39", "cp310", "cp311", "cp312"] include: # Manylinux builds are cheap, do all in one - { buildplat: ["ubuntu-20.04", "manylinux_x86_64"], python: "*" } From 1cc19bb113e6fd093b00ff53a052774fa58ebaae Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 17 Aug 2023 00:22:23 -0400 Subject: [PATCH 3/8] CI: Hint cibuildwheel version to pipx [build wheels] --- .github/workflows/wheels.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c9157f68..1838751d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -71,8 +71,13 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-python@v3 + + - name: Update pip/pipx + run: pip install --upgrade pip pipx + - name: Build wheel(s) - run: pipx run cibuildwheel + run: pipx run --spec "cibuildwheel>=2.15" cibuildwheel env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} From 8a01879b07d078ea11e592c5ab07b8d88426ef3d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 17 Aug 2023 01:15:17 -0400 Subject: [PATCH 4/8] CI: Test on Python 3.12 Update requirements.txt to use binary files and pre-releases if necessary. --- .github/workflows/test.yml | 3 ++- min-requirements.txt | 2 ++ requirements.txt | 2 ++ tools/update_requirements.py | 12 +++++++++--- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbd248e2..60042977 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] requires: ['requirements.txt'] include: - python-version: '3.8' @@ -35,6 +35,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install run: | python -m pip install --upgrade pip diff --git a/min-requirements.txt b/min-requirements.txt index 368d4dd4..9732d512 100644 --- a/min-requirements.txt +++ b/min-requirements.txt @@ -1,4 +1,6 @@ # Auto-generated by tools/update_requirements.py +--only-binary :all: +--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib==3.5 numpy==1.22 scipy==1.8 diff --git a/requirements.txt b/requirements.txt index 50731b29..2c7f54f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ # Auto-generated by tools/update_requirements.py +--only-binary :all: +--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib>=3.5 numpy>=1.22 scipy>=1.8 diff --git a/tools/update_requirements.py b/tools/update_requirements.py index 5992e9f2..25d33e10 100755 --- a/tools/update_requirements.py +++ b/tools/update_requirements.py @@ -19,12 +19,18 @@ script_name = Path(__file__).relative_to(repo_root) -lines = [f'# Auto-generated by {script_name}', ''] +lines = [ + f'# Auto-generated by {script_name}', + '--only-binary :all:', + '--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple', + '', +] +start = len(lines) - 1 # Write requirements -lines[1:-1] = requirements +lines[start:-1] = requirements reqs.write_text('\n'.join(lines)) # Write minimum requirements -lines[1:-1] = [req.replace('>=', '==').replace('~=', '==') for req in requirements] +lines[start:-1] = [req.replace('>=', '==').replace('~=', '==') for req in requirements] min_reqs.write_text('\n'.join(lines)) From 90fc10367e56bfb813f8a8f025a0bc69c748a3d3 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 25 Aug 2023 15:57:15 -0400 Subject: [PATCH 5/8] MNT: Require binaries for numpy and scipy only --- min-requirements.txt | 2 +- requirements.txt | 2 +- tools/update_requirements.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/min-requirements.txt b/min-requirements.txt index 9732d512..8397e830 100644 --- a/min-requirements.txt +++ b/min-requirements.txt @@ -1,5 +1,5 @@ # Auto-generated by tools/update_requirements.py ---only-binary :all: +--only-binary numpy,scipy --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib==3.5 numpy==1.22 diff --git a/requirements.txt b/requirements.txt index 2c7f54f9..3b568253 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Auto-generated by tools/update_requirements.py ---only-binary :all: +--only-binary numpy,scipy --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib>=3.5 numpy>=1.22 diff --git a/tools/update_requirements.py b/tools/update_requirements.py index 25d33e10..92e9e83e 100755 --- a/tools/update_requirements.py +++ b/tools/update_requirements.py @@ -21,7 +21,7 @@ lines = [ f'# Auto-generated by {script_name}', - '--only-binary :all:', + '--only-binary numpy,scipy', '--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple', '', ] From 413b08681a221f6e6ba32fd02ecff5ee5cac588f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 25 Aug 2023 16:02:39 -0400 Subject: [PATCH 6/8] MNT: Temporarily pin numpy 1.26.0b1 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3b568253..48558bbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,8 @@ --only-binary numpy,scipy --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple matplotlib>=3.5 -numpy>=1.22 +numpy>=1.26.0b1; python_version > '3.11' +numpy>=1.22; python_version <= '3.11' scipy>=1.8 networkx>=2.7 nibabel>=4.0 From 3c201ba00d9feb287e91707cb2414d776a1a174e Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 25 Aug 2023 16:02:52 -0400 Subject: [PATCH 7/8] CI: Drop max-parallel limitation --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 60042977..a91458da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,6 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 4 matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] requires: ['requirements.txt'] From 6e9fad998506ed5054e62ae4beaac37a2c0734e1 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 25 Aug 2023 16:13:54 -0400 Subject: [PATCH 8/8] BLD: Build against numpy>=1.25 for all versions > 3.8 --- pyproject.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 19250128..41ff9f00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,11 +3,12 @@ requires = [ "setuptools", "setuptools_scm[toml]>=6.2", "cython", - # Newer than NEP29-minimum: compile against oldest numpy available - "numpy==1.26b1; python_version >= '3.12rc1'", - "numpy==1.24; python_version >= '3.11' and python_version < '3.12.dev0'", - # NEP29-minimum as of Aug 17, 2023 - "numpy==1.22; python_version >= '3.8' and python_version < '3.11'", + "numpy==1.26b1; python_version >= '3.12rc1'", # Until 3.12 and 1.26 are released + # As of numpy 1.25, you can now build against older APIs. + # https://numpy.org/doc/stable/release/1.25.0-notes.html + "numpy>=1.25; python_version > '3.8'", + # NEP29-minimum as of Aug 17, 2023 (1.25 doesn't support 3.8) + "numpy==1.22; python_version == '3.8'", ] build-backend = "setuptools.build_meta"