hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Support for extension modules in hatchling

Open segevfiner opened this issue 3 years ago • 7 comments

A common problem with the new build tools is that they don't seem to support extension modules. This is often a blocker for projects to migrate to those new tools from setuptools. It would be nice to have proper and full support for this. Along the way, stuff like building such modules using CMake instead of a custom build system (A-la scikit-build) could be helpful so that more complex extension module could be built more easily.

segevfiner avatar Nov 04 '22 07:11 segevfiner

scikit-build-core is ultimately planning on implementing a Hatch build plugin for this purpose

agoose77 avatar Dec 12 '22 11:12 agoose77

Until this issue is addressed, it would be nice for hatch new --init to warn/error if the original project uses extension modules. Would have saved me some time exploring why hatch cheerfully created a broken package.

jedbrown avatar Dec 25 '22 15:12 jedbrown

warn/error if the original project uses extension modules

Good idea, will do!

ofek avatar Dec 25 '22 16:12 ofek

Of note: there is now an experimental hatch plugin for scikit-build-core!

blink1073 avatar May 20 '24 15:05 blink1073

Scikit-build-core looks really powerful, but also really overwhelming. Is there some simple way to migrate to Hatch if using a Cython extension via setuptools.Extension given that I don't know anything about CMake?

Example: pytensor

maresb avatar Jul 21 '24 17:07 maresb

no, but that's coming by the end of the year, I'm busy currently

ofek avatar Jul 21 '24 17:07 ofek

oh you just need Cython support, yeah that already exists https://github.com/joshua-auchincloss/hatch-cython

ofek avatar Jul 21 '24 17:07 ofek