ty README

The project's README from github.com/astral-sh/ty. As one markdown file: README.md.

ty

ty PyPI Discord

An extremely fast Python type checker and language server, written in Rust.


Shows a bar chart with benchmark results.

Type checking the home-assistant project without caching.


ty is backed by Astral, the creators of uv and Ruff.

ty is currently in beta.

Highlights

Getting started

Run ty with uvx to get started quickly:

uvx ty check

Or, check out the ty playground to try it out in your browser.

To learn more about using ty, see the documentation.

Installation

To install ty, see the installation documentation.

To add the ty language server to your editor, see the editor integration guide.

Getting help

If you have questions or want to report a bug, please open an issue in this repository.

You may also join our Discord server.

Contributing

Development of this project takes place in the Ruff repository at this time. Please open pull requests there for changes to anything in the ruff submodule (which includes all of the Rust source code).

See the contributing guide for more details.

Version policy

ty uses 0.0.x versioning. ty does not yet have a stable API; breaking changes, including changes to diagnostics, may occur between any two versions. See the type system support tracking issue for a detailed overview of currently supported features.

For information on the timeline, you can check out the Stable milestone.

FAQ

Which Python versions does ty support?

ty officially supports type checking code that targets Python 3.10 and later. Earlier versions (Python 3.7 through 3.9) can still be selected, but may result in false negatives or false positives due to a lack of bundled standard library stubs.

The target version is independent of the Python version used to install ty. For example, ty installed from PyPI using Python 3.8 or later can type check code targeting Python 3.7; the standalone installer does not require Python at all.

Why is ty doing _____?

See our typing FAQ.

How do you pronounce ty?

It's pronounced as "tee - why" (/tiː waɪ/)

How should I stylize ty?

Just "ty", please.

License

ty is licensed under the MIT license (LICENSE or https://opensource.org/licenses/MIT).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in ty by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

Made by Astral

ty (astral-sh/ty)

Searching Database…

19.9K ·GitHub
这是什么?ty 是一个用 Rust 编写的极快的 Python 类型检查器和语言服务器,由 Astral(uv 和 Ruff 背后的团队)开发。目前处于测试版阶段。
我是把 ty 当作 Python 库导入使用,还是单独运行?ty 不是可以导入的 Python 包;它是一个独立的命令行类型检查工具,同时也是语言服务器(LSP),VS Code、PyCharm 和 Neovim 等编辑器可以连接到它。
怎样让 ty 运行起来?最快的方法是运行 `uvx ty`,它会自动获取并运行 ty,无需单独的安装步骤。在安装之前,你也可以直接在基于浏览器的 Playground 中即时试用。
使用 ty 需要先安装 Python 吗?不一定。独立安装程序完全不需要 Python。用于安装 ty 的 Python 版本,也与它所检查的 Python 版本无关。
ty 的稳定性是否足以用于生产环境?还不够。ty 采用 0.0.x 版本号,没有稳定的 API,因此任意两个版本之间都可能出现不兼容的变更,包括诊断信息的变化。
ty 比 mypy 或 Pyright 快多少?项目方称 ty 比 mypy 和 Pyright 快大约 10 到 100 倍,这主要得益于它使用 Rust 编写,以及细粒度的增量分析。
为什么 ty 的开发工作是在 Ruff 仓库中进行的?ty 的 Rust 源代码以子模块的形式存放在 Ruff 仓库中,因此涉及核心检查器的拉取请求是在那里提交的,而不是在 ty 自己的仓库中。
'ty' 应该怎么读?读作 'tee-why'(/tiːwaɪ/),项目方要求只写成 'ty' 这种形式。
What are similar projects?uv, ts-rust, helix, rust-analyzer, LunarVim, YouCompleteMe, ruff, fallow
Creator
astral-sh
Size
5 MB
Stars
19.9K
Age
1y
Commits · 90 Days