-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
89 lines (67 loc) · 2.07 KB
/
makefile
File metadata and controls
89 lines (67 loc) · 2.07 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
default: test-unit
.PHONY: docs
docs:
cd docs && quarto publish gh-pages
.PHONY: bugfix
bugfix:
git commit -a -m "Bugfix"
.PHONY: format
format:
black . && git commit -am "Apply code formatting"
.PHONY: format-check
format-check:
black --check .
.PHONY: type-check
type-check:
mypy
.PHONY: test-unit test-all
test-unit: format-check
pytest tests --cov=violetear
test-all: format-check
pytest --cov=violetear
.PHONY: docker-build
docker-build:
docker build -t violetear:latest -f dockerfile .
.PHONY: clean
clean:
rm -rf dist
rm -rf violetear.egg-info
rm -rf *.db*
find . -name '*.pyc' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
.PHONY: issues
issues:
gh md-issues push
sleep 5
gh md-issues pull
git add issues && git commit -m "Sync issues"
# Get the current version from pyproject.toml
CURRENT_VERSION := $(shell grep 'version = ' pyproject.toml | cut -d '"' -f 2)
.PHONY: release
release: format-check
@echo "Current version: ${CURRENT_VERSION}"
@if [ -z "$(NEW_VERSION)" ]; then \
echo "ERROR: NEW_VERSION environment variable is not set."; \
echo "Usage: NEW_VERSION=x.y.z make release"; \
exit 1; \
fi
@make test-all
@echo "Bumping version from $(CURRENT_VERSION) to $(NEW_VERSION)..."
@echo Replace version in pyproject.toml
@sed -i.bak "s/version = \"$(CURRENT_VERSION)\"/version = \"$(NEW_VERSION)\"/" pyproject.toml
@echo Replace version in violetear/__init__.py
@sed -i.bak "s/__version__ = \"$(CURRENT_VERSION)\"/__version__ = \"$(NEW_VERSION)\"/" violetear/__init__.py
@echo Remove backup files
@rm pyproject.toml.bak violetear/__init__.py.bak
@uv sync --all-extras
@echo "Committing version bump..."
@git add pyproject.toml violetear/__init__.py uv.lock
@git commit -m "Bump version to $(NEW_VERSION)"
@echo "Tagging new version..."
@git tag "v$(NEW_VERSION)"
@echo "Pushing commit and tags..."
@git push
@git push --tags
@echo "Creating Github release..."
@gh release create "v$(NEW_VERSION)" --title "v$(NEW_VERSION)" --notes "Release version $(NEW_VERSION)"
@echo "✅ Version $(NEW_VERSION) successfully released."