Skip to content

ty: type checking as a first-class gate#126

Merged
Syndic merged 1 commit into
mainfrom
pr/python-ty
Jun 15, 2026
Merged

ty: type checking as a first-class gate#126
Syndic merged 1 commit into
mainfrom
pr/python-ty

Conversation

@Syndic

@Syndic Syndic commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds [tool.ty] to root pyproject.toml (env py314, src = ["meta", "tools"], excludes mirror ruff's). Rule severities left at ty's defaults; tighten as real code surfaces categories worth escalating.
  • Installs ty in the devcontainer via uv tool install, reusing the UV_TOOL_{BIN_DIR,DIR} declaration from the ruff layer. TY_VERSION ARG is Renovate-tracked (pypi:ty).
  • New ty CI job: astral-sh/setup-uv@v6uv sync (so ty can resolve requests for the smoke target) → uvx ty@<pin> check. Added to build-and-test-per-target.needs.
  • post-create.sh now runs uv sync so the astral-sh.ty editor extension has a .venv to resolve against.
  • Wires the astral-sh.ty VS Code extension in both devcontainer.json and .vscode/extensions.json.
  • Widens renovate.json's workflow-yaml regex from [a-z-]*version: to [A-Za-z_-]*[Vv]ersion: so the TY_VERSION: env-var key is trackable. Follows the precedent of PR ruff: format + lint as a first-class gate #123, which widened the matcher to handle the prior python-version: site.
  • README: new ty row in the CI table, on-save table, and recommended-extensions list.

This is PR 3 of the Python tooling bootstrap (continuation plan).

Test plan

Run inside the devcontainer:

  • ruff format --check . clean
  • ruff check . clean
  • ty check clean (1 finding — requests unresolved — fixed by adding uv sync to CI and post-create)
  • bazel test //... — 11/11 pass
  • bazel run //:gazelle -- -mode=diff clean
  • pre-commit run --all-files clean

CI:

  • ty job green on first push
  • build-and-test-per-target rows gate on the new needs: entry

[tool.ty] in root pyproject.toml; ty installed in the devcontainer via
`uv tool install` alongside ruff; new `ty` CI job runs `uv sync` then
`uvx ty@<pin> check`. post-create.sh runs `uv sync` so the editor's
ty extension has a .venv to resolve against. Renovate's workflow-yaml
regex widened to track the TY_VERSION env-var pin. README updated with
the new CI row, on-save row, and recommended extension.
@Syndic Syndic merged commit 0475b16 into main Jun 15, 2026
24 checks passed
@Syndic Syndic deleted the pr/python-ty branch June 15, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant