Skip to content

fix(inspect): ignore non-package top-level dirs in sdist site_paths - #372

Merged
jvolkman merged 1 commit into
mainfrom
fix/inspect-sdist-non-package-dirs
Oct 18, 2026
Merged

jvolkman merged 1 commit into
mainfrom
fix/inspect-sdist-non-package-dirs

Conversation

@jvolkman

Copy link
Copy Markdown
Owner

Summary

After #364 (840b79e), _resolve_top_level_paths keeps every file in namespace directories (so data files in wheels like PyQt5-Qt5's PyQt5/Qt5/qml/** are linked in venvs). However, sdist inspection feeds _resolve_top_level_paths every top-level directory in the sdist, causing non-package top-level directories without any Python modules (such as .github/, requirements/, or licenses/) to resolve to file lists and create dangling symlinks under venvs_site_packages=yes.

Filter top_level_dirs in _find_site_paths_from_items (sdist path only) to valid Python identifiers that contain at least one Python module (_extract_module_name) at any depth. Both top_level.txt and wheel inspection (_find_wheel_paths) remain unchanged, and data files inside sdist namespace directories that also contain Python modules are still preserved.

Test Plan

  • Added unit tests in tests/unit/inspect_package_test.py (test_sdist_ignores_non_package_top_level_dirs and test_sdist_namespace_keeps_data_files_when_python_present).
  • Verified tests/e2e/requirements (packaging-23.2 sdist site_paths returns ["noxfile.py", "packaging", "tasks"]) and tests/e2e/namespace_pkgs.

@jvolkman
jvolkman merged commit 532a8bf into main Oct 18, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant