-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
42 lines (29 loc) · 902 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
36
37
38
39
40
41
42
.PHONY: venv-local venv-pip-upgrade clean \
venv-upgrade-build venv-pytest test build \
venv-poetry poetry venv
PIP3=venv/bin/pip3
PY3=venv/bin/python3
POETRY=venv/bin/poetry
all: build
venv-local:
@test -d venv || python3 -m venv venv
venv-pip-upgrade: venv-local
@$(PIP3) install --upgrade pip 2> /dev/null
venv/req-install.log: requirements.txt venv-pip-upgrade
@$(PY3) -c "import pkg_resources; pkg_resources.require(open('requirements.txt',mode='r'))" 2> /dev/null \
|| (echo "installing"; $(PIP3) install -r $< --log $@)
venv: venv/req-install.log
@. venv/bin/activate
clean:
rm -rf venv
find . -iname "*.pyc" -delete
venv-poetry: venv
@$(PY3) -m pip install --upgrade poetry 2> /dev/null
build: venv-poetry
@$(POETRY) build
publish: build
@$(POETRY) publish
venv-pytest: venv
@$(PY3) -m pip install --upgrade pytest &> /dev/null
testall: venv
@$(PY3) -m pytest tests/