Closed eirrgang closed 4 years ago
There are actually two possible scenarios:
So far, I've done the former, but not the latter.
@eirrgang do you have example projects that build with scikit-build that we could propose here (or in a fork) as a modern install way? The first scenario is probably preferred by me. I tried to explore a transition myself a few months back but did not succeed yet: https://github.com/openPMD/openPMD-api/pull/585
Here is a package embedded in another project that can be built
setup.py
.It is a bit over-complicated as an example, and uses a pattern that I don't like: It requires some configuration information to be provided through an environment variable that should instead be an optional CMake option provided at the end of the pip
or setup.py
command line.
It also adopts PEP 517/518, which I don't know is appropriate here.
But if this looks like a superset of a useful example, I can create a simpler version.
Thanks, I think PEP 517 is the future anyway, so don't feel we need to stop there.
This exists now: https://github.com/pybind/scikit_build_example
I tried to make a project depend on the Pypi cmake package to try to help a pip install with this template work more concisely, but there are headaches and incompatibilities if scikit-build is not brought up-to-date in a separate command before using this setup.py file. But it looks like using sk-build directly would simplify this setup.py file, but complicate the CMakeLists.txt. I'm trying it out in my project and I figure I'll share a minimal example from the results.
Should I issue a PR to this project proposing a setup.py in terms of skbuild? Or is there a reason that skbuild is not appropriate in this setup.py and should maybe be a separate example in the pybind ecosystem?