fix: make imports attribute target-relative for venv mode by rickeylev · Pull Request #3572 · bazel-contrib/rules_python

@rickeylev

@rickeylev

gemini-code-assist[bot]

Merged via the queue into bazel-contrib:main with commit 708b07b

Feb 8, 2026

4 checks passed

aignas pushed a commit to aignas/rules_python that referenced this pull request

Feb 23, 2026
…rib#3572)

The `imports` attribute is treated as target-relative in non-venv mode,
but venv-mode
was passing the value through without the target-relative processing.
This went unnoticed
because the main use case, pypi packages, are a the repo root, so target
and repo
relative paths are the same.

To fix, use join the input value to the target's path, as done in the
non-venv
`get_imports()` function.

Fixes bazel-contrib#3565