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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
hooks:
- id: pytest-check
name: pytest-check
entry: bash -c "PYTHONPATH=. uv run pytest --co -q -m \"not integration\""
entry: bash -c "PYTHONPATH=. uv run pytest --co -q"
language: system
pass_filenames: false
always_run: true
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This document provides coding guidelines for AI agents working on this Python pr
- **Tooling**: Use `uv` for all package management
- **Python Version**: 3.13+
- **Package Manager**: uv (fast, modern dependency management)
- **Type Checker**: ty (Astral's fast type checker, alpha stage) - `make typecheck`
- Note: ty is in early development and may have bugs/missing features

## Code Style

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ lint:
format:
uv run ruff format .

typecheck:
uv run pyright
typecheck: ## Run ty type checker
uv run ty check

test: ## Run Pytest
uv run pytest
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This template is a **lean starting point** for Python projects that use:
- ⚙️ Pydantic Settings – typed environment configuration
- 📦 uv – fast dependency management / locking
- 📝 structlog – structured logging
- 🔍 ty – fast type checking (Rust-powered)

---

Expand Down Expand Up @@ -56,7 +57,7 @@ This template is a **lean starting point** for Python projects that use:
| `make setup` | Install dependencies + pre-commit hooks |
| `make format` | Format code with Ruff |
| `make lint` | Run Ruff linter |
| `make typecheck` | Run Pyright type checker |
| `make typecheck` | Run ty type checker |
| `make test` | Run Pytest |
| `make clean` | Remove \*.pyc & cache directories |
| `make lock-check` | Assert `uv.lock` is in sync |
Expand Down Expand Up @@ -108,6 +109,21 @@ Includes: PyTorch, scikit-learn, MLflow, matplotlib, numpy, pandas, and seaborn.

---

## Type Checking with ty

This template uses [ty](https://github.com/astral-sh/ty), Astral's fast type checker written in Rust.

**Note:** ty is in alpha and under active development. While production use is not yet recommended, it's suitable for experimentation and early adoption.

```bash
# Run ty type checker
make typecheck
```

Configuration is in `pyproject.toml` under `[tool.ty]`.

---

## License

MIT
28 changes: 19 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ dependencies = [
dev = [
"ipykernel>=6.30.1",
"pre-commit>=4.3.0",
"pyright>=1.1.406",
"pytest>=8.4.2",
"pytest-cov>=6.2.1",
"ruff>=0.13.3",
"ty>=0.0.1a21",
]

ml = [
Expand Down Expand Up @@ -66,13 +66,23 @@ python_files = ["test_*.py"]
addopts = ["-ra"]
pythonpath = ["."]

[tool.pyright]
include = ["*.py", "tests"]
exclude = ["**/__pycache__"]
typeCheckingMode = "off"
[tool.ty]
# Astral's ty type checker configuration

reportMissingImports = true
reportMissingTypeStubs = false
[tool.ty.environment]
# Point to your project venv; ty auto-detects .venv but this is explicit & robust.
python = ".venv"
python-version = "3.13"

pythonVersion = "3.13"
pythonPlatform = "All"
[tool.ty.src]
include = ["src", "utils", "tests"]
exclude = ["**/__pycache__", "*.pyc"]
respect-ignore-files = true

[tool.ty.rules]
# Strict type checking rules
possibly-unresolved-reference = "error"
division-by-zero = "error"

[tool.ty.terminal]
output-format = "concise"
42 changes: 27 additions & 15 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.