Skip to content

Fix compilation warnings#691

Open
Rhaedonius wants to merge 3 commits into
scikit-learn-contrib:masterfrom
Rhaedonius:fix_compilation_warnings
Open

Fix compilation warnings#691
Rhaedonius wants to merge 3 commits into
scikit-learn-contrib:masterfrom
Rhaedonius:fix_compilation_warnings

Conversation

@Rhaedonius
Copy link
Copy Markdown
Contributor

Just a couple of very minor tweaks to address warnings during builds:

  • cython now requires nogil at the end of the declaration
  • numpy requires to add #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION to ensure we're not building against deprecated functions and fail in case they are used
  • test_suite and test_requires have been deprecated for a while and have been removed from setup.py
  • 'License :: OSI Approved' tag is also deprecated in PEP 639 in favour of "license-expression"
  • Adding build-backend to pyproject.toml to complete the specifications for a build using PEP 518
  • Force numpy>=2 during build since the resulting wheel will be compatible also with numpy<2

Rhaedonius added 3 commits October 13, 2025 21:57
force_all_finite has been deprecated in scikit-learn 1.6.0 and will be
removed in the upcoming 1.8.0
Mokto added a commit to Mokto/hdbscan that referenced this pull request May 8, 2026
The published wheels haven't kept up: the Linux job pinned `cython<3`
inside a `manylinux2014` container and built only cp38-cp311, leaving
no upstream wheels for 3.12+ and producing artifacts incompatible with
NumPy 2.x. This PR brings the build chain forward.

Build system
- `[build-system]` now requires `cython>=3.0.11,<4` and `numpy>=2.0,<3`
  so any source build (CI, conda-forge, end-user `pip install`) targets
  current Cython/NumPy.
- `requires-python = ">=3.10"` matches the supported matrix; 3.8 reached
  EOL on 2024-10-07 and 3.9 on 2025-10-31.
- Adds the `Programming Language :: Python :: 3.14` classifier.

Cython 3 source updates
- Reorders `nogil except -1` -> `except -1 nogil` across `.pyx`/`.pxd`
  (Cython 3 syntax requirement).
- Adds `# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION`
  to silence NumPy deprecated-API warnings at compile time.

These rebases the still-relevant source-file hunks of scikit-learn-contrib#691 onto current
master; scikit-learn-contrib#691's pyproject/setup.py hunks have been superseded by master.

Wheel CI (`.github/workflows/pythonpublish_wheel.yml`)
- Linux: bumps the manylinux image from `manylinux2014_x86_64` to
  `manylinux_2_28_x86_64` (Python 3.14 needs glibc >= 2.28), pins
  `cython>=3.0.11,<4` and `numpy>=2.0` in the build env, installs
  `setuptools` + `wheel` (the cp314 image doesn't ship them by default),
  and extends the matrix to cp310-cp314.
- Windows/macOS: replaces the deprecated `oldest-supported-numpy` with
  `numpy>=2.0`, bumps `actions/checkout`@v1->v4 and
  `actions/setup-python`@v1->v5 (v1 doesn't support recent Pythons),
  retires the EOL `windows-2019`/`macos-11` runners (now
  `windows-2022` + `macos-14` -- macOS 14 already produces universal2
  wheels covering both arm64 and x86_64), extends the matrix to
  3.10-3.14, and enables `allow-prereleases: true` in case 3.14 isn't
  GA on a runner yet.
- Disables `fail-fast` on both matrices so one failure doesn't cancel
  the rest.

Verification
- All 15 build jobs (Linux cp310-cp314, Windows + macOS for 3.10-3.14)
  go green on a workflow_dispatch run on the fork.
- Locally on Python 3.14.4 with Cython 3.2.4 + NumPy 2.4.4: every
  extension cythonizes and compiles cleanly, and `HDBSCAN().fit(X)`
  runs end-to-end.

This is consistent with how conda-forge already ships working py314
builds of this package. Closes scikit-learn-contrib#688 (missing wheels for 3.13), scikit-learn-contrib#686
(Linux wheel for 3.12). Supersedes scikit-learn-contrib#691 for the parts still needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant