Configuring a runner with virtualenv

runner
python
bash
virtualenv

#1

I currently use a simple terminal to run a server in a Python virtual environment. This command is only available inside this virtual environment after sourcing the activate file.

I am trying to create a runner to run this server, but I am not sure how to make it source the file before running the command. Is there a way to do this?

Thanks in advance.


#2

This should be possible by just using a runner with && inside the “cmd” section:

{
  "cmd": [
    "source",
    "./activate",
    "&&",
    "commandHere",
    "--withFlag"
  ],
  ... Rest of configuration ...
}

This is not tested, but based on my understanding of runners, it should work.