forked from whylabs/whylabs-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (44 loc) · 1.79 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
NAME=
PY_SOURCE=$(shell find whylabs_toolkit/ -type f -name "*.py")
SHA=$(shell git rev-parse HEAD)
VERSION=$(SHA)
REQUIREMENTS=requirements.txt
SRC_DIR=./whylabs_toolkit/
.PHONY: default
.PHONY: lint format format-fix test setup help requirements
default:help
requirements: requirements.txt
requirements.txt: pyproject.toml
poetry export -f requirements.txt > requirements.txt
lint:
poetry run mypy ${SRC_DIR} --config-file=mypy.ini
format:
poetry run black --check --line-length 120 ${SRC_DIR}
poetry run autoflake --check --in-place --remove-unused-variables $(PY_SOURCE)
bump-patch: ## Bump the patch version (_._.X) everywhere it appears in the project
@$(call i, Bumping the patch number)
poetry run bumpversion patch --allow-dirty
bump-minor: ## Bump the minor version (_.X._) everywhere it appears in the project
@$(call i, Bumping the minor number)
poetry run bumpversion minor --allow-dirty
bump-major: ## Bump the major version (X._._) everywhere it appears in the project
@$(call i, Bumping the major number)
poetry run bumpversion major --allow-dirty
bump-release: ## Convert the version into a release variant (_._._) everywhere it appears in the project
@$(call i, Removing the dev build suffix)
poetry run bumpversion release --allow-dirty
bump-build: ## Bump the build number (_._._-____XX) everywhere it appears in the project
@$(call i, Bumping the build number)
poetry run bumpversion build --allow-dirty
format-fix:
poetry run black --line-length 120 ${SRC_DIR}
poetry run autoflake --in-place --remove-unused-variables $(PY_SOURCE)
setup:
poetry install
test:
poetry run pytest
help: ## Show this help message.
@echo 'usage: make [target] ...'
@echo
@echo 'targets:'
@egrep '^(.+)\:(.*) ##\ (.+)' ${MAKEFILE_LIST} | sed -s 's/:\(.*\)##/: ##/' | column -t -c 2 -s ':#'