-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (59 loc) · 2.38 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: help install-dependencies install-dependencies-dev test lint coverage docs-test build build-test release clean clean-pyc clean-tests clean-coverage clean-build
help:
@echo ""
@echo "install-dependencies installs dependencies"
@echo "install-dependencies-dev installs dev dependencies"
@echo ""
@echo "test runs tests"
@echo "lint runs linter"
@echo "coverage runs coverage test"
@echo "docs-test tests docs for build errors and serves them locally"
@echo ""
@echo "build builds python package (sdist)"
@echo "build-test tests build for errors and uploads to test.pypi.org"
@echo "release builds and uploads python package to pypi.org"
@echo ""
@echo "clean-tests removes temp test files and folders"
@echo "clean-coverage removes coverage files"
@echo "clean-build removes packaging artifacts"
@echo "clean-pyc removes python file artifacts"
@echo "clean runs all cleaning functions"
@echo ""
install-dependencies:
python -m pip install -r requirements.txt
install-dependencies-dev:
python -m pip install -r requirements-dev.txt
test:
# python -m unittest <tests folder>
# python -m pytest tests -vv
# nose2 -s ./tests -t .
lint:
python -m pylint <project_folder_name> setup.py
coverage:
# python -m coverage run --source <project_folder_name> -m unittest <tests folder>
# python -m coverage run --source <project_folder_name> -m pytest tests -q
# python -m coverage run --source <project_folder_name> nose2 -s ./tests -t .
python -m coverage report -m
docs-test:
mkdocs serve -s -f .mkdocs.yml
build: clean-pyc clean-build
python setup.py sdist bdist_wheel
build-test:
twine check dist/*
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
release: build
twine upload dist/*
clean-tests:
rm -rf .pytest_cache/
clean-coverage:
python -m coverage erase
clean-build:
rm -rf build/
rm -rf dist/
rm -rf <project_folder_name>.egg-info/
clean-pyc:
rm -rf <project_folder_name>/__pycache__ tests/__pycache__
rm -f <project_folder_name>/*.pyc tests/*.pyc
rm -f <project_folder_name>/*.pyo tests/*.pyo
rm -f <project_folder_name>/*~ tests/*~
clean: clean-tests clean-coverage clean-build clean-pyc