|
|
|
|
|
by throwaway892238
1214 days ago
|
|
A Makefile makes this trivial: # Makefile
all: venv frozen test
venv:
python3 -m venv install venv
frozen:
[ -e frozen.txt ] || { echo "ERROR: run 'make update-frozen'"; exit 1 ; }
./venv/bin/pip install -r frozen.txt
update-frozen: clean install-requirements freeze
freeze:
./venv/bin/pip freeze > frozen.txt
install-requirements:
[ -e requirements.txt ] || { echo "ERROR: make a requirements.txt file"; exit 1 ; }
./venv/bin/pip install -r requirements.txt
test:
./venv/bin/python3 run_tests.py
clean:
rm -rf venv
Put your package names in requirements.txt and run `make update-frozen`. To reinstall everything from frozen state, `make clean frozen`. (And replace the first space with a tab; HN is stripping my tabs out)I know Pythonistas like to use Python for everything, but there are other tools out there that will make your life much simpler. |
|