forked from hvac/hvac
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (28 loc) · 964 Bytes
/
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
31
32
33
34
35
PYTHON_IMAGE ?= wpengine/python
REQUIREMENTS_FILES := requirements requirements-dev
.PHONY: clean package publish test update-all-requirements $(addsuffix .txt, $(REQUIREMENTS_FILES)) docs/requirements.txt
test:
pytest --cov=hvac tests/
clean:
rm -rf dist hvac.egg-info
distclean: clean
rm -rf build
package:
python setup.py sdist bdist_wheel
# Note, we breakout the docs/requirements target separately since its not reasonable to use filesystem paths in target names
update-all-requirements: $(addprefix update-, $(REQUIREMENTS_FILES)) update-docs-requirements
update-docs-requirements:
$(call pip-compile,docs/requirements)
update-%:
$(call pip-compile,$(*))
define pip-compile
@echo
# Running pip-compile to update $(1).txt (using $(1).in)...
@docker run \
--rm \
--volume $(PWD):/workspace \
${PYTHON_IMAGE} \
pip-compile --upgrade --output-file $(1).txt $(1).in
@echo
# Successfully compiled python $(1).txt (using $(1).in).
endef