Please provide the content you want me to translate. I need the text after "Ty" to be able to translate it to Chinese.
Ty

原始链接: https://docs.astral.sh/ty/

## Ty:一款快速的 Python 类型检查器 Ty 是用 Rust 实现的高性能 Python 类型检查器。它旨在提供速度和易用性,提供在线游乐场和使用 `uvx` 的快速入门选项。 要使用 Ty,只需在项目的根目录(包含 `pyproject.toml`)中运行 `ty check` 来分析所有 Python 文件中的类型错误。你也可以指定单个文件路径。 Ty 会自动通过 `VIRTUAL_ENV` 或 `.venv` 目录检测虚拟环境。对于非虚拟环境,请使用 `--python` 标志来指定 Python 解释器。 标准库 `venv` 环境的一个常见初始问题是错误报告过多;解决办法是将 `venv` 目录添加到你的 `.gitignore` 或 `.ignore` 文件中。

相关文章

原文

An extremely fast Python type checker, written in Rust.

Try out the online playground, or run ty with uvx to get started quickly:

For other ways to install ty, see the installation documentation.

If you do not provide a subcommand, ty will list available commands — for detailed information about command-line options, see the CLI reference.

Use the check command to run the type checker:

ty will run on all Python files in the working directory and or subdirectories. If used from a project, ty will run on all Python files in the project (starting in the directory with the pyproject.toml)

You can also provide specific paths to check:

When type checking, ty will find installed packages in the active virtual environment (via VIRTUAL_ENV) or discover a virtual environment named .venv in the project root or working directory. It will not find packages in non-virtual environments without specifying the target path with --python. See the module discovery documentation for details.

Usage

Run ty check, in your project's top-level directory, to check the project for type errors using ty's default configuration.

If this provokes a cascade of errors, and you are using the standard library venv module to provide your virtual environment, add the venv directory to your .gitignore or .ignore file and then retry.

联系我们 contact @ memedata.com