pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
5.86k stars 292 forks source link

Support for extension modules in hatchling #591

Open segevfiner opened 1 year ago

segevfiner commented 1 year ago

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.

agoose77 commented 1 year ago

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

jedbrown commented 1 year ago

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.

ofek commented 1 year ago

warn/error if the original project uses extension modules

Good idea, will do!

blink1073 commented 3 months ago

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

maresb commented 1 month ago

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

ofek commented 1 month ago

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

ofek commented 1 month ago

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