-
Notifications
You must be signed in to change notification settings - Fork 7
/
justfile
44 lines (34 loc) · 1.03 KB
/
justfile
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
PROJECT := "make_prg"
OPEN := if os() == "macos" { "open" } else { "xdg-open" }
VERSION := `poetry version -s`
# run tests (locally)
test *FLAGS:
poetry run pytest {{FLAGS}}
# run tests with coverage and open in a browser
coverage:
poetry run pytest --cov-report html
{{ OPEN }} htmlcov/index.html
# lint code with flake8
lint:
poetry run flake8 . --extend-exclude=venv,.venv
# format code with black and isort
fmt:
poetry run black .
poetry run isort .
install:
poetry install
install-ci:
poetry install --no-interaction
# check code formatting with black and isort
check-fmt:
poetry run black --check .
poetry run isort --check-only .
# recipes to run before commiting: format, lint, and test
precommit: fmt lint test
# build a python release
build:
poetry build --no-interaction
# prints out the commands to run to tag the release and push it
tag:
@echo "Run \`git tag -a {{ VERSION }} -m <message>\` to tag the release"
@echo "Then run \`git push origin {{ VERSION }}\` to push the tag"