Skip to content

Commit cd4093a

Browse files
authored
Merge pull request #25 from wangyiqiu/feature/numpy-2
feat(ci): Add GitHub Actions workflow for NumPy 2.0 compatibility
2 parents 304f97a + 8cfa96f commit cd4093a

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/build_wheels.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
needs: [generate_matrix]
6565
name: Build wheels on ${{ matrix.os }}
6666
runs-on: ${{ matrix.os }}
67-
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
67+
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
6868
strategy:
6969
matrix:
7070
os: ${{ fromJson(needs.generate_matrix.outputs.OSES) }}
@@ -81,13 +81,14 @@ jobs:
8181
platforms: all
8282

8383
- name: Build wheels
84-
uses: pypa/cibuildwheel@v2.11.2
84+
uses: pypa/cibuildwheel@v2.16.0
8585
env:
8686
CIBW_ARCHS_MACOS: "x86_64 arm64"
8787
CIBW_ARCHS_LINUX: ${{ fromJson(needs.generate_matrix.outputs.CIBW_ARCHS_LINUX) }}
88-
CIBW_TEST_REQUIRES: pytest
89-
CIBW_TEST_EXTRAS: "py36"
88+
CIBW_TEST_REQUIRES: "pytest scikit-learn"
89+
CIBW_BEFORE_BUILD: "pip install numpy>=2.0.0"
9090
CIBW_TEST_COMMAND: "pytest {package}/test"
91+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
9192

9293
- uses: actions/upload-artifact@v4
9394
with:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ homepage = "https://sites.google.com/view/yiqiuwang/dbscan"
3737
repository = "https://github.com/wangyiqiu/dbscan-python"
3838

3939
[build-system]
40-
requires = ["setuptools", "setuptools_scm", "wheel", "oldest-supported-numpy"]
40+
requires = ["setuptools", "setuptools_scm", "wheel", "numpy>=2.0.0"]
41+
backend = "setuptools.build_meta"
4142

4243
[tool.setuptools_scm]
4344
write_to = "pythonmodule/_version.py"
@@ -53,7 +54,7 @@ write_to = "pythonmodule/_version.py"
5354
# architectures, like ppc64le or s390x. You can do this by running the same
5455
# command you run normally:
5556
# pip install dbscan
56-
build = "cp36-* cp38-macosx_arm64" # pp39-* cp39-win_arm64
57+
build = "cp39-* cp310-* cp311-* cp312-*"
5758
skip = "*-win32 *_i686 *-musllinux_*"
5859

5960
# We will only build x86_64 when merged into master to save on compilation

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ def initialize_options(self):
5656
]
5757
)],
5858
python_requires=f'>={sys.version_info.major}.{sys.version_info.minor},<4',
59-
install_requires=[f'numpy>={numpy.__version__},<2'],
59+
install_requires=['numpy>=2.0.0'],
6060
extras_require={
6161
'scikit-learn': ['scikit-learn'],
6262
'example': ['scikit-learn', 'matplotlib'],
63-
'py36': ['scikit-learn', 'matplotlib', 'pytest'],
6463
},
6564
zip_safe=False,
6665

0 commit comments

Comments
 (0)