Closed kylebarron closed 7 months ago
It looks like even when you include extra files (by creating a MANIFEST.in
file with
include project.ini
and including VersionSource.cmake
), it still doesn't work because it isn't able to find all the cmake conf files.
As more context, I generally prefer python -m build
to pip install
because the latter installs all build dependencies in your current environment.
Possibly the more important part is that no one can build from your sdist
because it doesn't include the cmake files. E.g.
python -m build . --sdist
pip install ./dist/exactextract-0.2.0.dev0.tar.gz
gives
CMake Warning:
Ignoring extra path from command line:
"/private/var/folders/42/5jr6891d4ds4xysz7q0rsghw0000gn/T"
CMake Error: The source directory "/private/var/folders/42/5jr6891d4ds4xysz7q0rsghw0000gn/T" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Yes, I think I'm causing all manner of problems by having setup.py
and friends in the python
dir, rather than at the root of the repo. I've been intending to check out solutions like https://github.com/maximiliank/cmake_python_r_example. Alternatively I could put the Python bindings in a separate repo, but that'll be easier once it settles down a bit more.
I don't much C++ work at all myself, but I would point you to https://learn.scientific-python.org/development/guides/packaging-compiled/#packaging-compiled-projects and https://github.com/pybind/cmake_example
Thank you @kylebarron for the analysis and the suggestion to revisit scikit-build-core
.
should work, but doesn't. The issue is that
python -m build
creates an isolated venv that is not in-tree for building.You can also see this issue if you run
which creates an sdist that does not include
project.ini
, and so you can't build from that sdist becausesetup.py
expects to find that config file.