Skip to content

Remove NumPy as a build dependency - #2436

Open
ndgrigorian wants to merge 3 commits into
masterfrom
drop-numpy-as-build-dependency
Open

ndgrigorian wants to merge 3 commits into
masterfrom
drop-numpy-as-build-dependency

Conversation

@ndgrigorian

@ndgrigorian ndgrigorian commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

This PR removes NumPy as a build dependency of dpctl, as none of its extensions use the NumPy C-API. NumPy remains a run-time dependency

The CMake build no longer asks FindPython for the NumPy component or links the extensions to Python::NumPy, and numpy is dropped from [build-system] requires in pyproject.toml, requirements.txt, the conda recipe's host requirements and conda_build_config.yaml, and the Coverity workflow, which only builds

The Cython and pybind11 examples no longer ask for the NumPy component either, as they only import numpy at run time and pybind11/numpy.h needs no NumPy headers

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

@coveralls

coveralls commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 75.173%. remained the same — drop-numpy-as-build-dependency into master

The NumPy component brought in Interpreter implicitly; without it FindPython
does not detect the free-threaded ABI and fails on 3.15t.
Comment thread conda-recipe/meta.yaml
Comment on lines 39 to 42
- scikit-build >=0.17.0,<1.0
- cython >=3.1.0 # [py>=313]
- cython >=3.0.10 # [py<313]
- numpy
# WARNING: check with doc how to upgrade

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With numpy gone from host, the package no longer gets numpy's run_exports, so the run entry numpy has no bounds at all. Before, conda-forge's numpy 2 added >=1.x,<3 to it. Now a future numpy 3 satisfies it, and conda disagrees with numpy>=2.0.0 in pyproject.toml. Could run say numpy >=2.0.0 (and maybe <3)?

This branch has not been deployed

No deployments
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.

3 participants