For single-file extensions, a convenient pattern offered by cython
is to place the source files directly in the python source tree
(`foo/__init__.py`, `foo/ext.pyx`), deriving the package names from
their filesystem location. Adapt this pattern for pybind11, using an
`intree_extensions` helper, which should be thought of as the moral
equivalent to `cythonize`.
Differences with cythonize: I chose not to include globbing support
(`intree_extensions(glob.glob("**/*.cpp"))` seems sufficient), nor to
provide extension-customization kwargs (directly setting the attributes
on the resulting Pybind11Extension objects seems sufficient).
We could choose to have `intree_extension` (singular instead) and make
users write `[*map(intree_extension, glob.glob("**/*.cpp"))]`; no strong
opinion here.
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| _static | Loading commit data... | |
| advanced | Loading commit data... | |
| cmake | Loading commit data... | |
| Doxyfile | Loading commit data... | |
| Makefile | Loading commit data... | |
| basics.rst | Loading commit data... | |
| benchmark.py | Loading commit data... | |
| benchmark.rst | Loading commit data... | |
| changelog.rst | Loading commit data... | |
| classes.rst | Loading commit data... | |
| compiling.rst | Loading commit data... | |
| conf.py | Loading commit data... | |
| faq.rst | Loading commit data... | |
| index.rst | Loading commit data... | |
| installing.rst | Loading commit data... | |
| limitations.rst | Loading commit data... | |
| pybind11-logo.png | Loading commit data... | |
| pybind11_vs_boost_python1.png | Loading commit data... | |
| pybind11_vs_boost_python1.svg | Loading commit data... | |
| pybind11_vs_boost_python2.png | Loading commit data... | |
| pybind11_vs_boost_python2.svg | Loading commit data... | |
| reference.rst | Loading commit data... | |
| release.rst | Loading commit data... | |
| requirements.txt | Loading commit data... | |
| upgrade.rst | Loading commit data... |