-
Notifications
You must be signed in to change notification settings - Fork 4
/
dev.mk
38 lines (36 loc) · 1.02 KB
/
dev.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Initialize the development environment, e.g. the Python dependencies
init: venv dev-requirements.txt
source venv/bin/activate && \
pip-sync \
--quiet \
dev-requirements.txt
source venv/bin/activate && \
pre-commit install
# Make sure the virtualenv exists
venv:
$(PYTHON_EXEC) -m venv venv
source venv/bin/activate && \
pip install --quiet --upgrade pip
source venv/bin/activate && \
pip install --quiet pip-tools
update_requirements:
# Remove the virtualenv and the requirements lock files
rm -rf venv requirements.txt dev-requirements.txt
# Recrete the virtualenv
$(MAKE) venv
# Generate the lock file for production requirements
source venv/bin/activate && \
pip-compile \
--quiet \
--generate-hashes \
--output-file requirements.txt
# Generate the lock file for development requirements
source venv/bin/activate && \
pip-compile \
--quiet \
--generate-hashes \
--output-file dev-requirements.txt \
setup.py \
dev-requirements.in
# Install all the requirements in the virtualenv
$(MAKE) init