@@ -19,6 +19,14 @@ test: ## Test the code with pytest.
1919 @uv run python -m pytest --cov --cov-config=pyproject.toml --cov-report=xml tests
2020 @uv run python -m pytest --cov --cov-config=pyproject.toml --cov-report=xml tests_isolated
2121
22+ .PHONY : docs-test
23+ docs-test : # # Test if documentation can be built without warnings or errors
24+ @uv run mkdocs build -s
25+
26+ .PHONY : docs
27+ docs : # # Build and serve the documentation
28+ @uv run mkdocs serve
29+
2230.PHONY : build
2331build : clean-build # # Build wheel file
2432 @echo " 🚀 Creating wheel file"
@@ -29,23 +37,27 @@ clean-build: ## Clean build artifacts
2937 @echo " 🚀 Removing build artifacts"
3038 @uv run python -c " import shutil; import os; shutil.rmtree('dist') if os.path.exists('dist') else None"
3139
32- .PHONY : publish
33- publish : # # Publish a release to PyPI.
34- @echo " 🚀 Publishing: Dry run. "
35- @uvx --from build pyproject-build --installer uv
36- @echo " 🚀 Publishing. "
37- @uvx twine upload --repository-url https://upload.pypi.org/legacy/ dist/ *
40+ .PHONY : tag
41+ tag : # # Add a Git tag and push it to origin with syntax: make tag TAG=tag_name
42+ @echo " 🚀 Creating git tag: ${TAG} "
43+ @git tag -a ${TAG}
44+ @echo " 🚀 Pushing tag to origin: ${TAG} "
45+ @git push origin ${TAG}
3846
39- .PHONY : build-and-publish
40- build-and-publish : build publish # # Build and publish.
47+ .PHONY : validate-tag
48+ validate-tag : # # Check to make sure that a tag exists for the current HEAD and it looks like a valid version number
49+ @echo " 🚀 Validating version tag"
50+ @uv run inv validatetag
4151
42- .PHONY : docs-test
43- docs-test : # # Test if documentation can be built without warnings or errors
44- @uv run mkdocs build -s
52+ .PHONY : publish-test
53+ publish-test : validatetag build # # Test publishing a release to PyPI.
54+ @echo " 🚀 Publishing: Dry run."
55+ @uvx twine upload --repository testpypi dist/*
4556
46- .PHONY : docs
47- docs : # # Build and serve the documentation
48- @uv run mkdocs serve
57+ .PHONY : publish
58+ publish : validatetag build # # Publish a release to PyPI.
59+ @echo " 🚀 Publishing."
60+ @uvx twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
4961
5062.PHONY : help
5163help :
0 commit comments