-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 760 Bytes
/
Makefile
File metadata and controls
37 lines (30 loc) · 760 Bytes
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
NAME := $(shell basename $(PWD))
PYTHONPATH := $(PWD)/.
VENV := $(PWD)/.venv
PATH := $(VENV)/bin:$(PATH)
BIN := PATH=$(PATH) PYTHONPATH=$(PYTHONPATH) $(VENV)/bin
py := $(BIN)/python3
pip := $(py) -m pip
.PHONY: test
test:
$(BIN)/pytest tests
.PHONY: lint
lint:
$(BIN)/ruff check $(NAME) tests
.PHONY: black
black:
$(BIN)/black $(NAME) tests
.PHONY: bump
bump:
$(eval TMP := $(shell mktemp tmp.pyproject.XXXXXX))
@awk '$$1=="version"{gsub("\"","",$$3);split($$3,n,".");$$3=sprintf("\"%d.%d.%d\"",n[1],n[2],n[3]+1)}{print}' pyproject.toml > $(TMP)
@mv $(TMP) pyproject.toml
@grep ^version\ = pyproject.toml
.PHONY: bin
bin:
@echo $(BIN)
.PHONY: venv
venv:
python3 -m venv $(VENV)
$(pip) install --upgrade pip
$(pip) install -r requirements.dev