forked from OmniPro-Group/sanity-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.03 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.03 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
.DEFAULT_GOAL := all
.SHELLFLAGS = -e
UPGRADE_ARGS ?= --upgrade
projectname = sanity-python
projectpath = sanity
# tools
ruff-check = uv run ruff check $(projectpath)
ruff-format = uv run ruff format $(projectpath)
ruff-lint = uv run ruff lint $(projectpath)
pyright = uv run pyright -v .venv $(projectpath)
BUMP ?= dev
.PHONY: clean
clean:
ruff clean
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete -o -type d -name .mypy_cache -delete
rm -rf build
.PHONY: build
build:
uv build
.PHONY: publish
publish:
uv publish
.PHONY: format
format:
$(ruff-format)
if ! git diff --quiet; then \
git add $(projectpath); \
git commit -m "style: format code via make format-commit"; \
fi
.PHONY: git-push
git-push:
git push
git push origin $(branch)
.PHONY: install
install:
uv add python-sanity
.PHONY: version-bump
version-bump:
uv version --bump $(BUMP)
git add pyproject.toml uv.lock
git commit -m "Bump version to $(version) ($(BUMP))"
.PHONY: release
release: clean format version-bump build publish git-push