-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (23 loc) · 757 Bytes
/
Makefile
File metadata and controls
28 lines (23 loc) · 757 Bytes
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
PROJECT=nornir_http
CODE_DIRS=${PROJECT} tests
# Run pytest
.PHONY: pytest
pytest:
poetry run pytest -vs ${ARGS}
# Check if the python code needs to be reformatted
.PHONY: black
black:
poetry run black --check ${CODE_DIRS}
# Python type check
.PHONY: mypy
mypy:
poetry run mypy ${CODE_DIRS}
# Runn pytest, black and mypy
.PHONY: tests
tests: pytest black mypy
# use "make bump ARGS=patch" to bump the version. ARGS can be patch, minor or major.
.PHONY: bump
bump:
poetry version ${ARGS}
sed -i -E "s|\"\b[0-9]+.\b[0-9]+.\b[0-9]+\" # From Makefile|\"`poetry version -s`\" # From Makefile|g" ${PROJECT}/__init__.py
sed -i -E "s|\"\b[0-9]+.\b[0-9]+.\b[0-9]+\" # From Makefile|\"`poetry version -s`\" # From Makefile|g" tests/test_${PROJECT}.py