-
Notifications
You must be signed in to change notification settings - Fork 60
/
Makefile
51 lines (38 loc) · 937 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
50
51
REFORMAT_DIRS:=riposte
define colorecho
@tput setaf 6
@echo $1
@tput sgr0
endef
.PHONY: all
all: reformat tests lint
.PHONY: package
package: clean
$(call colorecho, "\n Building package distributions...")
python -m build .
.PHONY: publish
publish: package
twine upload dist/*
.PHONY: tests
tests: clean
$(call colorecho, "\nRunning tests...")
pytest $(ARGS)
.PHONY: lint
lint:
$(call colorecho, "\nLinting...")
black --check --diff $(REFORMAT_DIRS)
isort --check-only --diff $(REFORMAT_DIRS)
ruff check --diff $(REFORMAT_DIRS)
.PHONY: reformat
reformat:
$(call colorecho, "\nReformatting...")
black $(REFORMAT_DIRS)
isort $(REFORMAT_DIRS)
ruff check --fix $(REFORMAT_DIRS)
.PHONY: clean
clean:
$(call colorecho, "\nRemoving artifacts...")
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
rm -rf build dist pip-wheel-metadata