diff --git a/AGENTS.md b/AGENTS.md index c99eea1..3aaf29b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## Project Overview -A Cookiecutter template for Python packages, supporting both CLI and library project types. Generates projects with uv, ruff, pyright, and pytest pre-configured. It also comes with GitHub Actions workflows configured for the project. +A Cookiecutter template for Python packages, supporting both CLI and library project types. Generates projects with uv, ruff, ty, and pytest pre-configured. It also comes with GitHub Actions workflows configured for the project. This template is opinionated and enforces recommended practices when creating new Python projects. diff --git a/{{cookiecutter.project_slug}}/AGENTS.md b/{{cookiecutter.project_slug}}/AGENTS.md index b5bfbb7..26e5362 100644 --- a/{{cookiecutter.project_slug}}/AGENTS.md +++ b/{{cookiecutter.project_slug}}/AGENTS.md @@ -15,7 +15,7 @@ This is a Python library package. - Package manager: uv - Build backend: uv_build - Linting/formatting: ruff -- Type checking: pyright +- Type checking: ty - Testing: pytest - CI: GitHub Actions (lint, test, release{%- if cookiecutter.documentation != 'none' %}, docs{%- endif %}) @@ -24,7 +24,7 @@ This is a Python library package. Use Makefile targets, not tool commands directly: - `make format` - Fix formatting issues -- `make lint` - Run all static checks (ruff, pyright) +- `make lint` - Run all static checks (ruff, ty) - `make test` - Run tests with coverage - `make doc` - Generate documentation - `make build` - Build the package diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index ebd75a6..28f0ce2 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -37,7 +37,7 @@ lint: uv sync --group lint uv run ruff format --check && \ uv run ruff check && \ - uv run pyright{% if cookiecutter.docstring_coverage %} && \ + uv run ty check{% if cookiecutter.docstring_coverage %} && \ uv run interrogate -c pyproject.toml .{% endif %} .PHONY: format diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 6fa07a3..50bf12a 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -36,7 +36,7 @@ lint = [ # NOTE: ruff is under active development, so we pin conservatively here # and let Dependabot periodically perform this update. "ruff ~= 0.14.0", - "pyright ~= 1.1", + "ty >=0.0.2", {%- if cookiecutter.docstring_coverage %} "interrogate", {%- endif %} @@ -63,14 +63,11 @@ Source = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter. # don't attempt code coverage for the CLI entrypoints omit = ["{{ cookiecutter.__project_src_path }}/_cli.py"] -[tool.pyright] +[tool.ty.environment] +python-version = "3.10" + +[tool.ty.src] include = ["src", "test"] -pythonVersion = "3.10" -typeCheckingMode = "strict" -reportUnusedImport = "warning" -reportUnusedVariable = "warning" -reportGeneralTypeIssues = "error" -reportMissingTypeStubs = true [tool.ruff] line-length = 100