-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathMakefile
58 lines (41 loc) · 1.3 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
.DEFAULT_GOAL := help
PYTHON ?= $(shell which python)
.PHONY: help
help: ## Prints help for available target rule
$(info Available target rules:)
@echo
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: clean-pyc
clean-pyc:
$(info Cleaning Python files..)
@find . -iname '*.py[co]' -delete
@find . -iname '__pycache__' -delete
@find . -iname '.coverage' -delete
@rm -rf htmlcov/
.PHONY: clean-dist
clean-dist:
$(info Cleaning Python distribution files..)
@rm -rf dist/
@rm -rf build/
@rm -rf *.egg-info
.PHONY: clean
clean: clean-pyc clean-dist ## Cleans project building and caching files
.PHONY: test
test: ## Runs project tests using Pytest
$(info Running project tests..)
py.test -vvv --cov=simple_rest_client tests
.PHONY: dist
dist: clean
$(info Building Python distribution..)
$(PYTHON) setup.py sdist
$(PYTHON) setup.py bdist_wheel
.PHONY: release
release: dist ## Generates a new project release
$(info Generating a new project release..)
git tag `python setup.py -q version`
git push origin `python setup.py -q version`
twine upload dist/*
.PHONY: lint
lint: ## Runs Python lint on the source code
$(info Running lint against project..)
SKIP=no-commit-to-branch pre-commit run -a -v