-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·123 lines (94 loc) · 3.53 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.DEFAULT_GOAL := help
.PHONY: changelog
changelog: ## Build CHANGELOG.md.
@github_changelog_generator -u adbpy -p wire-protocol
.PHONY: test-install
test-install: ## Install dependencies required for local test execution.
@pip install -q -r requirements/test.txt
.PHONY: test
test: test-install ## Run test suite.
@py.test -v --ignore tests/benchmarks tests
.PHONY: benchmark
benchmark: test-install ## Run performance suite.
@py.test -v tests/benchmarks
.PHONY: tox-install
tox-install: ## Install dependencies required for local test execution using tox.
@pip install -q -r requirements/tox.txt
.PHONY: tox
tox: tox-install ## Run test suite using tox.
@tox
.PHONY: travis-install
travis-install: ## Install dependencies for travis-ci.org integration.
@pip install -q -r requirements/travis.txt
.PHONY: travis-before-script
travis-before-script: travis-install ## Entry point for travis-ci.org 'before_script' execution.
@curl https://codecov.io/bash > ./codecov
@chmod +x ./codecov
.PHONY: travis-script
travis-script: travis-install tox ## Entry point for travis-ci.org execution.
.PHONY: travis-after-success
travis-after-success: ## Entry point for travis-ci.org 'after_success' execution.
@./codecov -e TOX_ENV
.PHONY: codeclimate
codeclimate: ## Run codeclimate analysis.
@docker run \
--interactive --tty --rm \
--env CODECLIMATE_CODE="$(shell pwd)" \
--volume "$(shell pwd)":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate analyze
.PHONY: isort
isort: ## Run isort on the package.
@isort --recursive --check-only adbwp tests
.PHONY: scan
scan: ## Run security scan against package dependencies.
@safety check
.PHONY: seclint
seclint: ## Run Python security linter 'bandit' on package.
@bandit -v -r wire-protocol
.PHONY: mypy
mypy: ## Run mypy static analysis checks on the package.
@mypy adbwp
.PHONY: pydocstyle
pydocstyle: ## Run pydocstyle on the package
@pydocstyle adbwp
.PHONY: pylint
pylint: ## Run pylint on the package.
@pylint --rcfile .pylintrc adbwp
.PHONY: lint
lint: pylint mypy seclint isort ## Run mypy, pylint, seclint, and isort targets.
.PHONY: bump-patch
bump-patch: ## Bump package patch version, e.g. 0.0.1 -> 0.0.2.
@bumpversion patch
.PHONY: bump-minor
bump-minor: ## Bump package minor version, e.g. 0.1.0 -> 0.2.0.
@bumpversion minor
.PHONY: bump-major
bump-major: ## Bump package major version, e.g. 1.0.0 -> 2.0.0.
@bumpversion major
.PHONY: git-push-with-tags
git-push-with-tags: ## Push latest changes to remote with tags.
@git push
@git push --tags
.PHONY: push-patch
push-patch: bump-patch git-push-with-tags ## Bump package patch version and push changes to remote.
.PHONY: push-minor
push-minor: bump-minor git-push-with-tags ## Bump package minor version and push changes to remote.
.PHONY: push-major
push-major: bump-major git-push-with-tags ## Bump package major version and push changes to remote.
.PHONY: clean-pyc
clean-pyc: ## Remove local python cache files.
@find . -name '__pycache__' -type d -exec rm -r {} +
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
.PHONY: docs
docs: ## Build project documentation.
@make -C docs clean html
.PHONY: readme
readme: ## Convert README.md to README.rst used for setup.py.
@pandoc --from=markdown --to=rst --output=README.rst README.md
.phony: help
help: ## Print Makefile usage.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)