Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %})

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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
Expand Down