Problems understanding proper build configuration

Skip to first unread message

Michael A

Aug 4, 2021, 12:10:31 PM8/4/21
to scikit-build
Hi all,

I could need some help understanding the build process with regards to the configuration of package_dir etc.

In my project ( I have a mostly pure python package stratego, which I would like to augment via an internal _core CPP extension.

my structure for the package is the typical src layout:

I am using the proposed pyproject.toml from the scikit-build docs to build the extension. Metadata is mostly held in a setup.cfg. This leads to my first question:
1) pip install seems to ignore the entries

packages = find:

in the setup.cfg. I specifically need to state them in the

package_dir={"": "src"},

(not just cmake_install_dir is ignored in the setup cfg, in case this might be an unsupported entry). By `ignored`, I mean that the install fails if they are not specified in the, but in the setup cfg instead.

My other questions relate to the pip install process difference for editable and normal install. I have added the following line in my CMakeLists.txt:


This should install the _core library so as to be loaded by the submodule core at src/stratego/core/ from _core import ...

2) The problem with this setup is: pip install -e .  never installs the library in the package path. It stays in the _skbuild folder and that's it. How should the install path be adjusted to ensure correct installation?

3) If I set packages=find_packages(where="src") then the normal install works and my package is installed via pip with all package files and the extension in the right folder. However, in this case the editable install fails as the egg-link points to ~/GitHubFolder/Stratego instead of ~/GitHubFolder/Stratego/src.
If I change the setup to packages=find_packages(), then the editable install points to the correct path (src) but the normal install fails. Can someone point out where I am going wrong with the package setup?

I hope my questions are somewhat understandable. I would appreciate the help, since I am hardstuck here at a proper setup for an extension within a python project. Thank you!

Reply all
Reply to author
0 new messages