Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,20 +1,38 @@
|
||||
# Makefile for uv + ruff + mypy + deptry
|
||||
UV := uv
|
||||
RUFF := ruff
|
||||
MYPY := mypy
|
||||
DEPTRY := deptry
|
||||
|
||||
.PHONY: full-lint clean-branches
|
||||
.PHONY: format lint typecheck test ci-check build publish-gitea clean-branches
|
||||
|
||||
full-lint:
|
||||
@echo "Running ruff check and fix..."
|
||||
$(UV) run $(RUFF) check . --fix
|
||||
@echo "Running mypy..."
|
||||
$(UV) run $(MYPY) . --config-file ./pyproject.toml --no-incremental
|
||||
@echo "Running deptry..."
|
||||
$(UV) run $(DEPTRY) . --config ./pyproject.toml
|
||||
@echo "All checks completed!"
|
||||
format:
|
||||
$(UV) run ruff format .
|
||||
$(UV) run ruff check . --fix
|
||||
|
||||
lint:
|
||||
$(UV) run ruff check .
|
||||
|
||||
typecheck:
|
||||
$(UV) run mypy --config-file pyproject.toml
|
||||
|
||||
test:
|
||||
$(UV) run pytest
|
||||
|
||||
ci-check:
|
||||
$(UV) run ruff check .
|
||||
$(UV) run mypy --config-file pyproject.toml
|
||||
$(UV) run deptry .
|
||||
|
||||
build:
|
||||
$(UV) build
|
||||
|
||||
publish-gitea:
|
||||
@test -n "$$GITEA_PYPI_REPOSITORY_URL" || (echo "GITEA_PYPI_REPOSITORY_URL is required" && exit 1)
|
||||
@test -n "$$GITEA_PACKAGE_USERNAME" || (echo "GITEA_PACKAGE_USERNAME is required" && exit 1)
|
||||
@test -n "$$GITEA_PACKAGE_TOKEN" || (echo "GITEA_PACKAGE_TOKEN is required" && exit 1)
|
||||
$(UV) build
|
||||
$(UV) run --with twine twine check dist/*
|
||||
TWINE_REPOSITORY_URL="$$GITEA_PYPI_REPOSITORY_URL" \
|
||||
TWINE_USERNAME="$$GITEA_PACKAGE_USERNAME" \
|
||||
TWINE_PASSWORD="$$GITEA_PACKAGE_TOKEN" \
|
||||
$(UV) run --with twine twine upload dist/*
|
||||
|
||||
clean-branches:
|
||||
ifeq ($(OS),Windows_NT)
|
||||
|
||||
Reference in New Issue
Block a user