-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (39 loc) · 1.1 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
#
# Copyright (C) 2019 - 2021 Tuono, Inc.
# Copyright (C) 2021 - 2022 CloudTruth, Inc.
#
.PHONY: all clean coverage dist example lint pdb prerequisites setup test test-loop
all: test
clean:
@rm -f .coverage
@rm -rf build
@rm -f coverage.xml
@rm -rf dist
@find . -name '*.py,cover' | xargs rm -f
@find . -name '*.pyc' | xargs rm -f
@find . -name '__pycache__' | xargs rm -rf
coverage:
poetry run pytest -v --cov --cov-report=term-missing --cov-report=xml
dist: clean
poetry build
example:
# requires "make prerequisites" and "make setup" to have been run once before
# to record: time RECORDING=1 make example
# to playback: time make example
# log level 7 includes logging results
poetry run pytest -o log_cli=true -o log_cli_level=7 tests/example_weather_test.py
lint:
poetry run pre-commit run -a
pdb:
poetry run pytest --pdb
# this may require that ~/.local/bin is in your PATH
prerequisites:
python3 -m pip install -U poetry
setup:
poetry config virtualenvs.in-project true
poetry install
poetry run pre-commit install
test:
poetry run pytest
test-loop:
while make test; do :; done