-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
43 lines (34 loc) · 1.09 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
PROJECT := "pypolca"
OPEN := if os() == "macos" { "open" } else { "xdg-open" }
VERSION := `poetry version | rg -o '\d+\.\d+\.\d+'`
# format code with black and isort
fmt:
poetry run black .
poetry run isort .
# check format of code with black and isort
check-fmt:
poetry run black --check .
poetry run isort --check .
# lint code with flake8
lint:
poetry run flake8 .
# install latest version with poetry
install:
poetry install --no-interaction
# run all tests
test opts="":
poetry run pytest -vv {{opts}} tests/
# run tests with coverage report
coverage:
poetry run pytest --cov-report term --cov-report html --cov={{ PROJECT }} --cov-branch tests/
{{ OPEN }} htmlcov/index.html
# run tests on the CI
test-ci:
poetry run pytest --cov={{ PROJECT }} --cov-report=xml --cov-branch tests/
# 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"
# build a python release
build:
poetry build --no-interaction