forked from ealcobaca/pymfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (50 loc) · 1.99 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
PACKAGE := pymfe
TEST_NCORES := auto
all: clean install-dev code-check test-cov
.PHONY: all clean test test-cov code-check pypi install install-dev html help h t c cl
clean: ## Clean all undesired files such as .so, .pyc, build files and etc.
find . -name "*.so" -o -name "*.pyc" -o -name "*.md5" -o -name "*.pyd" -o -name "*~" | xargs rm -f
rm -rf .coverage.*
rm -rf dist
rm -rf build
rm -rf docs/_build
rm -rf docs/source/generated
rm -rf docs/source/auto_examples
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf pymfe.egg-info/
cd docs ; make clean_all
cl: clean ## Shortcut to clean
test: ## Execute the code test using pytest.
pytest -n $(TEST_NCORES) tests/
test-cov: ## Execute the code test using pytest and measuring the coverage.
rm -rf coverage .coverage
pytest -n $(TEST_NCORES) --cov=$(PACKAGE)/ tests/
t: test-cov ## Shortcut to test-cov
code-check: ## Execute the code check with flake8, pylint, mypy.
flake8 $(PACKAGE)
pylint $(PACKAGE) -j 0 -d 'C0103, R0913, R0902, R0914, C0302, R0904, R0801, E1101, C0330, E1136'
mypy $(PACKAGE) --ignore-missing-imports
type-check: ## Execute the code check with mypy only.
mypy $(PACKAGE) --ignore-missing-imports
c: code-check # Shortcut to code-check
pypi: clean ## Send the package to pypi.
pip install -U twine wheel
python3 setup.py sdist bdist_wheel
twine upload dist/*
install-dev: ## Install pymfe for developers using pip.
pip install -U -e .
pip install -U -r requirements.txt
pip install -U -r requirements-dev.txt
pip install -U -r requirements-docs.txt
install: ## Install the package using pip.
pip install .
html: ## Create the online documentation.
cd docs; make html
help: ## List target command description.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
h: help ## Shortcut to help
format: ## format all the package using black
@black --line-length 79 pymfe/
@black --line-length 79 tests/
@black --line-length 79 docs/