-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (43 loc) · 1.5 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
PYTHON := python3
.PHONY: clean fix check
clean:
$(PYTHON) -Bc "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]"
$(PYTHON) -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('.').rglob('__pycache__')]"
rm -rf __pycache__ build *.egg-info .mypy_cache dist
cd docs && make clean
# FIXES
fix-isort:
$(PYTHON) -m isort . --settings-path pyproject.toml
fix-black:
$(PYTHON) -m black . --config pyproject.toml
generate-schemas:
$(PYTHON) main.py generate-schema
fix: fix-isort fix-black generate-schemas
# CHECKS
check-isort:
$(PYTHON) -m isort . --settings-path pyproject.toml --check-only
check-black:
$(PYTHON) -m black . --config pyproject.toml --check
check-omtool-mypy:
$(PYTHON) -m mypy omtool --config-file pyproject.toml
check-cli-mypy:
$(PYTHON) -m mypy cli --config-file pyproject.toml
check-tools-mypy:
$(PYTHON) -m mypy tools --config-file pyproject.toml
check-tests-mypy:
$(PYTHON) -m mypy tests --config-file pyproject.toml
check-mypy: check-omtool-mypy check-tools-mypy check-cli-mypy check-tests-mypy
test:
$(PYTHON) -m unittest -v $$(find . -name "*_test.py")
check: check-isort check-black check-mypy test
# BUILDS
build-pip:
$(PYTHON) -m pip install . --upgrade
build-docs:
mkdocs build
serve-docs: build-docs
mkdocs serve
build-docker:
docker buildx build --platform linux/amd64 --load -t omtool package
docker tag omtool kraysent/omtool:$$(git rev-parse --short main)
docker tag kraysent/omtool:$$(git rev-parse --short main) kraysent/omtool:latest