-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (64 loc) · 2.34 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
77
78
79
80
81
.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 -ra
watch-build: clean ## build pytest-testmon db
pytest --testmon -c setup.cfg
watch: clean ## watch tests
- pytest --testmon
ptw --spool 2000 --onpass "make watch-cov" --clear -- --testmon -vv -c setup.cfg
watch-cov: ## watch test coverage
pytest -n'auto' --cov --cov-append --cov-config=setup.cfg --cov-report=xml:cov.xml --cov-report term
coverage: ## generate coverage
pytest -n'auto' --cov --cov-config=setup.cfg
coverage-html: ## generate coverage html
pytest -n'auto' --cov --cov-config=setup.cfg --cov-report html
codestyle: ## cleanup code
@printf '$(bold)Cleaning Code...\n$(rsttxt)'
- autoflake -r --remove-all-unused-imports --exclude "./threeframe/lib/**/*" --in-place ./threedframe
- black .
- isort .
- docformatter -r threedframe -i --blank
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