Skip to content

Drop pybind11 from the runtime dependencies - #33

Merged
Sophia Wen (hfwen0502) merged 1 commit into
mainfrom
drop-pybind11-runtime-dep
Sep 16, 2026
Merged

Sophia Wen (hfwen0502) merged 1 commit into
mainfrom
drop-pybind11-runtime-dep

Conversation

@garrison

Copy link
Copy Markdown
Member

pybind11 is declared as a runtime dependency, but it is only needed to compile the extension: setup.py calls pybind11.get_include(), and it is already listed in [build-system] requires. Nothing in the installed package imports it — the only mentions in python/*.py are a comment and a docstring — so every install has been pulling it in for nothing.

I noticed this while writing a conda-forge recipe. conda separates build-time from runtime requirements, so pybind11 went into the recipe's host section and not run. The built package's pip check then failed against an environment that was actually correct:

sbd-eigensolver 1.6.1 requires pybind11, which is not installed

Verified with the patch applied: pip show reports Requires: mpi4py, numpy, pip check reports no broken requirements, the CPU extension still compiles and imports, and pytest passes (2 passed, 7 skipped — the slow and MPI cases opt out by default).

mpi4py stays in both lists, correctly: it is needed at build time for its headers and at run time for MPI.


This PR was generated by Claude Opus 5 under my guidance.

pybind11 is needed only to compile the extension -- setup.py calls
pybind11.get_include() -- and it is already declared in
[build-system] requires. Nothing in the installed package imports it,
so every install has been pulling it in for nothing.

Noticed while writing a conda-forge recipe: conda separates build from
runtime requirements, so `pip check` in the built package reported

    sbd-eigensolver 1.6.1 requires pybind11, which is not installed

against an environment that was correct.

Assisted-by: Claude Opus 5 (1M context)
@garrison
Jim Garrison (garrison) marked this pull request as ready for review September 16, 2026 01:02
@hfwen0502
Sophia Wen (hfwen0502) merged commit a0d1af1 into main Sep 16, 2026
11 checks passed
@hfwen0502
Sophia Wen (hfwen0502) deleted the drop-pybind11-runtime-dep branch September 16, 2026 14:25
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.

2 participants