rules_python
rules_python copied to clipboard
refactor: optimize venv building for namespace packages
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.