In our Evergreen file, we create virtual env every at different places. The way we have things written now, we may create multiple virtual env because of the following pattern:
- name: many-collection-test
commands:
- func: "compile mongodb" -> Creates a virtual env
- command: shell.exec
params:
working_dir: mongo-tests/largescale
shell: bash
script: |
set -o errexit
set -o verbose
${PREPARE_PATH}
virtualenv -p python3 venv -> Creates another virtual env
source venv/bin/activate
It would be better to have a function to create a virtual env and every subsequent step would benefit from it.