aspect-build / rules_py

More compatible Bazel rules for running Python tools and building Python projects
Apache License 2.0
73 stars 22 forks source link

[FR]: include (de)activation scripts in venvs #344

Open tnielens opened 2 months ago

tnielens commented 2 months ago

What is the current behavior?

I've a repository with multiple python distribution packages. I have this rule at the root of my repo meant to create a venv for use by my IDE:

py_venv(
    name = "venv",
    deps = [ 
        ...
    ]
)

The venv produced by rules_py does not include (de)activation scripts. I'm using version 0.7.3 of the rules.

Describe the feature

Add activate/deactivate scripts in the venv as per regular venv creation.

mattem commented 1 month ago

They are somewhat intentionally left out, as it adds extra maintenance overhead for each shell that needs its own activation script.

"activate" doesn't really do anything apart from put the interpreter first on the PATH, you can call the interpreter directly in the bin folder and it'll do the right thing without needing any "activation".

I can see how it could be useful however if other applications expect the just run "python", I'll see how much overhead this really adds.