pyright README

The project's README from github.com/microsoft/pyright. As one markdown file: README.md.

Pyright

Static Type Checker for Python

Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases.

Pyright includes both a command-line tool and an extension for Visual Studio Code.

Pyright Playground

Try Pyright in your browser using the Pyright Playground.

Documentation

Refer to the documentation for installation, configuration, and usage details.

Environment variables

If Pyright fails to create a temporary directory (for example in remote/server environments where the OS temp directory doesn't exist or isn't writable), you can override the temp directory root:

Pyright otherwise relies on the platform temp directory (for example TMPDIR, TMP, TEMP, or the OS default).

Community

Do you have questions about Pyright or Python type annotations in general? Post your questions in the discussion section.

If you would like to report a bug or request an enhancement, file a new issue in either the pyright or pylance-release issue tracker. In general, core type checking functionality is associated with Pyright while language service functionality is associated with Pylance, but the same contributors monitor both repos. For best results, provide the information requested in the issue template.

Contributing

This project welcomes contributions and suggestions. For feature and complex bug fix contributions, it is recommended that you first discuss the proposed change with Pyright’s maintainers before submitting the pull request. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

pyright (microsoft/pyright)

Searching Database…

15.7K ·GitHub
这是什么?Pyright 是微软开发的一个功能齐全、基于标准的 Python 静态类型检查工具,专为在大型代码库上保持高速度而设计。
它是命令行工具、编辑器插件,还是两者都有?两者都有:它既可以作为命令行工具使用,也提供 Visual Studio Code 扩展,另外还有一个浏览器版 Playground,方便快速试用。
我怎么把它跑起来?README 会引导你到项目文档里查看安装、配置和使用方法;如果不想安装就想先体验一下,可以使用在浏览器里运行的 Pyright Playground。
它和它检查的代码一样是用 Python 写的吗?不是——虽然检查的是 Python 代码,Pyright 本身却是一个 TypeScript 项目:这个仓库在 Node.js 工具链上用 pnpm、lerna 和 webpack 构建。
有没有什么环境上的坑需要提前知道,比如在服务器或容器里?在操作系统的临时目录不存在或不可写的远程/服务器环境里,需要把 PYRIGHTTMPDIR 环境变量设置为一个绝对路径——Pyright 会创建该目录并用它存放临时文件。
它能应付很大的代码库吗?能——性能本来就是设计目标之一,Pyright 就是明确为配合大型 Python 源码库使用而构建的。
它支持哪些平台?命令行工具和 VS Code 扩展都能在 Windows、macOS 和 Linux 上运行,所以不管什么操作系统,常见的开发环境都能覆盖。
Pyright 和 Pylance 有什么区别?核心类型检查功能归在 Pyright 名下,语言服务功能则归在 Pylance 名下;两边的维护者是同一批人,所以问题报在哪个仓库的 issue 里都可以。
不安装任何东西也能试用吗?可以——Pyright Playground 直接在浏览器里运行,你可以在安装命令行工具或 VS Code 扩展之前先体验它的类型检查功能。
我必须用 VS Code 才能从它那里受益吗?不用——命令行工具可以在任何终端里独立运行,本地或 CI 里都行;VS Code 扩展只是额外提供了编辑器内的使用体验。
What are similar projects?mypy, fallow, rector, ruff, infer, semgrep, TypeScript, standard
Creator
microsoft
Size
137.1 MB
Stars
15.7K
Age
7y
Commits · 90 Days