From a68aa1802fa92075971cb09f98d8d9f53b18b24a Mon Sep 17 00:00:00 2001 From: Rick Porter Date: Sun, 3 May 2026 09:52:20 -0400 Subject: [PATCH 1/2] Add Makefile to expose common developer commands --- Makefile | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..c53b447f73 --- /dev/null +++ b/Makefile @@ -0,0 +1,59 @@ +# For tests, a large terminal width +TERMINAL_WIDTH ?= 3000 +# Force disable terminal for tests inside of pytest, takes precedence over GITHUB_ACTIONS env var +_TYPER_FORCE_DISABLE_TERMINAL ?= 1 +# Run autocompletion install tests in the CI +_TYPER_RUN_INSTALL_COMPLETION_TESTS ?= 1 + +PYTEST_TARGET ?= +PYTEST_ARGS_BASE = -o console_output_style=progress --numprocesses=auto --show-locals +PYTEST_ARGS_COV ?= --cov --cov-report=term-missing --cov-report=html +PYTEST_ARGS_USER ?= + +RUN ?= uv run +LINT_DIRS := typer + +################### +##@ General +help: ## Print this message + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + +clean: ## Removes all bulid/test artifacts + rm -rf .pdm-build/ + rm -rf .mypy_cache/ .ruff_cache/ + rm -rf .pytest_cache/ coverage/ htmlcov/ + +################### +##@ Tests +test: ## Run tests + $(RUN) pytest $(PYTEST_ARGS_BASE) $(PYTEST_ARGS_USER) $(PYTEST_TARGET) + +cov: ## Runs tests and produces HTML coverage report + $(RUN) pytest $(PYTEST_ARGS_BASE) $(PYTEST_ARGS_USER) $(PYTEST_ARGS_COV) $(PYTEST_TARGET) + @echo "Run 'open htmlcov/index.html' to see results" + +################### +##@ Docs +docs-build: ## Build docs + $(RUN) scripts/docs.py build + +docs-status: ## Check docs status + $(RUN) scripts/deploy_docs_status.py + +################### +##@ Lint +lint-check: ruff-check ty-check mypy-check ## Perform all linting (ruff, ty, and mypy) + +lint-fix: ruff-fix ## Attempt to fix linting issues + +mypy-check: ## Perform mypy checking + $(RUN) mypy $(LINT_DIRS) + +ty-check: ## Perform ty checks + $(RUN) ty check $(LINT_DIRS) + +ruff-check: ## Perform ruff formatting checks + $(RUN) ruff check + +ruff-format: ## Formats files + $(RUN) ruff format From 420d6d250e6200a9933f888921e1bf3f684a83af Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sun, 3 May 2026 14:08:44 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c53b447f73..cf2643f728 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ _TYPER_FORCE_DISABLE_TERMINAL ?= 1 # Run autocompletion install tests in the CI _TYPER_RUN_INSTALL_COMPLETION_TESTS ?= 1 -PYTEST_TARGET ?= +PYTEST_TARGET ?= PYTEST_ARGS_BASE = -o console_output_style=progress --numprocesses=auto --show-locals PYTEST_ARGS_COV ?= --cov --cov-report=term-missing --cov-report=html -PYTEST_ARGS_USER ?= +PYTEST_ARGS_USER ?= RUN ?= uv run LINT_DIRS := typer