From 37050fa67bd462ef0f271915c2182762d923714a Mon Sep 17 00:00:00 2001 From: "Travis A. O'Brien" Date: Tue, 10 Sep 2024 10:52:12 -0400 Subject: [PATCH 1/3] Fix build and test system * test only on recent versions of python * test for compatibility with numpy v1 * force minimum version compatibility for numpy v1 --- .github/workflows/test.yml | 48 +++++++++++++++++++++++++++++++------- pyproject.toml | 9 +++++-- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84ac163..ea879a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,18 +10,14 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - # exclude MacOS arm64 on 3.7 - exclude: - - os: macos-latest - python-version: '3.7' + python-version: ['3.9', '3.10', '3.11', '3.12'] runs-on: ${{ matrix.os }} steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -33,7 +29,41 @@ jobs: pip install -e . - name: Run linting tests on files in src - run: ruff src + run: ruff check src - name: Run tests - run: pytest \ No newline at end of file + run: pytest + + # test old versions of numpy; this follows advice in + # https://numpy.org/doc/stable/dev/depending_on_numpy.html#depending-on-numpy + old_numpy_test: + strategy: + matrix: + os: [ubuntu-latest] + python-version: ['3.9', '3.10', '3.11', '3.12'] + runs-on: ${{ matrix.os }} + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Build wheel via wheel, then install it + run: | + python -m pip install build + python -m build # This will pull in numpy 2.0 in an isolated env + python -m pip install dist/*.whl + + - name: Test against oldest supported numpy version + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install numpy==1.26.4 + # now run test suite + pip install -r requirements.txt + pip install pytest ruff + pip install -e . + pytest \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ad357e0..87405be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,11 @@ [project] name = "fastkde" -dynamic = ["dependencies", "version", "optional-dependencies", "description", "readme", "authors", "keywords"] +dynamic = ["version", "optional-dependencies", "description", "readme", "authors", "keywords"] +dependencies = [ + "numpy>=1.26.4", + "scipy", + "xarray", +] [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} @@ -16,7 +21,7 @@ requires = [ "wheel", "toml", "setuptools_scm>=4.1.2", - "oldest-supported-numpy; python_version>='3.5'", + "numpy>=2.0.0", ] build-backend = "setuptools.build_meta" From da7fc5075916648bdd9ba8df5ef87966f6886cf4 Mon Sep 17 00:00:00 2001 From: "Travis A. O'Brien" Date: Tue, 10 Sep 2024 11:47:40 -0400 Subject: [PATCH 2/3] Fix wheel build system: * Upgrade action versions in wheels.yml * drop wheel support for python < 3.9 * Build using python 3.12 --- .github/workflows/wheels.yml | 23 ++++++++++++++--------- pyproject.toml | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0a64d71..9fa3513 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -32,7 +32,7 @@ env: jobs: build_sdist: name: Build SDist - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -43,27 +43,32 @@ jobs: if: github.event.inputs.overrideVersion run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Build SDist run: pipx run build --sdist - name: Check metadata run: pipx run twine check --strict dist/* - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz build_arch_wheels: name: ${{ matrix.python }} on ${{ matrix.arch }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: - python: [37, 38, 39, 310, 311, 312] + python: [39, 310, 311, 312] arch: [aarch64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: true @@ -77,7 +82,7 @@ jobs: with: platforms: all - - uses: pypa/cibuildwheel@v2.16 + - uses: pypa/cibuildwheel@v2.20 env: CIBW_BUILD: cp${{ matrix.python }}-manylinux_* CIBW_ARCHS: ${{ matrix.arch }} @@ -87,7 +92,7 @@ jobs: shell: bash - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: wheelhouse/*.whl @@ -115,7 +120,7 @@ jobs: shell: bash run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}" >> $GITHUB_ENV - - uses: pypa/cibuildwheel@v2.16 + - uses: pypa/cibuildwheel@v2.20 env: CIBW_BUILD: ${{ matrix.build }} CIBW_ARCHS: ${{ matrix.arch }} @@ -125,7 +130,7 @@ jobs: shell: bash - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: wheelhouse/*.whl diff --git a/pyproject.toml b/pyproject.toml index 87405be..8c1df2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,5 @@ [project] +requires-python = ">=3.9" name = "fastkde" dynamic = ["version", "optional-dependencies", "description", "readme", "authors", "keywords"] dependencies = [ From 768f10026dd35423e2a82a0054d9c0553a0737d0 Mon Sep 17 00:00:00 2001 From: "Travis A. O'Brien" Date: Tue, 10 Sep 2024 12:08:35 -0400 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20version:=202.0.1=20=E2=86=92=202.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- REVISION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d6f49e1..4939ccc 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.1 +current_version = 2.1.0 commit = True tag = True diff --git a/REVISION b/REVISION index 38f77a6..7ec1d6d 100644 --- a/REVISION +++ b/REVISION @@ -1 +1 @@ -2.0.1 +2.1.0