I was surprised pip install --no-build-isolation -ve . didn't work because this is how I install everything in my dev env nowadays. This PR should make it work. Works on my machine :tm: To make sure it continues to work I added a CI run for it.
The "trick" is to subclass Extension as CMakeExtension which is a no-op, then use ext_modules as usual rather than distclass. This causes setuptools to properly recognize that there is an extension being built that it should include in the right place.
Also had to nest one import to avoid a circular import problem, no idea why it's not present on main but shouldn't hurt anything :shrug:
I was surprised
pip install --no-build-isolation -ve .
didn't work because this is how I install everything in my dev env nowadays. This PR should make it work. Works on my machine :tm: To make sure it continues to work I added a CI run for it.The "trick" is to subclass
Extension
asCMakeExtension
which is a no-op, then useext_modules
as usual rather thandistclass
. This causes setuptools to properly recognize that there is an extension being built that it should include in the right place.Also had to nest one import to avoid a circular import problem, no idea why it's not present on
main
but shouldn't hurt anything :shrug: