-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (55 loc) · 1.51 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
ifeq (, $(shell which python3))
$(error "No python3 on PATH.")
endif
define HELP
Usage:
make help show available commands
make clean remove generated files
make setup create the virtualenv
make install install dependencies
make shell start a python shell
make test run unit tests
make coverage run test coverage checks
make lint run lint inspections
make format format the source code
make build build & package the library
make publish release to pypi.org
endef
export HELP
.PHONY: docs venv
help:
@echo "$$HELP"
venv:
ifeq (, $(VIRTUAL_ENV))
$(error "Virtualenv not activated.")
endif
clean:
rm -rf .egg *.egg-info build dist
find . -type d -name ".pytest_cache" -exec rm -rf "{}" +;
find . -type d -name "__pycache__" -exec rm -rf "{}" +;
setup: clean
pip install --upgrade virtualenv
virtualenv -p python3 venv
install: venv
pip install -r requirements.txt
pre-commit install
shell: venv
ipython
test: venv
python -m pytest --capture=no
coverage: venv
python -m pytest --cov=py_querybuilder
lint: venv
flake8 py_querybuilder tests
format: venv
black py_querybuilder tests
docs: venv
rm -rf docs
cd sphinx && make html
touch docs/.nojekyll
build: clean test lint
python setup.py bdist_wheel
build-zip: build
python setup.py sdist --formats=gztar,zip
publish: build
twine upload dist/*