-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (62 loc) · 1.63 KB
/
Makefile
File metadata and controls
75 lines (62 loc) · 1.63 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
66
67
68
69
70
71
72
73
74
75
VIRTUAL_ENV ?= env
$(VIRTUAL_ENV): uv.lock pyproject.toml
@uv sync
@uv run pre-commit install
@touch $(VIRTUAL_ENV)
.PHONY: test
test t: $(VIRTUAL_ENV)
docker start postgres mysql
@uv run pytest tests
.PHONY: types
types: $(VIRTUAL_ENV)
@uv run pyrefly check
.PHONY: lint
lint: $(VIRTUAL_ENV) types
@uv run ruff check
outdated:
@echo "Checking for outdated dependencies..."
@uv tree --depth 1 --outdated | grep 'latest' || echo "All dependencies are up to date."
.PHONY: example
example: $(VIRTUAL_ENV)
@$(VIRTUAL_ENV)/bin/pip install uvicorn asgi-tools
@$(VIRTUAL_ENV)/bin/uvicorn --port 5000 example:app
# ==============
# Bump version
# ==============
VERSION ?= minor
MAIN_BRANCH = main
STAGE_BRANCH = develop
.PHONY: release
VPART?=minor
# target: release - Bump version
release:
git checkout $(MAIN_BRANCH)
git pull
git checkout $(STAGE_BRANCH)
git pull
uvx bump-my-version bump $(VPART)
uv lock
@VERSION="$$(uv version --short)"; \
{ \
printf 'build(release): %s\n\n' "$$VERSION"; \
printf 'Changes:\n\n'; \
git log --oneline --pretty=format:'%s [%an]' $(MAIN_BRANCH)..$(STAGE_BRANCH) | grep -Evi 'github|^Merge' || true; \
} | git commit -a -F -; \
git tag -a "$$VERSION" -m "$$VERSION";
git checkout $(MAIN_BRANCH)
git merge $(STAGE_BRANCH)
git checkout $(STAGE_BRANCH)
git merge $(MAIN_BRANCH)
@git -c push.followTags=false push origin $(STAGE_BRANCH) $(MAIN_BRANCH)
@git push --tags origin
@echo "Release process complete for `uv version --short`"
.PHONY: minor
minor: release
.PHONY: patch
patch:
make release VPART=patch
.PHONY: major
major:
make release VPART=major
version v:
uv version --short