-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
53 lines (40 loc) · 1.26 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: help prepare-dev test lint release release-test
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3
help:
@echo "make prepare-dev"
@echo " prepare development environment, use only once"
@echo "make test"
@echo " run tests"
@echo "make lint"
@echo " run pylint and mypy"
prepare-dev:
sudo apt-get -y install python3 python3-pip
python3 -m pip install virtualenv
make venv
venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate: setup.py
test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
${PYTHON} -m pip install -U pip
${PYTHON} -m pip install -r requirements.txt
touch $(VENV_NAME)/bin/activate
test: venv
${PYTHON} -m pytest -v
release:
rm -rf ./dist/*
${PYTHON} -m pip install --upgrade setuptools wheel
${PYTHON} -m pip install --upgrade twine
${PYTHON} setup.py sdist bdist_wheel
${PYTHON} -m twine check dist/*
${PYTHON} -m twine upload dist/*
release-test:
rm -rf ./dist/*
${PYTHON} -m pip install --upgrade setuptools wheel
${PYTHON} -m pip install --upgrade twine
${PYTHON} setup.py sdist bdist_wheel
${PYTHON} -m twine check dist/*
${PYTHON} -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
lint: venv
${PYTHON} -m pylint
${PYTHON} -m mypy