forked from dimagi/commcare-hq
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
30 lines (25 loc) · 1.58 KB
/
Makefile
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
.PHONY: requirements upgrade-requirements docs
# https://stackoverflow.com/questions/4933285/how-to-detemine-python-version-in-makefile
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python --version 2>&1)))
python_version_major := $(word 1,${python_version_full})
ifeq (${python_version_major}, 2)
REQUIREMENTS_TXT_DIR=requirements
else
REQUIREMENTS_TXT_DIR=requirements-python3
endif
requirements: export CUSTOM_COMPILE_COMMAND=`make requirements` or `make upgrade-requirements`
requirements:
pip-compile -o $(REQUIREMENTS_TXT_DIR)/requirements.txt requirements/requirements.in
pip-compile -o $(REQUIREMENTS_TXT_DIR)/prod-requirements.txt requirements/prod-requirements.in --allow-unsafe
pip-compile -o $(REQUIREMENTS_TXT_DIR)/test-requirements.txt requirements/test-requirements.in
pip-compile -o $(REQUIREMENTS_TXT_DIR)/dev-requirements.txt requirements/dev-requirements.in
scripts/pip-post-compile.sh $(REQUIREMENTS_TXT_DIR)/*requirements.txt
upgrade-requirements: export CUSTOM_COMPILE_COMMAND=`make requirements` or `make upgrade-requirements`
upgrade-requirements:
pip-compile --upgrade -o $(REQUIREMENTS_TXT_DIR)/requirements.txt requirements/requirements.in
pip-compile --upgrade -o $(REQUIREMENTS_TXT_DIR)/prod-requirements.txt requirements/prod-requirements.in --allow-unsafe
pip-compile --upgrade -o $(REQUIREMENTS_TXT_DIR)/test-requirements.txt requirements/test-requirements.in
pip-compile --upgrade -o $(REQUIREMENTS_TXT_DIR)/dev-requirements.txt requirements/dev-requirements.in
scripts/pip-post-compile.sh $(REQUIREMENTS_TXT_DIR)/*requirements.txt
docs:
cd docs && $(MAKE) html