From c576f023bc24e7a0e00ecb86ab281e8376c0db13 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 13:59:26 +0100 Subject: [PATCH 1/8] Switch to numpy 2.0 as the build-time dependency --- python/pyproject.toml | 4 ++-- python/setup.cfg | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 0d78818..9f6b3b3 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ + "numpy>=2", "setuptools>=42", "wheel", - "oldest-supported-numpy" ] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" diff --git a/python/setup.cfg b/python/setup.cfg index 73e2279..b2a9d8a 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -37,8 +37,9 @@ platforms = packages = kastore python_requires = >=3.8 include_package_data = True +# Follow https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-abi-handling install_requires = - numpy>=1.7 + numpy>=1.23.5 humanize [options.entry_points] From 285f6627ac0e64828811c15aa599a0bbf3cb6e0b Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:03:26 +0100 Subject: [PATCH 2/8] Drop Python 3.8 and add 3.12 --- .github/workflows/tests.yml | 2 +- .github/workflows/wheels.yml | 14 +++++++------- python/setup.cfg | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2a860d2..e127ac9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python: [ 3.8, 3.11 ] + python: [ 3.9, 3.12 ] os: [ macos-latest, ubuntu-latest, windows-latest ] defaults: run: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c088055..2803640 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -15,7 +15,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python: [3.8, 3.9, "3.10", 3.11] + python: [3.9, "3.10", 3.11, 3.12] wordsize: [64] steps: - name: Checkout @@ -58,7 +58,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python: [3.8, 3.9, "3.10", 3.11] + python: [3.9, "3.10", 3.11, 3.12] steps: - name: Checkout uses: actions/checkout@v2 @@ -93,10 +93,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Build sdist shell: bash @@ -164,12 +164,12 @@ jobs: pip install -r python/requirements/CI/tests/requirements.txt python -m pytest -v python - - name: Set up Python 3.8 + - name: Set up Python 3.12 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - - name: Run tests (3.8) + - name: Run tests (3.12) run: | python -VV # We install in this odd way to make sure we get both deps and a local kastore diff --git a/python/setup.cfg b/python/setup.cfg index b2a9d8a..1bbe660 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -19,10 +19,10 @@ classifiers = Topic :: Scientific/Engineering :: Bio-Informatics License :: OSI Approved :: MIT License Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Programming Language :: Python :: 3 :: Only keywords = binary store @@ -35,7 +35,7 @@ platforms = [options] packages = kastore -python_requires = >=3.8 +python_requires = >=3.9 include_package_data = True # Follow https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-abi-handling install_requires = From 7a523b1bdc27d0197ae6196f24d1ade72937acdb Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:16:37 +0100 Subject: [PATCH 3/8] Pip install package rather than local compile --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e127ac9..22fbb77 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,12 +46,12 @@ jobs: python-version: ${{matrix.python}} - name: Install pip deps - run: pip install -r python/requirements/CI/tests/requirements.txt + run: python -m pip install -r python/requirements/CI/tests/requirements.txt - name: Build module working-directory: python run: | - python setup.py build_ext --inplace + python -m pip install . - name: Run tests working-directory: python From 3f29e5f0d1fae041294b756b4297017eb1cb9a1b Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:22:42 +0100 Subject: [PATCH 4/8] Update CircleCI config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c409fc..541a735 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ orbs: jobs: build: docker: - - image: cimg/python:3.8 + - image: cimg/python:3.9 steps: - checkout - run: @@ -16,7 +16,7 @@ jobs: sudo apt-get install -y ninja-build libcunit1-dev valgrind clang doxygen python3-pip # Install meson as root so we can install to the system below. sudo pip install meson - pip install numpy==1.18.5 + pip install numpy==1.23.5 pip install --user -r python/requirements/development.txt echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV - run: From 174994d0859835a6ff852902bca97343664fe801 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:24:26 +0100 Subject: [PATCH 5/8] Update mergify rules for updated Python versions --- .mergify.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index a31212e..5138201 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -4,12 +4,12 @@ queue_rules: - "#approved-reviews-by>=1" - "#changes-requested-reviews-by=0" - status-success=Lint - - status-success=Python (3.8, macos-latest) - - status-success=Python (3.11, macos-latest) - - status-success=Python (3.8, ubuntu-latest) - - status-success=Python (3.11, ubuntu-latest) - - status-success=Python (3.8, windows-latest) - - status-success=Python (3.11, windows-latest) + - status-success=Python (3.9, macos-latest) + - status-success=Python (3.12, macos-latest) + - status-success=Python (3.9, ubuntu-latest) + - status-success=Python (3.12, ubuntu-latest) + - status-success=Python (3.9, windows-latest) + - status-success=Python (3.12, windows-latest) - "status-success=ci/circleci: build" pull_request_rules: @@ -21,12 +21,12 @@ pull_request_rules: - base=main - label=AUTOMERGE-REQUESTED - status-success=Lint - - status-success=Python (3.8, macos-latest) - - status-success=Python (3.11, macos-latest) - - status-success=Python (3.8, ubuntu-latest) - - status-success=Python (3.11, ubuntu-latest) - - status-success=Python (3.8, windows-latest) - - status-success=Python (3.11, windows-latest) + - status-success=Python (3.9, macos-latest) + - status-success=Python (3.12, macos-latest) + - status-success=Python (3.9, ubuntu-latest) + - status-success=Python (3.12, ubuntu-latest) + - status-success=Python (3.9, windows-latest) + - status-success=Python (3.12, windows-latest) - "status-success=ci/circleci: build" actions: queue: @@ -41,4 +41,4 @@ pull_request_rules: actions: label: remove: - - AUTOMERGE-REQUESTED \ No newline at end of file + - AUTOMERGE-REQUESTED From 89281987f6579a5fe195fb70b902fa15e592dc6e Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:32:09 +0100 Subject: [PATCH 6/8] Fix some minor distribution issues. --- .circleci/config.yml | 7 +------ python/setup.cfg | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 541a735..b9f5ff4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,17 +72,12 @@ jobs: command: | cd python rm -fR build - python setup.py sdist python -m venv venv source venv/bin/activate pip install --upgrade setuptools pip wheel numpy pip install build python -m build - python setup.py build_ext - python setup.py egg_info - python setup.py bdist_wheel - pip wheel dist/*.tar.gz - pip install dist/*.tar.gz + pip install dist/*.whl - run: name: Run Python with C coverage command: | diff --git a/python/setup.cfg b/python/setup.cfg index 1bbe660..1184b51 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -36,7 +36,7 @@ platforms = [options] packages = kastore python_requires = >=3.9 -include_package_data = True +include_package_data = False # Follow https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-abi-handling install_requires = numpy>=1.23.5 From 6284bf02a266ac0cec4bbff0b389906ae415cb19 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:39:50 +0100 Subject: [PATCH 7/8] Add tests on numpy2 and 1.x --- .github/workflows/tests.yml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 22fbb77..6091e01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,6 @@ jobs: pip install clang-format==6.0.1 - uses: pre-commit/action@v3.0.0 - test: name: Python runs-on: ${{ matrix.os }} @@ -57,3 +56,38 @@ jobs: working-directory: python run: | python -m pytest tests + + numpy-versions: + name: Numpy compat + runs-on: ubuntu-latest + strategy: + matrix: + numpy: [ 1.23.5, "2.0" ] + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install numpy + run: python -m pip install numpy==${{matrix.numpy}} + + - name: Install package + working-directory: python + run: | + python -m pip install . + + - name: Install pip deps + run: | + python -m pip install -r python/requirements/CI/tests/requirements.txt + # Make sure we're still using the same version of numpy + python -m pip install numpy==${{matrix.numpy}} + + - name: Run tests + working-directory: python + run: | + python -m pytest tests From 194504493d1a1551abba26b884ddfcada4e9755d Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Thu, 20 Jun 2024 14:49:28 +0100 Subject: [PATCH 8/8] Update CHANGELOG for release --- python/CHANGELOG.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/CHANGELOG.rst b/python/CHANGELOG.rst index 0c9fa48..4ffbe48 100644 --- a/python/CHANGELOG.rst +++ b/python/CHANGELOG.rst @@ -1,8 +1,11 @@ -------------------- -[0.3.X] - 202X-XX-XX +[0.3.3] - 2024-06-20 -------------------- -kastore now requires Python 3.8 or later. +Maintenance release: + +- Support for numpy 1.x and 2.x +- Require Python >= 3.9 --------------------