mrkeyoor.com_
Mon 21 Sept 02:02 UTC
PyPIUtilsupdated 18 Sept 2026

pyright review

The PyPI package named pyright is an independent Python command wrapper around Microsoft's TypeScript-based Pyright type checker. It lets Python-only toolchains invoke pyright or python -m pyright, finds Node on PATH, and can build a cached Node environment and install the matching npm package when Node is absent. Version 1.1.411 tracks upstream Pyright 1.1.411, whose release fixes narrowing and reachability cases, recognizes dataclass KW_ONLY under any variable name, handles symlinked partial stubs, and updates typeshed.

Verdict

pyright 1.1.411 installed in 1 second and occupied 39 MB across 3 packages in our sandbox; import worked and pip-audit found 0 known vulnerabilities, but we did not measure a checker run. Install this wrapper when Python tooling must own Pyright installation, and use the npm package directly when Node already owns the toolchain.

We installed it

Lab card: what happened when we installed pyrightScreenshot of pyright documentation
Install✓ · 1s3 packages on disk · 39 MB
Importimport pyright in 0.31s · pure Python · py.typed · requires Python >=3.7
Known vulns0(pip-audit)

Answers from our run

Does pyright install cleanly?

Yes. In a fresh container with an empty cache, pip install pyright finished in 1 seconds, leaving 3 packages and 39 MB on disk. pip-audit reported no known vulnerabilities.

What does pyright need to run?

Python >=3.7, and nothing compiled: it is pure Python. In our run import pyright succeeded in 0.31s, and the package ships py.typed for type checkers.

pyright or mypy: which should you use?

mypy: Choose it for a Python-native checker with a large plugin ecosystem and established gradual-typing workflows. pyright 1.1.411 installed in 1 second and occupied 39 MB across 3 packages in our sandbox; import worked and pip-audit found 0 known vulnerabilities, but we did not measure a checker run.

When should you not use pyright?

Your Node toolchain already installs microsoft/pyright from npm; this wrapper adds another version and cache layer around the same checker.

API stability4/5The wrapper exposes stable pyright and pyright-langserver commands plus python -m pyright, while its version mirrors upstream. Environment variables for cache, Node selection, forced versions, Pylance matching, debug output, and warnings are documented. The checker diagnostics can change with typeshed and inference fixes in each upstream release, so pin 1.1.411 and review new findings during upgrades.
Docs4/5The wrapper README explains its Node discovery, nodeenv fallback, npm installation, cache locations, nodejs extra, command forms, version overrides, Pylance mapping, and pre-commit isolation problem. It correctly sends checker configuration to Microsoft's upstream manual. Users must combine both documents, and the wrapper page does not promise that importing the Python module has prepared the JavaScript checker for an offline first run.
Maintenance4/5The wrapper repository was not archived, had 277 stars and 24 open issues and pull requests, and recorded an August 15, 2026 push. Version 1.1.411 was released within hours of the matching upstream release on June 25. Automated version tracking keeps it current, although the project explicitly says it is unaffiliated with Microsoft and must adapt whenever upstream packaging or Node requirements change.
Ecosystem4/5The current dataset records 9,510,256 weekly downloads. Pyright is widely used through editors, Pylance, CI, pre-commit, and command-line checks, while this package makes it installable through pip. The wrapper ships py.typed and supports Python 3.7 as its own runtime. Its 39 MB measured footprint and Node or npm first-run path are meaningful costs for an otherwise Python-only environment.

Use it if

  • A Python requirements file, tox environment, or pre-commit hook must install the Pyright CLI without a separate npm step.
  • You want the wrapper release pinned to the same numbered upstream Pyright release.
  • The machine can use system Node or cache a wrapper-managed Node and npm installation.
  • A pyproject.toml or pyrightconfig.json should hold strictness, include paths, exclusions, and virtual-environment discovery.
Skip it if

Setup reality

Our fresh Python 3.12 install of pyright 1.1.411 completed in 1 second and left 3 packages using 39 MB. import pyright worked in 0.31 seconds. The wrapper is pure Python, declares 6 direct dependencies, requires Python 3.7 or newer, and ships py.typed. Our pip-audit run found 0 known vulnerabilities. This measurement tested the import, not a full type-check run.

The first pyright command may do more than the pip install suggests. When Node is missing from PATH, the wrapper uses nodeenv, installs the pyright npm package, and caches the result under PYRIGHT_PYTHON_CACHE_DIR, XDG_CACHE_HOME, or ~/.cache. The README recommends pyright[nodejs], backed by nodejs-wheel, as the more reliable way to supply Node. Offline CI should preinstall the chosen path.

Configuration comes from pyrightconfig.json or [tool.pyright] in pyproject.toml. Set include and exclude paths, typeCheckingMode, pythonVersion, and diagnostic rules there. For a project virtualenv, point venvPath at its parent and venv at the environment name. A pre-commit hook creates its own environment, so unresolved imports are expected unless you expose the project environment or install required packages into the hook.

PYRIGHT_PYTHON_FORCE_VERSION can override the bundled target, including latest, and PYRIGHT_PYTHON_PYLANCE_VERSION can choose the Pyright build matching a Pylance release. The force setting wins when both exist. Those overrides reduce reproducibility, so pin 1.1.411 in CI and update deliberately. Version 1.1.411 includes upstream fixes for generic context-manager reachability, NamedTuple narrowing, NewType comparisons, partial-stub symlinks, and dataclass KW_ONLY detection.

Patterns

Check the current project install-and-run

pip install 'pyright[nodejs]'
pyright src/
python -m pyright --version

This command may prepare Node and the npm checker on its first run. Cache that setup before an offline CI stage.

Run the wrapper as a Python module configure-pyproject

[tool.pyright]
include = ['src']
typeCheckingMode = 'standard'
pythonVersion = '3.12'
venvPath = '.'
venv = '.venv'

python -m pyright and the pyright console script reach the same wrapper, which is useful when PATH scripts are unavailable.

Set strict checking in pyproject.toml configure-json

{
  "include": ["src"],
  "exclude": ["**/__pycache__", ".venv"],
  "typeCheckingMode": "basic",
  "strict": ["src/core"],
  "pythonVersion": "3.12"
}

typeCheckingMode is a baseline. Individual diagnostic rules can still be raised, lowered, or disabled for a staged migration.

Point Pyright at the project virtualenv pin-upstream-version

export PYRIGHT_PYTHON_FORCE_VERSION=1.1.411
pyright src/

venvPath names the parent directory and venv names one environment inside it. Do not put a machine-specific absolute path in shared config.

Pin the pre-commit hook release cache-ci-downloads

export PYRIGHT_PYTHON_CACHE_DIR="$CI_PROJECT_DIR/.cache/pyright"
pyright --outputjson src/ > pyright-report.json

The hook has an isolated Python environment. Add dependencies there or configure the checker to inspect the project's virtualenv.

Store downloaded tooling in a CI cache run-pre-commit

repos:
  - repo: https://github.com/RobertCraigie/pyright-python
    rev: v1.1.411
    hooks:
      - id: pyright
        additional_dependencies:
          - pydantic
          - pytest

PYRIGHT_PYTHON_CACHE_DIR controls the wrapper cache. Key the cache by wrapper version and platform to avoid stale Node or npm contents.

Select the Pyright version explicitly suppress-one-diagnostic

value = legacy_call()  # pyright: ignore[reportUnknownVariableType]

Using latest makes diagnostics change without a requirements update. Prefer an exact version in CI and upgrade through a reviewed change.

Emit machine-readable diagnostics watch-source-tree

pyright --watch src/

JSON output is suitable for CI parsing. Treat the command exit status as authoritative and keep human formatting out of the parser.

Alternatives

PackageRegistryPick it when
mypyPyPIChoose it for a Python-native checker with a large plugin ecosystem and established gradual-typing workflows.
basedpyrightPyPIChoose it for a Pyright fork with extra diagnostics and configuration changes packaged for Python users.
pyreflyPyPIChoose it when you want a newer high-performance checker and can accept a younger compatibility surface.

More utils guides

lru-cache · ajv · type-fest · p-limit · find-up · js-yaml · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.