-
Notifications
You must be signed in to change notification settings - Fork 61
Editable installs do not support traversing files in the build #807
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
Comments
There are multipath traversable if you point it to a directory-like path. Last time I've checked scikit-build-core managed to expand to those. Can you share a minimum example to work with, preferably basic with only library, files and python source. What is not supported is navigating non-library files. Or did that change recently? |
Yes, I am about to put up a PR with an example. |
This PR adds tests (including some xfailed ones) demonstrated patterns of package/subpackage access via import and importlib that are expected to work correctly for both normal and editable installs. Related to #807. --------- Signed-off-by: Cristian Le <[email protected]> Co-authored-by: Cristian Le <[email protected]>
It is not currently possible to use
importlib.resources
APIs likeimportlib.resources.files
to access all of the files in an editable install using redirect-based editable installs. Files in the source directory (i.e. Python source files) are discoverable, but files in the build directory (i.e. CMake-generated files) are not. The reason is quite subtle and is a few layers down in the importlib stack, but it boils down to the fact that aTraversable
is designed to represent a single node on the filesystem rather than a list of nodes.Inplace editable installs also seem to fail here, but I have not checked why that is the case yet.
I will open a PR with a failing test as well as a demonstration of where I would expect to be able to fix this is if it were possible. I suspect that there is not easy way to solve this without modifications in CPython's
importlib
definitions.The text was updated successfully, but these errors were encountered: