pybind11/tests/extra_setuptools
Antony Lee 1be0a0a610
Add helper to build in-tree extensions. (#2831)
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>
2021-07-13 17:21:55 -04:00
..
pytest.ini feat: setup.py redesign and helpers (#2433) 2020-09-16 17:13:41 -04:00
test_setuphelper.py Add helper to build in-tree extensions. (#2831) 2021-07-13 17:21:55 -04:00