-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.DEFAULT_GOAL := all | ||
|
||
.PHONY: .uv ## Check that uv is installed | ||
.uv: | ||
@uv -V || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/' | ||
|
||
.PHONY: .pre-commit ## Check that pre-commit is installed | ||
.pre-commit: .uv | ||
@uv run pre-commit -V || uv pip install pre-commit | ||
|
||
.PHONY: install ## Install the package, dependencies, and pre-commit for local development | ||
install: .uv | ||
uv sync --frozen --dev --all-extras | ||
uv pip install pre-commit | ||
pre-commit install --install-hooks | ||
|
||
.PHONY: rebuild-lockfiles ## Rebuild lockfiles from scratch, updating all dependencies | ||
rebuild-lockfiles: .uv | ||
uv lock --upgrade | ||
|
||
.PHONY: format ## Auto-format python source files | ||
format: .uv | ||
uv run ruff format . | ||
uv run ruff check --fix . | ||
|
||
.PHONY: lint ## Lint python source files | ||
lint: .uv | ||
uv run ruff check . | ||
uv run ruff format . | ||
|
||
.PHONY: typecheck ## Run type checking | ||
typecheck: .pre-commit | ||
pre-commit run typecheck --all-files | ||
|
||
.PHONY: all ## Run the standard set of checks performed in CI | ||
all: lint typecheck | ||
|
||
.PHONY: clean ## Clear local caches and build artifacts | ||
clean: | ||
rm -rf `find . -name __pycache__` | ||
rm -f `find . -type f -name '*.py[co]'` | ||
rm -f `find . -type f -name '*~'` | ||
rm -f `find . -type f -name '.*~'` | ||
rm -rf .cache | ||
rm -rf .pytest_cache | ||
rm -rf .ruff_cache | ||
rm -rf htmlcov | ||
rm -rf *.egg-info | ||
rm -f .coverage | ||
rm -f .coverage.* | ||
rm -rf build | ||
rm -rf dist | ||
|
||
.PHONY: help ## Display this message | ||
help: | ||
@grep -E \ | ||
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \ | ||
sort | \ | ||
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-19s\033[0m %s\n", $$2, $$3}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters