/
Makefile
44 lines (34 loc) · 888 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
43
44
# vim:ft=make:
_PYTHON_VERSION=3.6.6
all: test
isPYENV:
@echo --- entering $@
@test -n "${PYENV_SHELL}" || echo 'eval "$$(pyenv init -)"'
@test -n "${PYENV_SHELL}"
isValid:
@echo --- entering $@
poetry check
env: isPYENV isValid
@echo --- entering $@
@pyenv install ${_PYTHON_VERSION} -s
@pyenv local ${_PYTHON_VERSION}
@poetry install
clean: vdir=$(shell poetry debug:info | grep Path | cut -d: -f2- | sed -e 's/^ *//')
clean: clean_build
@echo --- entering $@
@-[ -n "${vdir}" ] && rm -rf ${vdir}
@-rm -rf dist/ .python_version
clean_build:
@echo --- entering $@
@-find . -type d -name __pycache__ | xargs rm -rf
@-rm -rf *.egg-info/ build/ .pytest_cache/
test: isValid clean env
@echo --- entering $@
poetry run py.test
build: isValid test
@echo --- entering $@
poetry build
make clean_build
upload: isValid build
@echo --- entering $@
poetry publish