Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/scikit_build_core/build/_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def libdir_to_installed(libdir: Path) -> dict[str, str]:
Convert a mapping of files to modules to a mapping of modules to installed files.
"""
return {
path_to_module(v.relative_to(libdir)): str(v.relative_to(libdir))
path_to_module(pth): str(pth)
for v in scantree(libdir)
if is_valid_module(pth := v.relative_to(libdir))
}
4 changes: 3 additions & 1 deletion src/scikit_build_core/build/_pathutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def scantree(path: Path) -> Generator[Path, None, None]:


def path_to_module(path: Path) -> str:
path = path.with_name(path.name.split(".", 1)[0])
name, _, _ = path.name.partition(".")
assert name, f"Empty name should be filtered by is_valid_module first, got {path}"
path = path.with_name(name)
if path.name == "__init__":
path = path.parent
return ".".join(path.parts)
Expand Down
3 changes: 3 additions & 0 deletions tests/packages/navigate_editable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ python_add_library(c_module MODULE src/shared_pkg/c_module.c WITH_SOABI)
set(CMakeVar "Some_value_C")
configure_file(src/shared_pkg/data/generated.txt.in
shared_pkg/data/c_generated.txt)
configure_file(src/shared_pkg/data/generated.txt.in shared_pkg/data/.hidden)

install(
TARGETS c_module
DESTINATION shared_pkg/
COMPONENT PythonModule)
install(FILES ${PROJECT_BINARY_DIR}/shared_pkg/data/c_generated.txt
DESTINATION shared_pkg/data/)
install(FILES ${PROJECT_BINARY_DIR}/shared_pkg/data/.hidden
DESTINATION shared_pkg/data/)
Loading