forked from trussed-dev/fido2-tests
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (39 loc) · 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
.PHONY: standard-tests vendor-tests
PY_VERSION=$(shell python -c "import sys; print('%d.%d'% sys.version_info[0:2])")
VALID=$(shell python -c "print($(PY_VERSION) >= 3.6)")
ifeq ($(OS),Windows_NT)
BIN=venv/Scripts
else
BIN=venv/bin
endif
ifeq (True,$(VALID))
PYTHON=python
else
PYTHON=python3
endif
standard-tests: venv
$(BIN)/pytest tests/standard
vendor-tests: venv
$(BIN)/pytest tests/vendor
# setup development environment
venv:
$(PYTHON) -m venv venv
$(BIN)/python -m pip install -U pip
$(BIN)/pip install -U -r requirements.txt
$(BIN)/pip install -U -r dev-requirements.txt
$(BIN)/pre-commit install
# re-run if dependencies change
update:
$(BIN)/python -m pip install -U pip
$(BIN)/pip install -U -r requirements.txt
$(BIN)/pip install -U -r dev-requirements.txt
# ensure this passes before commiting
check:
$(BIN)/black --check tests/
$(BIN)/isort --check-only --recursive tests/
# automatic code fixes
fix: black isort
black:
$(BIN)/black tests/
isort:
$(BIN)/isort -y --recursive tests/