-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (37 loc) · 1.37 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
.DEFAULT_GOAL := help
.PHONY: ci clean build build-local format help init install install-local release-test test test-cov
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":[^#]*?## "}; {printf "\033[36m%-50s\033[0m %s\n", $$1, $$2}'
ci: lint test ## Run local ci
clean: ## Remove all Python combile files
find . -name '*.pyc' -delete
rm -rf build *.egg-info
pipenv clean
build: ## Build distribution
python3 -m build
build-local: ## Create local distribution
python3 setup.py sdist
format: ## Format code using isort and black
pipenv run black src/ tests/
pipenv run isort src/ test/
init: ## Initialize project
pipenv run pre-commit install -t pre-commit
pipenv run pre-commit install -t pre-push
install: ## Install dependencies
pipenv install --dev .
install-local: ## Install a local setup.py into your virtual environment
pipenv install -e .
lint: ## Lint all Python files
pipenv run rstcheck **/*.rst
pipenv run flake8 src/ tests/
pipenv run mypy src/ tests/
release: ## Release to pypi
python3 -m twine upload dist/*
release-test: ## Release to testpypi
python3 -m twine upload --repository testpypi dist/*
test: ## Run tests
pipenv run pytest
test-cov: ## Run test coverage
@rm -rf htmlcov/
pipenv run pytest --cov --cov-report term --cov-report html:./htmlcov --cov-fail-under=50
# vim: noexpandtab