python-wheel-build / fromager

Build your own wheels
https://fromager.readthedocs.io/en/latest/
Apache License 2.0
4 stars 9 forks source link

Automatically patch out cmake from pyproject.toml #274

Closed tiran closed 4 days ago

tiran commented 1 month ago

Several Python dist packages have a dependency on cmake PyPI package. The PyPI package is a convenient provider for cmake, so users don't have to install the toot locally. Fromager assumes that the package is installed in build environments

Affected packages with cmake:

It should be easy to automatically detect and remove the dependency. We have to use https://tomlkit.readthedocs.io/ to preserve style and comments in pyproject.toml.

dhellmann commented 1 month ago

Several Python dist packages have a dependency on cmake PyPI package. The PyPI package is a convenient provider for cmake, so users don't have to install the toot locally. Fromager assumes that the package is installed in build environments

We're making that assumption downstream. I don't know that I'd say all fromager users will want to make the same assumption.

I could see us making it easier to do this automatically, even to the point of having it expressed via the config file. I'm not sure we want to always enforce it.

dhellmann commented 2 weeks ago

Maybe the way to approach this is to have a hook that is run as part of preparing the source tree, and then the logic for deciding whether to patch and how could be in the hook. We could publish a hook upstream, but it wouldn't have to be part of the core.