-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
74 lines (58 loc) · 2.12 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
.PHONY: clean clean-test clean-pyc clean-build
bold := $(shell tput bold)
rsttxt := $(shell tput sgr0)
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
@printf '$(bold)Cleaning Artifacts...\n$(rsttxt)'
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr pip-wheel-metadata/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
- rm -fr .tox/
- rm -f .coverage
- rm -fr htmlcov/
find . -name '.pytest_cache' -exec rm -fr {} +
- rm -f .testmondata
- rm -rf .tmontmp
- rm cov.xml test_log.xml
test: ## run tests quickly with the default Python
pytest
watch-build: clean ## build pytest-testmon db
pytest --testmon -c pyproject.toml
watch: clean ## watch tests
- pytest --testmon
ptw --spool 2000 --onpass "make watch-cov" --clear -- --testmon -vv -c pyproject.toml
watch-cov: ## watch test coverage
pytest -n'auto' --forked --cov --cov-append --cov-config=pyproject.toml --cov-report=xml:cov.xml --cov-report term
coverage: ## generate coverage
pytest -n'auto' --cov --cov-config=pyproject.toml
coverage-html: ## generate coverage html
pytest -n'auto' --cov --cov-config=pyproject.toml --cov-report html
gendoc: ## Generate Docs
$(MAKE) -C docs clean
$(MAKE) -C docs html
@printf '$(bold)Docs Generated!\n$(rsttxt)'
test-release: dist ## release on pypi-test repo
@printf '$(bold)Uploading Test Release to TestPyPi...\n$(rsttxt)'
poetry publish -r test
@printf '$(bold)Test Released published!\n$(rsttxt)'
release: dist ## package and release
@printf '$(bold)Uploading package to PyPi...\n$(rsttxt)'
poetry publish
git push --tags
@printf '$(bold)Done! Tags Pushed!\n$(rsttxt)'
dist: clean ## builds package
@printf '$(bold)Building Source and Wheel...\n$(rsttxt)'
- rm README.rst
poetry build
ls -l dist
install: clean ## install pkg
python setup.py install