-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (29 loc) · 923 Bytes
/
Makefile
File metadata and controls
34 lines (29 loc) · 923 Bytes
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
.PHONY: release build upload
build:
@echo "Building the project..."
rm -rf dist
python3 -m build
install:
@echo "Installing the project..."
$(MAKE) build
uv pip install $$(ls -t dist/*.whl | head -n 1) --force-reinstall
upload:
@echo "Uploading to PyPI..."
python3 -m twine upload dist/*
release:
@if [ -z "$(filter-out $@,$(MAKECMDGOALS))" ]; then \
echo "Error: version parameter is required. Usage: make release X.Y.Z"; \
exit 1; \
fi
@version=$(filter-out $@,$(MAKECMDGOALS)); \
echo "Checking version $$version..."; \
pyproject_version=$$(grep -m 1 'version = ' pyproject.toml | sed 's/version = //; s/"//g'); \
if [ "$$version" != "$$pyproject_version" ]; then \
echo "Error: Version mismatch. pyproject.toml version: $$pyproject_version, provided version: $$version"; \
exit 1; \
fi
@echo "Version check passed. Proceeding with release $$version..."
$(MAKE) build
$(MAKE) upload
%:
@: