Skip to content

Commit

Permalink
Merge pull request #45 from LBL-EESA/numpy_compat_fixes
Browse files Browse the repository at this point in the history
Build and test system fixes
  • Loading branch information
taobrienlbl authored Sep 10, 2024
2 parents 4b213c0 + 768f100 commit ec61aec
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.1
current_version = 2.1.0
commit = True
tag = True

Expand Down
48 changes: 39 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
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
23 changes: 14 additions & 9 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -87,7 +92,7 @@ jobs:
shell: bash

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl

Expand Down Expand Up @@ -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 }}
Expand All @@ -125,7 +130,7 @@ jobs:
shell: bash

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl

Expand Down
2 changes: 1 addition & 1 deletion REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1
2.1.0
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
[project]
requires-python = ">=3.9"
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"]}
Expand All @@ -16,7 +22,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"
Expand Down

0 comments on commit ec61aec

Please sign in to comment.