-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (32 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
39 lines (32 loc) · 1.05 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
.PHONY: test format test-pypi
FILE = $(file)
test:
TEST_FILE=$(FILE) docker-compose up --build --abort-on-container-exit
test-benchmark:
docker-compose run tests uv run pytest --benchmark-only
test-pypi:
uv run pytest -xvrs --color=yes -m pypi tests/test_pypi_readiness.py
format:
uv run ruff format .
uv run ruff check --fix .
publish:
@set -e; \
version=$$(uv version --short); \
if ! git tag --list | grep -Fxq "$$version"; then \
git tag "$$version"; \
git push origin "$$version"; \
else \
echo "Tag $$version already exists."; \
fi
uv build
UV_PUBLISH_TOKEN="$(PYPI_TOKEN)" uv publish
changelog:
git fetch --tags
HEADER="# Changelog\nAll notable changes to this project will be documented in this file.\n========="; \
TAG=$$(git describe --tags --abbrev=0); \
DATE=$$(date +%Y-%m-%d); \
CHANGES=$$(git log $$TAG..HEAD --pretty=format:"- %s"); \
NEW_CONTENT="## [$$(uv version --short)] - $$DATE\n\n$$CHANGES\n"; \
perl -i -0pe "s{$$HEADER}{$$HEADER\n\n$$NEW_CONTENT}s" CHANGELOG.md
new-version:
uv version --bump patch # minor, major, patch