-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (52 loc) · 1.49 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
FORMAT_DIRS := src stubs tests
LINT_DIRS := src tests
PACKAGE_VERSION := $(shell poetry version --short)
.PHONY: install
install:
poetry install --sync --with dev
.PHONY: lock
lock:
poetry lock --no-update
.PHONY: update
update:
poetry update --with dev
.PHONY: check
check: check-format check-import-sorting check-poetry check-style check-typing check-docs
.PHONY: check-format
check-format:
poetry run black --check $(FORMAT_DIRS)
.PHONY: check-import-sorting
check-import-sorting:
poetry run isort --check-only $(FORMAT_DIRS)
.PHONY: check-poetry
check-poetry:
poetry check
.PHONY: check-style
check-style:
poetry run flake8 $(LINT_DIRS)
.PHONY: check-typing
check-typing:
poetry run mypy $(LINT_DIRS)
.PHONY: check-docs
check-docs:
poetry run rstcheck --recursive docs
.PHONY: fix
fix:
poetry run black $(FORMAT_DIRS)
poetry run isort $(FORMAT_DIRS)
.PHONY: test
test:
poetry run python -m unittest -v
.PHONY: generate-protobuf
generate-protobuf:
protoc src/nitrokey/trussed/_bootloader/nrf52_upload/dfu/dfu-cc.proto --python_out=. --pyi_out=.
.PHONY: generate-api-docs
generate-api-docs:
poetry run sphinx-apidoc --separate --maxdepth 1 --tocfile index --output-dir docs/api src/nitrokey
.PHONY: build-docs
build-docs:
poetry run sphinx-build --fail-on-warning docs _build
.PHONY: update-version
update-version: RPM_VERSION=$(shell echo ${PACKAGE_VERSION} | sed 's/-rc\./~rc/')
update-version:
sed -i "/^Version:/s/[[:digit:]].*/$(RPM_VERSION)/" ci-scripts/linux/rpm/python3-nitrokey.spec