Skip to main content

pants-ty-plugin

This plugin provides a Pants check backend using Ty - the new Python type checker from Astral (makers of uv and ruff).

Installation

This plugin was tested on Python 3.11 and Pants 2.31.0.dev3.

Add the following to your pants.toml file:

[GLOBAL]
plugins = [
    ...
    "robotpajamas.pants.ty",
]

...

backend_packages = [
    ...
    "experimental.ty",
]

Usage

This plugin is even more beta than Ty itself. It's largely just a copy/paste/rename of some existing Pants type checkers, so your mileage may vary.

pants check --only=ty src/foo/bar.py

The hard part of adding a new linter or formatter isn't usually the code itself, it's how to untangle the mess of configurations for the tool and weave them into various Pants-isms (e.g. configurations, interpreter constraints, partitions, environment variables, reasonable defaults, escape hatches, etc...).

FYI

Not without some amusement, I'm unable to type check the Ty plugin itself. The pants dependencies aren't picked up, and whether this relates to some of the namespace_packages bugs that Ty had earlier this year, or that I've missed a configuration - I'm not sure yet. MyPy works though.

Metadata

Release files for robotpajamas.pants.ty 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for robotpajamas.pants.ty 0.0.1
File Interpreter ABI Platform
robotpajamas_pants_ty-0.0.1-py3-none-any.whl Python 3 none any Details

Release files / robotpajamas_pants_ty-0.0.1-py3-none-any.whl

Download URL robotpajamas_pants_ty-0.0.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57a7dbb29f47ca72751fcedf4611225719d63e2b9492fb3a761773f678fba02a
BLAKE2b-256 checksum
How to use checksums
1cc13ca84bcf5ce9e4004e949482351f1b5323a797d11523eb8ed29e579eef5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page