mscheltienne / antio

Python package to handle I/O with the CNT format from ANT Neuro.
GNU General Public License v3.0
3 stars 4 forks source link

MAINT: Allow editable installs #23

Closed larsoner closed 2 months ago

larsoner commented 2 months ago

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:

mscheltienne commented 2 months ago

Amazing, it was very annoying to build the wheel and install it everytime I needed to test changes in the python code ahah