forked from dimagi/commcare-hq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (23 loc) · 1.84 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
.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})
REQUIREMENTS_TXT_DIR=requirements
requirements: export CUSTOM_COMPILE_COMMAND=`make requirements` or `make upgrade-requirements`
requirements:
pip-compile -o $(REQUIREMENTS_TXT_DIR)/requirements.txt requirements/requirements.in --allow-unsafe
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 --allow-unsafe
pip-compile -o $(REQUIREMENTS_TXT_DIR)/dev-requirements.txt requirements/dev-requirements.in --allow-unsafe
scripts/pip-post-compile.sh $(REQUIREMENTS_TXT_DIR)/*requirements.txt
cp $(REQUIREMENTS_TXT_DIR)/*requirements.txt requirements-python3/ # TODO remove once commcare-cloud no longer depends on it
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 --allow-unsafe
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 --allow-unsafe
pip-compile --upgrade -o $(REQUIREMENTS_TXT_DIR)/dev-requirements.txt requirements/dev-requirements.in --allow-unsafe
scripts/pip-post-compile.sh $(REQUIREMENTS_TXT_DIR)/*requirements.txt
cp $(REQUIREMENTS_TXT_DIR)/*requirements.txt requirements-python3/ # TODO remove once commcare-cloud no longer depends on it
docs:
cd docs && $(MAKE) html; cd -