pyright 1.1.406


pip install pyright

  Latest version

Released: Oct 02, 2025


Meta
Author: Robert Craigie
Maintainer: Robert Craigie
Requires Python: >=3.7

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Typing
  • Typed

Topic
  • Software Development :: Libraries :: Python Modules

Programming Language
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12

Pyright for Python

Downloads PyPI Supported python versions

This project is not affiliated with Microsoft in any way, shape, or form

Pyright for Python is a Python command-line wrapper over pyright, a static type checker for Python.

Installation

Use the package manager pip to install pyright.

pip install pyright

[!TIP] It's highly recommended to install pyright with the nodejs extra which uses nodejs-wheel to download Node.js binaries as it is more reliable than the default nodeenv solution.

pip install pyright[nodejs]

Usage

Pyright can be invoked using two different methods

pyright --help

or

python3 -m pyright --help

Pyright for Python should work exactly the same as pyright does, see the pyright documentation for details on how to make use of pyright.

Pre-commit

You can also setup pyright to run automatically before each commit by setting up pre-commit and registering pyright in your .pre-commit-config.yaml file

repos:
  - repo: https://github.com/RobertCraigie/pyright-python
    rev: v1.1.406
    hooks:
    - id: pyright

Pre-commit will install pyright-python in its own virtual environment which can cause pyright to not be able to detect your installed dependencies.

To fix this you can either tell pre-commit to also install those dependencies or explicitly tell pyright which virtual environment to use by updating your pyright configuration file:

[tool.pyright]
# ...
venvPath = "."
venv = ".venv"

Motivation

Pyright is written in TypeScript, requiring node to be installed, and is normally installed with npm. This could be an entry barrier for some Python developers as they may not have node or npm installed on their machine; I wanted to make pyright as easy to install as any normal Python package.

How Pyright for Python Works

This project works by first checking if node is in the PATH. If it is not, then we download node at runtime using nodeenv, then install the pyright npm package using npm and finally, run the downloaded JS with node.

Automatically keeping pyright up to date

By default Pyright for Python is set to target a specific pyright version and new releases will be automatically created whenever a new pyright version is released. It is highly recommended to use an automatic dependency update tool such as dependabot.

If you would rather not have to update your installation every time a new pyright release is created then you can automatically use the latest available pyright version by setting the environment variable PYRIGHT_PYTHON_FORCE_VERSION to latest.

Configuration

You can configure Pyright for Python using environment variables.

Debugging

Set PYRIGHT_PYTHON_DEBUG to any value.

Modify Pyright Version

Set PYRIGHT_PYTHON_FORCE_VERSION to the desired version, e.g. 1.1.156, latest

Keeping Pyright and Pylance in sync

Set PYRIGHT_PYTHON_PYLANCE_VERSION to your Pylance version, e.g. 2023.11.11, latest-release, latest-prerelease. The corresponding Pyright version will be used. See Pylance's changelog for details on recent releases. Note that PYRIGHT_PYTHON_FORCE_VERSION takes precedence over PYRIGHT_PYTHON_PYLANCE_VERSION, so you'll want to set one or the other, not both.

Show NPM logs

By default, Pyright for Python disables npm error messages, if you want to display the npm error messages then set PYRIGHT_PYTHON_VERBOSE to any truthy value.

Modify NPM Package Location

Pyright for Python will resolve the root cache directory by checking the following environment variables, in order:

  • PYRIGHT_PYTHON_CACHE_DIR
  • XDG_CACHE_HOME

If neither of them are set it defaults to ~/.cache

Force Node Env

Set PYRIGHT_PYTHON_GLOBAL_NODE to any non-truthy value, i.e. anything apart from 1, t, on, or true. e.g. off You can optionally choose the version of node used by setting PYRIGHT_PYTHON_NODE_VERSION to the desired version

Modify Node Env Location

Set PYRIGHT_PYTHON_ENV_DIR to a valid nodeenv directory. e.g. ~/.cache/nodeenv

Ignore Warnings

Set PYRIGHT_PYTHON_IGNORE_WARNINGS to a truthy value, e.g. 1, t, on, or true.

Pyright for Python will print warnings for the following case(s)

  • There is a new Pyright version available.

Contributing

All pull requests are welcome.

License

MIT

1.1.406 Oct 02, 2025
1.1.405 Sep 04, 2025
1.1.404 Aug 20, 2025
1.1.403 Jul 09, 2025
1.1.402 Jun 11, 2025
1.1.401 May 21, 2025
1.1.400 Apr 24, 2025
1.1.399 Apr 10, 2025
1.1.398 Mar 26, 2025
1.1.397 Mar 19, 2025
1.1.396 Mar 02, 2025
1.1.395 Feb 27, 2025
1.1.394 Feb 12, 2025
1.1.393 Jan 29, 2025
1.1.392.post0 Jan 15, 2025
1.1.392 Jan 15, 2025
1.1.391 Dec 18, 2024
1.1.390 Dec 04, 2024
1.1.389 Nov 13, 2024
1.1.388 Nov 06, 2024
1.1.387 Oct 30, 2024
1.1.386 Oct 23, 2024
1.1.385 Oct 16, 2024
1.1.384 Oct 09, 2024
1.1.383 Oct 02, 2024
1.1.382.post1 Sep 27, 2024
1.1.382.post0 Sep 25, 2024
1.1.382 Sep 25, 2024
1.1.381 Sep 18, 2024
1.1.380 Sep 11, 2024
1.1.379 Sep 04, 2024
1.1.378 Aug 28, 2024
1.1.377 Aug 21, 2024
1.1.376 Aug 14, 2024
1.1.375 Aug 07, 2024
1.1.374 Jul 31, 2024
1.1.373 Jul 24, 2024
1.1.372 Jul 17, 2024
1.1.371 Jul 10, 2024
1.1.370 Jul 03, 2024
1.1.369 Jun 25, 2024
1.1.368 Jun 19, 2024
1.1.367 Jun 12, 2024
1.1.366 Jun 05, 2024
1.1.365 May 29, 2024
1.1.364 May 22, 2024
1.1.363 May 15, 2024
1.1.362 May 08, 2024
1.1.361 May 01, 2024
1.1.360 Apr 24, 2024
1.1.359 Apr 17, 2024
1.1.358 Apr 10, 2024
1.1.357 Apr 03, 2024
1.1.356 Mar 27, 2024
1.1.355 Mar 20, 2024
1.1.354 Mar 13, 2024
1.1.353 Mar 08, 2024
1.1.352 Feb 29, 2024
1.1.351 Feb 19, 2024
1.1.350 Feb 05, 2024
1.1.349 Jan 29, 2024
1.1.348 Jan 21, 2024
1.1.347 Jan 15, 2024
1.1.346 Jan 15, 2024
1.1.345 Jan 08, 2024
1.1.344 Dec 30, 2023
1.1.343 Dec 26, 2023
1.1.342 Dec 20, 2023
1.1.341 Dec 15, 2023
1.1.340 Dec 13, 2023
1.1.339 Dec 06, 2023
1.1.338 Nov 29, 2023
1.1.337 Nov 22, 2023
1.1.336 Nov 15, 2023
1.1.335 Nov 08, 2023
1.1.334 Nov 02, 2023
1.1.333 Oct 25, 2023
1.1.332 Oct 18, 2023
1.1.331 Oct 11, 2023
1.1.330.post0 Oct 07, 2023
1.1.330 Oct 07, 2023
1.1.329 Sep 27, 2023
1.1.328 Sep 26, 2023
1.1.327 Sep 14, 2023
1.1.326 Sep 07, 2023
1.1.325 Aug 30, 2023
1.1.324 Aug 23, 2023
1.1.323 Aug 16, 2023
1.1.322 Aug 12, 2023
1.1.321 Aug 09, 2023
1.1.320 Aug 02, 2023
1.1.318 Jul 21, 2023
1.1.317 Jul 12, 2023
1.1.316 Jun 26, 2023
1.1.315 Jun 21, 2023
1.1.314 Jun 14, 2023
1.1.313 Jun 07, 2023
1.1.312 Jun 07, 2023
1.1.311 May 31, 2023
1.1.310 May 25, 2023
1.1.309 May 18, 2023
1.1.308 May 12, 2023
1.1.307 May 10, 2023
1.1.306 May 03, 2023
1.1.305 Apr 27, 2023
1.1.304 Apr 20, 2023
1.1.303 Apr 14, 2023
1.1.302 Apr 05, 2023
1.1.301 Mar 29, 2023
1.1.300 Mar 22, 2023
1.1.299 Mar 15, 2023
1.1.298 Mar 08, 2023
1.1.297 Mar 08, 2023
1.1.296 Feb 28, 2023
1.1.295 Feb 22, 2023
1.1.294 Feb 15, 2023
1.1.293 Feb 08, 2023
1.1.292 Feb 01, 2023
1.1.291 Jan 25, 2023
1.1.290 Jan 18, 2023
1.1.289 Jan 14, 2023
1.1.288 Jan 11, 2023
1.1.287 Jan 04, 2023
1.1.286 Dec 28, 2022
1.1.285 Dec 21, 2022
1.1.284 Dec 14, 2022
1.1.283 Dec 07, 2022
1.1.282 Nov 30, 2022
1.1.281 Nov 23, 2022
1.1.280 Nov 16, 2022
1.1.279 Nov 09, 2022
1.1.278 Nov 02, 2022
1.1.277 Oct 26, 2022
1.1.276 Oct 19, 2022
1.1.275 Oct 12, 2022
1.1.274 Oct 05, 2022
1.1.273 Sep 28, 2022
1.1.272 Sep 21, 2022
1.1.271 Sep 14, 2022
1.1.270 Sep 07, 2022
1.1.269 Aug 31, 2022
1.1.268 Aug 24, 2022
1.1.267 Aug 17, 2022
1.1.266 Aug 08, 2022
1.1.265 Aug 03, 2022
1.1.264 Jul 27, 2022
1.1.263 Jul 23, 2022
1.1.262 Jul 20, 2022
1.1.261 Jul 16, 2022
1.1.260 Jul 13, 2022
1.1.259 Jul 13, 2022
1.1.258 Jul 09, 2022
1.1.257 Jul 03, 2022
1.1.256 Jun 28, 2022
1.1.255 Jun 20, 2022
1.1.254 Jun 12, 2022
1.1.253 Jun 08, 2022
1.1.252 Jun 05, 2022
1.1.251 Jun 01, 2022
1.1.250 May 29, 2022
1.1.249 May 25, 2022
1.1.248 May 21, 2022
1.1.247 May 14, 2022
1.1.246 May 11, 2022
1.1.245 May 07, 2022
1.1.244 May 04, 2022
1.1.243 May 02, 2022
1.1.242 Apr 30, 2022
1.1.241 Apr 27, 2022
1.1.239 Apr 20, 2022
1.1.238 Apr 16, 2022
1.1.237 Apr 13, 2022
1.1.236 Apr 10, 2022
1.1.235 Apr 04, 2022
1.1.234 Mar 30, 2022
1.1.233 Mar 27, 2022
1.1.232 Mar 23, 2022
1.1.231 Mar 19, 2022
1.1.230 Mar 16, 2022
1.1.229 Mar 12, 2022
1.1.228 Mar 09, 2022
1.1.227 Mar 05, 2022
1.1.226 Mar 02, 2022
1.1.225 Feb 26, 2022
1.1.224.post1 Feb 26, 2022
1.1.224.post0 Feb 25, 2022
1.1.224 Feb 25, 2022
0.0.13.post0 Feb 25, 2022
0.0.13 Nov 25, 2021
0.0.12 Nov 05, 2021
0.0.11 Nov 01, 2021
0.0.10 Sep 26, 2021
0.0.9 Aug 22, 2021
0.0.8 Aug 09, 2021
0.0.7 Aug 02, 2021
0.0.6 Jul 30, 2021
0.0.5 Jul 19, 2021
0.0.4 Jul 11, 2021
0.0.3 Jul 10, 2021
0.0.2 Jul 02, 2021
0.0.1 Jun 20, 2021

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
nodeenv (>=1.6.0)
typing-extensions (>=4.1)