-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWE of skbuild issues #616
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
…d into complex-package-mwe
I think the missing doctoring problem is due to a fix that's not in a released version yet. Can you compare with https://github.com/scikit-build/scikit-build-sample-projects ? Specifically, one of the new examples at https://github.com/scikit-build/scikit-build-sample-projects/pulls might be close? That's also where this should go, probably. If we can work on fixing one thing at a time, that would be ideal. I'm hoping (#601) to have a lot more time next year to work on an overhaul, but improving the current situation is great in the mean time! |
Using scikit-build-sample-projects makes sense. I can port this PR over there. I did take a look at the other examples, and there isn't anything that handles the case of a pure C++ library and a Cython wrapper. Looking at the PRs, there is a similar one (from me, a few months ago that I forgot about!). That one is specifically looking at the shared library issue, whereas this one is more comprehensive. I think both have merit. Obviously simple samples are good, but it's also valuable to have a more integration-test style of sample. I'm only using bdist_wheel as an example to build a wheel. Using |
@@ -21,8 +21,8 @@ run_common_module_tests(){ | |||
####################### | |||
|
|||
# First test with a regular wheel | |||
python setup.py bdist_wheel | |||
WHEEL_FPATH="$(ls dist/my_skb_mod-*.whl)" | |||
pip wheel . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use
pip wheel . | |
pipx run build --wheel |
I'm not sure exactly what to call this. The motivation is that I'm having a very difficult time getting scikit-build to work robustly for a package that has a few different things going on. The best way that I think I can explain it is to show a minimal working example of a somewhat complex scikit-build project setup, and then enumerate the issues I'm having with it. For each issue, I'm either doing something wrong, or there is a bug in scikit-build. I think there might be a mix of both cases.
My idea is that after fixing these issues in this MWE / scikit-build itself, this semi-complex, but also minimal example will be a good sample project for the test suite.
The layout of the project is
src/cxx
folder with code for a standalone C++ library. My thought is that this library should demo how to link to external dependencies like zlib or pthread (std::thread nowadays?).src/python
folder with a few things going on...I cannot figure out how to get the
setup.py
to work correctly both when building wheelspython setup.py bdist_wheel
and installing in development modepip install -e .
. Each mode of using this has its own issues. I have a root-leveldemo_issue.sh
script that provides commands to demonstrate these.A list of the issues I'm having are:
pip install -e .
installs amy_skb_mod.egg-link
that points to the wrong location when, thepackages
argument tosetup
insetup.py
contains more than one package. I think this is due to a bug in the scikit-build code in skbuild/command/egg_info. I can hack this by including a['']
, package, but skbuild also warns me not to do that.packages=['my_skb_mod']
works with editable installs, but when I build a wheel, it does not include the submodules.--no-docstring
flag.Sorry this is a bit big / not submitted as an issue first, but the actual issues I'm having seem to be fairly interconnected, so I think this is as small as I can make this project. Also, I think this will be a valuable sample for the tutorial if we can get it working. I've found that the existing samples don't really show you how to work with scikit-build in more complex real-world cases. So I'm hopping this can fill that gap.
In summary I want, a working MWE that demonstrates how to build a scikit-build project with:
src/python/<modname>
) that links to the standalone C++ module either statically or dynamically, depending on CMake flags.If there is any easy way to change this without modifying skbuild and get all of the features I want, please let me know. Also, because I do want this to be a useful scikit-build sample, I'm looking for input for:
issue-xxx-multi-package-with-package-dir
, but maybehello-complex-01
is better?