casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
17.61k stars 399 forks source link

Just activate venv (Python) #2000

Closed caldempsey closed 1 month ago

caldempsey commented 1 month ago

Hi!

I love Just! I'd like to activate a virtual environment through Just. Is there a way to just activate venv? I've tried this, it doesn't work (probably due to the shell subprocess):

activate-venv:
    . venv/bin/activate

Let me know!

laniakea64 commented 1 month ago

It's not really possible, the closest you can get would be something like https://github.com/casey/just/issues/1957#issuecomment-1992000723

casey commented 1 month ago

Yah, the issue is that venv sets shell variables, and a subprocess, like just, can't set shell variables.