scikit-build / cmake-python-distributions

This project provides the infrastructure to build CMake Python wheels.
https://cmake-python-distributions.readthedocs.io
Apache License 2.0
111 stars 34 forks source link

building wheel from source introduces a circular dependency on cmake #506

Closed dhellmann closed 2 months ago

dhellmann commented 2 months ago

When I run pip wheel to create a wheel from the source distribution, pip wants to install a cmake package.

This was previously reported as #479 with an earlier fix in #480 based on the change in scikit-build-core at https://github.com/scikit-build/scikit-build-core/commit/c67339b4493e1df4a5ff10d92a72cc362db18d0e

The scikit-build-core code at https://github.com/scikit-build/scikit-build-core/blob/main/src/scikit_build_core/build/__init__.py#L126 looks for requires.settings.wheel.cmake which translates in the pyproject.toml file to needing

[tool.scikit-build]
wheel.cmake=false

To ensure cmake is not needed for building sdists, we should also add

[tool.scikit-build]
sdist.cmake=false

The previous change added

[tool.scikit-build]
cmake.version = ""  # We are cmake, so don't request cmake

but that location isn't being checked.

henryiii commented 2 months ago

pip wants to install a cmake package

This should not happen if you have an empty cmake.version. That sounds like a potential bug? We do need cmake (CLI) on the PATH.

dhellmann commented 2 months ago

OK, I can't find why, but I get different results for python 3.10 and 3.11, even for the same versions of pyproject_hooks and scikit-build-core. I think this is an issue in some other part of the tool chain, so I'll close this out and look for another way to work around it.

Sorry for the noise, and thanks for the quick response!