3 ms·
An easy way to use virtual environments with Make is to create a wrapper script to activate the virtual environment and run a command in its context: # ven
by cpburns2009 4y ago
An easy way to use virtual environments with Make is to create a wrapper script to activate the virtual environment and run a command in its context:
# venv.sh
venv="$1"
shift
. "$venv/bin/activate"
"$@"
Then in the Makefile I do:
VENV := venv.sh ./venv
install-reqs:
${VENV} pip -r requirements.txt
- bragr 4y agoThat works but the whole point of the article was to avoid creating extra scripts, and now you have the problem that you need to document the extra required environment setup before running make or you get opaque errors.