-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 1.21 KB
/
Makefile
File metadata and controls
66 lines (53 loc) · 1.21 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
VIRTUAL_ENV ?= .venv
# =============
# Development
# =============
$(VIRTUAL_ENV): uv.lock .pre-commit-config.yaml
@uv sync
@uv run pre-commit install
@touch $(VIRTUAL_ENV)
.PHONY: run
# target: run - Run example
run: $(VIRTUAL_ENV)
@$(VIRTUAL_ENV)/bin/uvicorn --port 5000 --reload example:app
.PHONY: test t
# target: test - Run tests
test t: $(VIRTUAL_ENV)
@$(VIRTUAL_ENV)/bin/pytest tests.py
.PHONY: mypy
# target: mypy - Check types
mypy: $(VIRTUAL_ENV)
@$(VIRTUAL_ENV)/bin/mypy muffin_babel
.PHONY: example
# target: example - Run an example
example: $(VIRTUAL_ENV)
@$(VIRTUAL_ENV)/bin/uvicorn --port 5000 --reload example:app
# ==============
# Bump version
# ==============
VERSION?=minor
# target: release - Bump version
.PHONY: release
release:
@git checkout develop
@git pull
@git checkout master
@git merge develop
@git pull
@uvx bump-my-version bump $(VERSION)
@uv lock
@git commit -am "build(release): `uv version --short`"
@git tag `uv version --short`
@git checkout develop
@git merge master
@git push --tags origin develop master
.PHONY: minor
minor: release
.PHONY: patch
patch:
@make release VERSION=patch
.PHONY: major
major:
@make release VERSION=major
v:
@echo `uv version --short`