-
Notifications
You must be signed in to change notification settings - Fork 441
/
Copy pathMakefile
42 lines (30 loc) · 1.11 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
.PHONY: all test tests test_watch test_coverage test_profile docs pre_commit help
# Default target executed when no specific target is provided to make.
all: help
# Define a variable for the test file path.
TEST_FILE ?= tests/
test:
poetry run pytest $(TEST_FILE)
tests:
poetry run pytest $(TEST_FILE)
test_watch:
poetry run ptw --snapshot-update --now . -- -vv $(TEST_FILE)
test_coverage:
poetry run pytest --cov=$(TEST_FILE) --cov-report=term-missing
test_profile:
poetry run pytest -vv tests/ --profile-svg
docs:
poetry run sphinx-build -b html docs _build/docs
pre_commit:
pre-commit install
pre-commit run --all-files
# HELP
help:
@echo '----'
@echo 'test - run unit tests'
@echo 'tests - run unit tests'
@echo 'test TEST_FILE=<test_file> - run all tests in given file'
@echo 'test_watch - run unit tests in watch mode'
@echo 'test_coverage - run unit tests with coverage'
@echo 'docs - build docs, if you installed the docs dependencies'
@echo 'pre_commit - run pre-commit hooks'