rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

refactor: optimize venv building for namespace packages

Open rickeylev opened this issue 1 month ago • 1 comments

When implicit namespace packages are used, it's common for multiple distributions to install into the same directory, triggering the expensive conflict merging logic. This can be observed wit our doc builds, where sphinxcontrib is a namespace package that 7 distributions install into.

To fix, treat top-level directories that have an importable name and don't have an __init__ looking file as implicit namespace packages and mark them as disallowed from being directly linked. The importable name check is to exclude dist-info directories.

rickeylev avatar Dec 11 '25 08:12 rickeylev