-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (66 loc) · 1.57 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
sinclude .env # create from example.env
PROJECT=quiltplus
.PHONY: install test watch all clean
TEST_README=--codeblocks
ifeq ($(TEST_OS),windows-latest)
TEST_README=''
endif
all: lock install update test
clean:
rm -rf coverage_html
rm -f coverage*
rm -f .coverage*
rm -rf quiltplus/.pytest_cache
lock:
poetry lock
install:
poetry install
update:
poetry update
server:
poetry run uvicorn --app-dir quiltplus api:app --reload &
open http://127.0.0.1:8000
check:
poetry check
make typecheck
make lint
test: typecheck
echo "Testing with WRITE_BUCKET=$(WRITE_BUCKET)"
poetry run pytest $(TEST_README) --cov --cov-report xml:coverage.xml
test-local:
make test "SKIP_LONG_TESTS=True"
test-all:
make test "SKIP_LONG_TESTS=False"
typecheck:
poetry run mypy $(PROJECT) tests
lint:
poetry run black $(PROJECT) tests
poetry run flake8 $(PROJECT) tests
coverage:
echo "Using WRITE_BUCKET=$(WRITE_BUCKET) | SKIP_LONG_TESTS=$(SKIP_LONG_TESTS)"
poetry run pytest --cov --cov-report html:coverage_html
open coverage_html/index.html
watch:
poetry run ptw --now .
tag:
git tag `poetry version | awk '{print $$2}'`
git push --tags
pypi: clean clean-git
poetry version
poetry build
poetry publish --dry-run
echo "poetry version prepatch" # major minor
clean-git:
git branch | grep -v '*' | grep -v 'main' | xargs git branch -D
which:
which $(PROJECT)
$(PROJECT) --version
pip-install:
python3 -m pip install $(PROJECT)
make which
pip-upgrade:
python3 -m pip install --upgrade $(PROJECT)
make which
pip-update:
poetry self update
python3 -m pip install --upgrade pip