Skip to main content
Version: 2.23 (prerelease)

pyright


The Pyright utility for typechecking Python code (https://github.com/microsoft/pyright).

Backend: pants.backend.experimental.python.typecheck.pyright

Config section: [pyright]

Basic options

args

--pyright-args="[<shell_str>, <shell_str>, ...]"
PANTS_PYRIGHT_ARGS
pants.toml
[pyright]
args = [
<shell_str>,
<shell_str>,
...,
]
default: []

Arguments to pass directly to Pyright, e.g. --pyright-args='--version'.

skip

--[no-]pyright-skip
PANTS_PYRIGHT_SKIP
pants.toml
[pyright]
skip = <bool>
default: False

If true, don't use Pyright when running pants check.

Advanced options

install_from_resolve

--pyright-install-from-resolve=<str>
PANTS_PYRIGHT_INSTALL_FROM_RESOLVE
pants.toml
[pyright]
install_from_resolve = <str>
default: None

If specified, install the tool using the lockfile for this named resolve, instead of the version configured in this subsystem.

If unspecified, the tool will use the default configured package manager [nodejs].package_manager`, and install the tool without a lockfile.

interpreter_constraints

--pyright-interpreter-constraints="['<str>', '<str>', ...]"
PANTS_PYRIGHT_INTERPRETER_CONSTRAINTS
pants.toml
[pyright]
interpreter_constraints = [
'<str>',
'<str>',
...,
]
default:
[
  "CPython>=3.7,<4"
]

Python interpreter constraints for Pyright (which is, itself, a NodeJS tool).

version

--pyright-version=<str>
PANTS_PYRIGHT_VERSION
pants.toml
[pyright]
version = <str>
default: [email protected]

Version string for the tool in the form package@version (e.g. [email protected])

Deprecated options

None

None