diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 7326da3..8539574 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -64,7 +64,7 @@ jobs: needs: [generate_matrix] name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} - if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') strategy: matrix: os: ${{ fromJson(needs.generate_matrix.outputs.OSES) }} @@ -81,13 +81,14 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.11.2 + uses: pypa/cibuildwheel@v2.16.0 env: CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_LINUX: ${{ fromJson(needs.generate_matrix.outputs.CIBW_ARCHS_LINUX) }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_EXTRAS: "py36" + CIBW_TEST_REQUIRES: "pytest scikit-learn" + CIBW_BEFORE_BUILD: "pip install numpy>=2.0.0" CIBW_TEST_COMMAND: "pytest {package}/test" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" - uses: actions/upload-artifact@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 0c0328b..d98a322 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,8 @@ homepage = "https://sites.google.com/view/yiqiuwang/dbscan" repository = "https://github.com/wangyiqiu/dbscan-python" [build-system] -requires = ["setuptools", "setuptools_scm", "wheel", "oldest-supported-numpy"] +requires = ["setuptools", "setuptools_scm", "wheel", "numpy>=2.0.0"] +backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "pythonmodule/_version.py" @@ -53,7 +54,7 @@ write_to = "pythonmodule/_version.py" # architectures, like ppc64le or s390x. You can do this by running the same # command you run normally: # pip install dbscan -build = "cp36-* cp38-macosx_arm64" # pp39-* cp39-win_arm64 +build = "cp39-* cp310-* cp311-* cp312-*" skip = "*-win32 *_i686 *-musllinux_*" # We will only build x86_64 when merged into master to save on compilation diff --git a/setup.py b/setup.py index c30b5f4..4f0cf3b 100644 --- a/setup.py +++ b/setup.py @@ -56,11 +56,10 @@ def initialize_options(self): ] )], python_requires=f'>={sys.version_info.major}.{sys.version_info.minor},<4', - install_requires=[f'numpy>={numpy.__version__},<2'], + install_requires=['numpy>=2.0.0'], extras_require={ 'scikit-learn': ['scikit-learn'], 'example': ['scikit-learn', 'matplotlib'], - 'py36': ['scikit-learn', 'matplotlib', 'pytest'], }, zip_safe=False,