Skip to content

Commit e02baad

Browse files
authored
Merge pull request #290 from GeoStat-Framework/add_numpy2_support
Add numpy2 support
2 parents b33c57d + 52bee06 commit e02baad

File tree

10 files changed

+149
-105
lines changed

10 files changed

+149
-105
lines changed

.github/workflows/main.yml

+46-29
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
fail-fast: false
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424

25-
- name: Set up Python 3.8
26-
uses: actions/setup-python@v2
25+
- name: Set up Python 3.9
26+
uses: actions/setup-python@v5
2727
with:
28-
python-version: 3.8
28+
python-version: 3.9
2929

3030
- name: Install dependencies
3131
run: |
3232
python -m pip install --upgrade pip
33-
pip install black 'isort[colors]<6'
33+
pip install -v --editable .[lint]
3434
3535
- name: black check
3636
run: |
@@ -40,63 +40,79 @@ jobs:
4040
run: |
4141
python -m isort --check --diff --color .
4242
43+
- name: cython-lint check
44+
run: |
45+
cython-lint src/pykrige/
46+
4347
build_wheels:
44-
name: wheels for ${{ matrix.cfg.os }} / ${{ matrix.cfg.arch }}
45-
runs-on: ${{ matrix.cfg.os }}
48+
name: wheels for ${{ matrix.os }}
49+
runs-on: ${{ matrix.os }}
4650
strategy:
4751
fail-fast: false
4852
matrix:
49-
cfg:
50-
- { os: ubuntu-latest, arch: x86_64 }
51-
- { os: ubuntu-latest, arch: i686 }
52-
- { os: windows-latest, arch: AMD64 }
53-
- { os: windows-latest, arch: x86 }
54-
- { os: macos-latest, arch: x86_64 }
55-
- { os: macos-latest, arch: arm64 }
56-
- { os: macos-latest, arch: universal2 }
53+
# macos-13 is an intel runner, macos-14 is apple silicon
54+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
5755

5856
steps:
59-
- uses: actions/checkout@v2
57+
- uses: actions/checkout@v4
6058
with:
6159
fetch-depth: '0'
6260

6361
- name: Build wheels
64-
uses: pypa/[email protected]
65-
env:
66-
CIBW_ARCHS: ${{ matrix.cfg.arch }}
62+
uses: pypa/[email protected]
6763
with:
6864
output-dir: dist
6965

70-
- uses: actions/upload-artifact@v2
66+
- uses: actions/upload-artifact@v3
7167
with:
7268
path: ./dist/*.whl
7369

7470
build_sdist:
75-
name: sdist and coveralls
76-
runs-on: ubuntu-latest
71+
name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }} scipy${{ matrix.ver.sp }}
72+
runs-on: ${{ matrix.os }}
7773
strategy:
7874
fail-fast: false
79-
75+
matrix:
76+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
77+
# https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
78+
ver:
79+
- {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
80+
- {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
81+
- {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
82+
- {py: '3.11', np: '==1.23.2', sp: '==1.9.2'}
83+
- {py: '3.12', np: '==1.26.2', sp: '==1.11.2'}
84+
- {py: '3.12', np: '>=2.0.0rc1', sp: '>=1.13.0'}
85+
exclude:
86+
- os: macos-14
87+
ver: {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
88+
- os: macos-14
89+
ver: {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
90+
- os: macos-14
91+
ver: {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
8092
steps:
81-
- uses: actions/checkout@v2
93+
- uses: actions/checkout@v4
8294
with:
8395
fetch-depth: '0'
8496

85-
- name: Set up Python 3.8
86-
uses: actions/setup-python@v2
97+
- name: Set up Python ${{ matrix.ver.py }}
98+
uses: actions/setup-python@v5
8799
with:
88-
python-version: 3.8
100+
python-version: ${{ matrix.ver.py }}
89101

90102
- name: Install dependencies
91103
run: |
92104
python -m pip install --upgrade pip
93-
pip install build coveralls>=3.0.0
105+
pip install build "coveralls>=3.0.0"
106+
107+
- name: Install PyKrige
108+
run: |
94109
pip install -v --editable .[test]
95110
96111
- name: Run tests
97112
env:
98113
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99114
run: |
115+
pip install "numpy${{ matrix.ver.np }}" "scipy${{ matrix.ver.sp }}"
100116
python -m pytest --cov pykrige --cov-report term-missing -v tests/
101117
python -m coveralls --service=github
102118
@@ -105,7 +121,8 @@ jobs:
105121
# PEP 517 package builder from pypa
106122
python -m build --sdist --outdir dist .
107123
108-
- uses: actions/upload-artifact@v2
124+
- uses: actions/upload-artifact@v3
125+
if: matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.9'
109126
with:
110127
path: dist/*.tar.gz
111128

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build:
88
sphinx:
99
configuration: docs/source/conf.py
1010

11-
formats: all
11+
formats: [pdf]
1212

1313
python:
1414
install:

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ Changelog
22
=========
33

44

5+
Version 1.7.2
6+
-------------
7+
*May 27, 2024*
8+
9+
**New features**
10+
11+
* added support for numpy 2 ([#290](https://github.com/GeoStat-Framework/PyKrige/pull/290))
12+
13+
**Changes**
14+
15+
* remove universal2 wheels for macos (we already provide separate intel and arm64 wheels) ([#290](https://github.com/GeoStat-Framework/PyKrige/pull/290))
16+
17+
**Bug fixes**
18+
19+
* fixed cython long / longlong issue on windows ([#290](https://github.com/GeoStat-Framework/PyKrige/issues/290))
20+
21+
522
Version 1.7.1
623
-------------
724
*October 14, 2023*

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2022, PyKrige Developers
1+
Copyright (c) 2015-2024, PyKrige Developers
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

pyproject.toml

+28-14
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
requires = [
33
"setuptools>=64",
44
"setuptools_scm>=7",
5-
"oldest-supported-numpy",
6-
"scipy>=1.1.0,<2",
7-
"Cython>=0.28.3,<3.0",
5+
"numpy>=2.0.0rc1,<2.3; python_version >= '3.9'",
6+
"scipy>=1.13.0,<2; python_version >= '3.9'",
7+
"oldest-supported-numpy; python_version < '3.9'",
8+
"scipy>=1.3.2,<2; python_version < '3.9'",
9+
"Cython>=3.0.10,<3.1.0",
810
]
911
build-backend = "setuptools.build_meta"
1012

@@ -46,21 +48,21 @@ classifiers = [
4648
"Topic :: Utilities",
4749
]
4850
dependencies = [
49-
"numpy>=1.14.5,<2",
51+
"numpy>=1.20.0",
5052
"scipy>=1.1.0,<2",
5153
]
5254

5355
[project.optional-dependencies]
5456
doc = [
55-
"gstools>=1.3,<2",
57+
"gstools>=1.4,<2",
5658
"pillow",
5759
"scikit-learn>=0.19",
5860
"m2r2>=0.2.8",
5961
"matplotlib>=3",
6062
"numpydoc>=1.1",
61-
"sphinx>=4",
63+
"sphinx>=7",
6264
"sphinx-gallery>=0.8",
63-
"sphinx-rtd-theme>=1",
65+
"sphinx-rtd-theme>=2",
6466
]
6567
plot = ["matplotlib>=3,<4"]
6668
sklearn = ["scikit-learn>=0.19"]
@@ -69,6 +71,12 @@ test = [
6971
"scikit-learn>=0.19",
7072
"gstools>=1.4,<2",
7173
]
74+
lint = [
75+
"black>=23,<24",
76+
"pylint",
77+
"isort[colors]",
78+
"cython-lint",
79+
]
7280

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

94102
[tool.black]
95-
target-version = ["py38"]
103+
target-version = [
104+
"py38",
105+
"py39",
106+
"py310",
107+
"py311",
108+
"py312",
109+
]
110+
111+
[tool.cython-lint]
112+
max-line-length = 100
96113

97114
[tool.coverage]
98115
[tool.coverage.run]
@@ -121,6 +138,7 @@ target-version = ["py38"]
121138
[tool.pylint.message_control]
122139
disable = [
123140
"R0801",
141+
"C0103", # lots of invalid variable names
124142
]
125143

126144
[tool.pylint.reports]
@@ -137,12 +155,8 @@ target-version = ["py38"]
137155
[tool.cibuildwheel]
138156
# Switch to using build
139157
build-frontend = "build"
140-
# Disable building PyPy wheels on all platforms, 32bit for py3.10/11/12 and musllinux builds, py3.6/7
141-
skip = ["cp36-*", "cp37-*", "pp*", "cp31*-win32", "cp31*-manylinux_i686", "*-musllinux_*"]
158+
# Disable building PyPy wheels on all platforms, 32bit and musllinux builds, py3.6/7
159+
skip = ["cp36-*", "cp37-*", "pp*", "*-win32", "*-manylinux_i686", "*-musllinux_*"]
142160
# Run the package tests using `pytest`
143161
test-extras = "test"
144162
test-command = "pytest -v {package}/tests"
145-
# Skip trying to test arm64 builds on Intel Macs
146-
test-skip = "*-macosx_arm64 *-macosx_universal2:arm64"
147-
# no wheels for linux-32bit anymore for numpy>=1.22
148-
environment = "PIP_PREFER_BINARY=1"

src/pykrige/lib/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__all__ = ["cok", "lapack", "variogram_models"]
1+
__all__ = ["cok", "variogram_models"]

0 commit comments

Comments
 (0)