Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (53 loc) · 1.41 KB
/
Copy pathMakefile
File metadata and controls
65 lines (53 loc) · 1.41 KB
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
PYTHON=python3.12
VENV_BIN=.venv/bin
update-api-local:
. .venv/bin/activate
./update-openapi.sh -l
.PHONY: prepare-venv
.ONESHELL:
prepare-venv: .SHELLFLAGS := -euo pipefail -c
prepare-venv: SHELL := bash
prepare-venv:
# Isolated venv (no --system-site-packages): system packages can register
# broken pytest entry points (e.g. platformdirs) under act/GHA.
$(PYTHON) -m venv --clear .venv
$(VENV_BIN)/python -m pip install --upgrade pip
$(VENV_BIN)/pip install --ignore-installed --no-deps -r requirements.txt
$(VENV_BIN)/pip install -e ".[test]"
.PHONY: format
format:
. .venv/bin/activate
$(VENV_BIN)/autoflake -i -r --ignore-init-module-imports swmclient scripts
$(VENV_BIN)/black swmclient scripts
$(VENV_BIN)/isort swmclient scripts
.PHONY: check
check:
. .venv/bin/activate
$(VENV_BIN)/ruff check swmclient
$(VENV_BIN)/mypy swmclient
$(VENV_BIN)/bandit -r swmclient -c "pyproject.toml" --silent
.PHONY: test
test:
. .venv/bin/activate
$(VENV_BIN)/python -m pytest -q tests
.PHONY: act
act:
scripts/run-act.sh $(ARGS)
.PHONY: package
package:
. .venv/bin/activate
$(PYTHON) -m build
.PHONY: clean
clean:
rm -fr ./dist
rm -fr swmclient.egg-info
rm -fr build
.PHONY: upload
upload:
. .venv/bin/activate
$(PYTHON) -m twine upload --verbose --config-file .pypirc dist/*
.PHONY: requirements
requirements: requirements.txt
make prepare-venv || true
requirements.txt: requirements.in
@pip-compile $<