Metadata-Version: 2.4
Name: robotpajamas.pants.ty
Version: 0.0.1
Summary: A Pants plugin adding support for the Ty type checker.
License: Apache License, Version 2.0
Project-URL: Documentation, https://github.com/sureshjoshi/pants-plugins
Project-URL: Source, https://github.com/sureshjoshi/pants-plugins
Project-URL: Tracker, https://github.com/sureshjoshi/pants-plugins/issues
Project-URL: Changelog, https://github.com/sureshjoshi/pants-plugins/blob/main/pants-plugins/experimental/ty/CHANGELOG.md
Keywords: pants,pants-plugin,ty
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.11.0
Description-Content-Type: text/markdown
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# pants-ty-plugin

This plugin provides a Pants `check` backend using [Ty](https://github.com/astral-sh/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:

```toml
[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.
