-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
39 lines (27 loc) · 936 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
.PHONY: docs test clean pypi env
PYTHON:=$(shell test -e env/bin/activate && echo "env/bin/python" || echo "python3")
env:
echo "Using $(shell exec $(PYTHON) --version): $(PYTHON)"
$(PYTHON) -m ensurepip
test: env lint
$(PYTHON) -m pytest src --doctest-modules -vvv
PYTHONPATH="./src/" $(PYTHON) -m pytest --cov=./src --cov-report html:htmlcov ./tests -vvv
lint:
$(PYTHON) -m pycodestyle tests
$(PYTHON) -m pycodestyle src
testcoverage: env
PYTHONPATH="./src/" $(PYTHON) -m pytest --cov=./src tests/
docs: setupdocs clean
cd docs/ && make html
setupdocs: env
$(PYTHON) -m pip install -r docs/requirements.txt
dev: env setuptools
$(PYTHON) -m pip install -e '.[test]'
clean:
cd docs/ && make clean
setuptools: env
$(PYTHON) -m pip install --upgrade setuptools wheel
pypi: env setuptools test
$(PYTHON) setup.py sdist bdist_wheel
$(PYTHON) -m pip install --user --upgrade twine
$(PYTHON) -m twine upload dist/*