-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (41 loc) · 927 Bytes
/
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
clean_coverage:
rm -f .coverage
rm -rf htmlcov
clean_cache:
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf **/__pycache__
clean: clean_coverage clean_cache
test: clean_coverage
k=$(filter-out $@,$(MAKECMDGOALS)); \
if [ -n "$k" ]; then \
( \
source .venv/bin/activate; \
coverage run -m pytest -xsvv -k $k; \
) \
else \
( \
source .venv/bin/activate; \
coverage run -m pytest -xsvv; \
) \
fi
report: test
coverage html && open htmlcov/index.html
format:
black . && isort .
install: clean_cache
( \
source .venv/bin/activate; \
pip install --upgrade pip; \
pip install -r requirements.txt; \
)
upgrade:
( \
source .venv/bin/activate; \
pip --disable-pip-version-check list --outdated --format=json | python -c "import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))" | xargs -n1 pip install -U; \
)
run:
( \
source .venv/bin/activate; \
python chess.py; \
)