You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not currently possible to use importlib.resources APIs like importlib.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 a Traversable 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:
The reason is quite subtle and is a few layers down in the importlib stack, but it boils down to the fact that a Traversable is designed to represent a single node on the filesystem rather than a list of nodes.
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?
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: