Closed sodiumnitrate closed 10 months ago
Okay, I found this example by the same author, and modified it to use scikit-build
only, and not setuptools
.
Essentially:
setup.py
pyproject.toml
to something like:
[build-system]
requires = [
"scikit-build-core>=0.3.3",
"cmake>=3.14",
"ninja",
"pybind11>=2.6"
]
build-backend = "scikit_build_core.build"
[project] name = "hello-cmake-scikit" version = "0.1.0" readme = "README.md" requires-python = ">=3.10"
[project.optional-dependencies] test = ["pytest"]
and follow the instructions in the example, basically. Closing this, but feel free to reopen if I'm doing something egregiously wrong.
I'm working on a few python packages using this setup, and there is extra code/functionality on the C++ side that I don't expose to python. I'd like to be able to write unit tests, perhaps using GTEST, that I can integrate into this setup. I attempted incorporating the setup in this tutorial, but I'm unclear about a few things. The way that I understand it, a possible solution could be:
pip
, and then manually run the tests. Perhaps something like this.pybind11
explicitly withinCMakeLists.txt
. I'm not sure if this is fine.CMakeLists.txt
files that would work both withpip
andcmake
. (I'm a beginner incmake
, so I'm assuming there's a way to do this.)Can someone chime in? Am I overcomplicating things?