Skip to content

User site-packages directory should be ignored #1059

@siddharthab

Description

@siddharthab

🚀 feature request

Relevant Rules

py_{library,binary,test}

Description

When running builds and tests, the user site-packages directory is not ignored, which makes the build less hermetic.

Describe the solution you'd like

The registered toolchains could set an env var `PYTHONNOUSERSITE=1` every time they are run. This env var is already set for gazelle runs. More generally, the toolchains could also allow the user to set other environment variables for the toolchain.

Describe alternatives you've considered

I have currently set `--action_env= PYTHONNOUSERSITE=1` to all bazel build steps, but it is less clean because actions that have nothing to do with Python don't need this env var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can Close?Will close in 30 days if there is no new activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions