Skip to content

Commit

Permalink
Merge pull request #290 from GeoStat-Framework/add_numpy2_support
Browse files Browse the repository at this point in the history
Add numpy2 support
  • Loading branch information
MuellerSeb committed May 27, 2024
2 parents b33c57d + 52bee06 commit e02baad
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 105 deletions.
75 changes: 46 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black 'isort[colors]<6'
pip install -v --editable .[lint]
- name: black check
run: |
Expand All @@ -40,63 +40,79 @@ jobs:
run: |
python -m isort --check --diff --color .
- name: cython-lint check
run: |
cython-lint src/pykrige/
build_wheels:
name: wheels for ${{ matrix.cfg.os }} / ${{ matrix.cfg.arch }}
runs-on: ${{ matrix.cfg.os }}
name: wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-latest, arch: x86_64 }
- { os: ubuntu-latest, arch: i686 }
- { os: windows-latest, arch: AMD64 }
- { os: windows-latest, arch: x86 }
- { os: macos-latest, arch: x86_64 }
- { os: macos-latest, arch: arm64 }
- { os: macos-latest, arch: universal2 }
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.cfg.arch }}
uses: pypa/[email protected]
with:
output-dir: dist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl

build_sdist:
name: sdist and coveralls
runs-on: ubuntu-latest
name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }} scipy${{ matrix.ver.sp }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
ver:
- {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
- {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
- {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
- {py: '3.11', np: '==1.23.2', sp: '==1.9.2'}
- {py: '3.12', np: '==1.26.2', sp: '==1.11.2'}
- {py: '3.12', np: '>=2.0.0rc1', sp: '>=1.13.0'}
exclude:
- os: macos-14
ver: {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
- os: macos-14
ver: {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
- os: macos-14
ver: {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python ${{ matrix.ver.py }}
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: ${{ matrix.ver.py }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build coveralls>=3.0.0
pip install build "coveralls>=3.0.0"
- name: Install PyKrige
run: |
pip install -v --editable .[test]
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install "numpy${{ matrix.ver.np }}" "scipy${{ matrix.ver.sp }}"
python -m pytest --cov pykrige --cov-report term-missing -v tests/
python -m coveralls --service=github
Expand All @@ -105,7 +121,8 @@ jobs:
# PEP 517 package builder from pypa
python -m build --sdist --outdir dist .
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.9'
with:
path: dist/*.tar.gz

Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
sphinx:
configuration: docs/source/conf.py

formats: all
formats: [pdf]

python:
install:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ Changelog
=========


Version 1.7.2
-------------
*May 27, 2024*

**New features**

* added support for numpy 2 ([#290](https://github.com/GeoStat-Framework/PyKrige/pull/290))

**Changes**

* remove universal2 wheels for macos (we already provide separate intel and arm64 wheels) ([#290](https://github.com/GeoStat-Framework/PyKrige/pull/290))

**Bug fixes**

* fixed cython long / longlong issue on windows ([#290](https://github.com/GeoStat-Framework/PyKrige/issues/290))


Version 1.7.1
-------------
*October 14, 2023*
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2022, PyKrige Developers
Copyright (c) 2015-2024, PyKrige Developers
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
42 changes: 28 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
requires = [
"setuptools>=64",
"setuptools_scm>=7",
"oldest-supported-numpy",
"scipy>=1.1.0,<2",
"Cython>=0.28.3,<3.0",
"numpy>=2.0.0rc1,<2.3; python_version >= '3.9'",
"scipy>=1.13.0,<2; python_version >= '3.9'",
"oldest-supported-numpy; python_version < '3.9'",
"scipy>=1.3.2,<2; python_version < '3.9'",
"Cython>=3.0.10,<3.1.0",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -46,21 +48,21 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
"numpy>=1.14.5,<2",
"numpy>=1.20.0",
"scipy>=1.1.0,<2",
]

[project.optional-dependencies]
doc = [
"gstools>=1.3,<2",
"gstools>=1.4,<2",
"pillow",
"scikit-learn>=0.19",
"m2r2>=0.2.8",
"matplotlib>=3",
"numpydoc>=1.1",
"sphinx>=4",
"sphinx>=7",
"sphinx-gallery>=0.8",
"sphinx-rtd-theme>=1",
"sphinx-rtd-theme>=2",
]
plot = ["matplotlib>=3,<4"]
sklearn = ["scikit-learn>=0.19"]
Expand All @@ -69,6 +71,12 @@ test = [
"scikit-learn>=0.19",
"gstools>=1.4,<2",
]
lint = [
"black>=23,<24",
"pylint",
"isort[colors]",
"cython-lint",
]

[project.urls]
Changelog = "https://github.com/GeoStat-Framework/PyKrige/blob/main/CHANGELOG.md"
Expand All @@ -92,7 +100,16 @@ profile = "black"
multi_line_output = 3

[tool.black]
target-version = ["py38"]
target-version = [
"py38",
"py39",
"py310",
"py311",
"py312",
]

[tool.cython-lint]
max-line-length = 100

[tool.coverage]
[tool.coverage.run]
Expand Down Expand Up @@ -121,6 +138,7 @@ target-version = ["py38"]
[tool.pylint.message_control]
disable = [
"R0801",
"C0103", # lots of invalid variable names
]

[tool.pylint.reports]
Expand All @@ -137,12 +155,8 @@ target-version = ["py38"]
[tool.cibuildwheel]
# Switch to using build
build-frontend = "build"
# Disable building PyPy wheels on all platforms, 32bit for py3.10/11/12 and musllinux builds, py3.6/7
skip = ["cp36-*", "cp37-*", "pp*", "cp31*-win32", "cp31*-manylinux_i686", "*-musllinux_*"]
# Disable building PyPy wheels on all platforms, 32bit and musllinux builds, py3.6/7
skip = ["cp36-*", "cp37-*", "pp*", "*-win32", "*-manylinux_i686", "*-musllinux_*"]
# Run the package tests using `pytest`
test-extras = "test"
test-command = "pytest -v {package}/tests"
# Skip trying to test arm64 builds on Intel Macs
test-skip = "*-macosx_arm64 *-macosx_universal2:arm64"
# no wheels for linux-32bit anymore for numpy>=1.22
environment = "PIP_PREFER_BINARY=1"
2 changes: 1 addition & 1 deletion src/pykrige/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__all__ = ["cok", "lapack", "variogram_models"]
__all__ = ["cok", "variogram_models"]
Loading

0 comments on commit e02baad

Please sign in to comment.