mrkeyoor.com_
Tue 22 Sept 00:44 UTC
PyPICLI & Toolingupdated 21 Sept 2026

ty review

ty is Astral's Rust-written Python type checker and language server. The CLI checks a project, watches affected files, emits terminal, GitHub, or JUnit diagnostics, and lets teams set rule severity globally or per file. Its editor server adds navigation, completion, code actions, auto-imports, hover information, and incremental analysis. Version 0.0.74 fixes crashes and incorrect handling around string annotations and recursive TypedDicts, adds an `untrustedWorkspace` LSP option, supports notebook pull diagnostics, and introduces an opt-in unsound-assignment rule. It remains beta with no stable diagnostic contract.

Verdict

ty is easy to trial because our measured wheel installed as one 1 MB package and the CLI can run beside an existing checker. Keep that parallel run until its beta diagnostics, target-version coverage, and results on your own code are good enough to pin in CI.

We installed it

Lab card: what happened when we installed tyScreenshot of ty documentation
Install✓ · 0.3s1 package on disk · 1 MB
Importimport ty in 0.04s · compiled extensions · py.typed · requires Python >=3.8
Known vulns0(pip-audit)

Answers from our run

Does ty install cleanly?

Yes. In a fresh container with an empty cache, pip install ty finished in 0.3s, leaving 1 package and 1 MB on disk. pip-audit reported no known vulnerabilities.

What does ty need to run?

Python >=3.8, and a platform wheel with compiled extensions. In our run import ty succeeded in 0.04s, and the package ships py.typed for type checkers.

ty or mypy: which should you use?

mypy: Use it for a long-established checker with a large plugin ecosystem and familiar gradual-typing behavior. ty is easy to trial because our measured wheel installed as one 1 MB package and the CLI can run beside an existing checker.

When should you not use ty?

Your CI requires stable diagnostics across patch upgrades; ty uses 0.0.x versioning and its README permits breaking changes between any two releases

API stability2/5The command shape, TOML sections, named diagnostics, suppression syntax, and language-server role are already coherent. Astral still labels ty beta and explicitly says any 0.0.x release may change diagnostics or other behavior. Versions arrive quickly, and 0.0.74 adds a rule while fixing inference and crash cases, so teams should pin the exact patch and review every upgrade result.
Docs5/5The official site explains installation, project discovery, Python environments, target versions, configuration, every CLI option, rule severity, overrides, suppression comments, editor setup, language-server behavior, and exit codes. It also links a type-system support tracker and a stable-release milestone. The docs are candid about beta status and older Python targets, which makes trial planning much easier.
Maintenance5/5The repository is unarchived, had 19,548 stars, and was pushed on 2026-08-25. GitHub reported 901 open issues and pull requests, a large queue for a young type checker. Version 0.0.74 shipped on 2026-08-22, four days after 0.0.73, with crash fixes, core inference corrections, LSP additions, performance work, and a new opt-in diagnostic. Development is fast enough that pinning is mandatory.
Ecosystem3/5The supplied package snapshot records 10,332,262 weekly downloads, and ty has integrations documented for VS Code, PyCharm, Neovim, Zed, and other LSP-capable editors. GitHub and JUnit output fit common CI systems. Its surrounding ecosystem is still smaller than mypy's plugin base and Pyright's established editor footprint, and incomplete type-system areas remain tracked publicly.

Use it if

  • A Python repository wants a very fast local type-check loop and can compare results with its current checker during adoption
  • One tool should provide both CI diagnostics and a language server with incremental editor feedback
  • Rule severities, per-file overrides, targeted suppression comments, project roots, and environment discovery need first-class configuration
  • The code targets Python 3.10 or newer, which is the range Astral officially supports for accurate checking
Skip it if

Setup reality

We installed ty 0.0.73 in a fresh Python 3.12 Bookworm container. The install completed in 0.3 seconds, left one package, and used 1 MB. pip-audit found no known vulnerabilities. Package metadata lists zero direct dependencies, Python 3.8 or newer, and the MIT License. The wheel ships compiled .so code plus a py.typed marker. import ty worked in 0.04 seconds. The current registry version is 0.0.74, so the measured install is one patch behind the guide's release metadata.

Run ty check from a project or pass paths explicitly. ty finds pyproject.toml, a nearby virtual environment, and Python requirements, but monorepos and unusual environments should set the project root and interpreter deliberately. The install-time Python floor is 3.8; the checked code's target version is separate. Astral officially supports checking Python 3.10 and newer, even though earlier targets can be selected. Pin python-version and python-platform so a developer laptop and Linux CI do not resolve conditional stubs differently.

Configuration can live under [tool.ty] in pyproject.toml or in a dedicated ty.toml with the shorter section names. Set project roots and exclusions before tuning rules. ty respects common ignore files by default, which can surprise a repository that expects generated or vendored code to be checked. It resolves third-party imports from the selected Python environment. Point environment.python or --python at the real virtual environment instead of silencing every unresolved import.

Adopt ty beside the existing checker first. Record both result sets, fix clear bugs, and add narrow # ty: ignore[rule-name] comments only where the difference is understood. Blanket # type: ignore comments may affect more than one checker. In CI, use --output-format github for annotations or JUnit for report ingestion, and decide whether warnings should fail with --error-on-warning. Version 0.0.74 adds LSP handling for untrusted workspaces; editor administrators should still review what executable the extension discovers and starts.

Patterns

Check the discovered project check-project

ty check

Run from the project directory. ty searches upward for project configuration and discovers a nearby Python environment.

Limit checking to selected paths check-paths

ty check src tests

Explicit paths narrow the command, but imports outside them may still be analyzed to resolve types.

Recheck after file changes watch-project

ty check --watch

Watch mode uses incremental analysis and rechecks files related to the changed path.

Pin the checked Python version set-target-python

[tool.ty.environment]
python-version = "3.12"
python-platform = "linux"

The target controls syntax and conditional type definitions. It is independent of the Python version used to install ty.

Point ty at a virtual environment select-environment

[tool.ty.environment]
python = "./.venv"

Use the environment that contains project dependencies so third-party imports resolve against the right packages and stubs.

Declare import roots for a monorepo set-project-roots

[tool.ty.environment]
root = ["./services/api/src", "./packages/shared/src"]
extra-paths = ["./generated"]

Root order affects first-party module resolution. Keep generated paths explicit instead of broadening unresolved-import allowances.

Change rule severities configure-rules

[tool.ty.rules]
possibly-unresolved-reference = "warn"
division-by-zero = "error"

Rule names are part of beta diagnostics and can change. Review configuration when updating ty.

Relax one rule only in tests override-test-rules

[[tool.ty.overrides]]
include = ["tests/**", "**/test_*.py"]

[tool.ty.overrides.rules]
possibly-unresolved-reference = "warn"

Later matching overrides take precedence. Keep the scope narrow so production modules retain the global severity.

Suppress one finding on one line suppress-diagnostic

total = price + label  # ty: ignore[unsupported-operator]

Name the rule instead of using a blanket ignore, and leave a code comment when the reason is not obvious.

Emit GitHub Actions annotations annotate-github

ty check --output-format github --error-on-warning

This format creates workflow annotations. The warning flag makes warning-level diagnostics return a failing exit status.

Produce JUnit diagnostic output write-junit-report

ty check --output-format junit > ty-report.xml

The shell writes XML to the report file. Preserve ty's process exit code separately if the CI wrapper masks it.

Read the explanation for a rule explain-rule

ty explain invalid-argument-type

Use the reported rule name from a diagnostic. Explanations help decide whether to fix, downgrade, or suppress the finding.

Alternatives

PackageRegistryPick it when
mypyPyPIUse it for a long-established checker with a large plugin ecosystem and familiar gradual-typing behavior
pyrightPyPIUse it for mature editor integration, strict modes, and the type engine behind Pylance
pyreflyPyPIUse it when evaluating another native-speed checker and language server with different inference choices

More cli & tooling guides

chalk · commander · typescript · esbuild · yargs · click · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.