• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 21378504907

26 Jan 2026 11:48PM UTC coverage: 43.218% (-37.1%) from 80.269%
21378504907

Pull #23038

github

web-flow
Merge a9ec5051e into 09b8ecaa1
Pull Request #23038: remote cache logger - new plugin to help debug the remote cache

0 of 45 new or added lines in 1 file covered. (0.0%)

17212 existing lines in 540 files now uncovered.

26144 of 60493 relevant lines covered (43.22%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/python/typecheck/pyright/subsystem.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
×
5

UNCOV
6
from pants.backend.javascript.subsystems.nodejs_tool import NodeJSToolBase
×
UNCOV
7
from pants.backend.python.util_rules.interpreter_constraints import InterpreterConstraints
×
UNCOV
8
from pants.core.util_rules.config_files import ConfigFilesRequest
×
UNCOV
9
from pants.option.option_types import ArgsListOption, SkipOption, StrListOption
×
UNCOV
10
from pants.util.strutil import help_text
×
11

12

UNCOV
13
class Pyright(NodeJSToolBase):
×
UNCOV
14
    options_scope = "pyright"
×
UNCOV
15
    name = "Pyright"
×
UNCOV
16
    help = help_text(
×
17
        """
18
        The Pyright utility for typechecking Python code
19
        (https://github.com/microsoft/pyright).
20
        """
21
    )
22

UNCOV
23
    default_version = "pyright@1.1.396"
×
24

UNCOV
25
    skip = SkipOption("check")
×
UNCOV
26
    args = ArgsListOption(example="--version")
×
27

UNCOV
28
    _interpreter_constraints = StrListOption(
×
29
        advanced=True,
30
        default=["CPython>=3.8,<3.15"],
31
        help="Python interpreter constraints for Pyright (which is, itself, a NodeJS tool).",
32
    )
33

UNCOV
34
    @property
×
UNCOV
35
    def interpreter_constraints(self) -> InterpreterConstraints:
×
36
        """The interpreter constraints to use when installing and running the tool.
37

38
        This assumes you have set the class property `register_interpreter_constraints = True`.
39
        """
40
        return InterpreterConstraints(self._interpreter_constraints)
×
41

UNCOV
42
    def config_request(self) -> ConfigFilesRequest:
×
43
        """Pyright will look for a `pyrightconfig.json` or a `pyproject.toml` (with a
44
        `[tool.pyright]` section) in the project root.
45

46
        `pyrightconfig.json` takes precedence if both are present.
47
        Pyright's configuration content is specified here:
48
        https://github.com/microsoft/pyright/blob/main/docs/configuration.md.
49

50
        In order for Pants to work with Pyright, we modify the config file before
51
        putting it in the Pyright digest. Specifically, we append source roots
52
        to `extraPaths` and we overwrite `venv` to point to a pex venv.
53
        """
54

55
        return ConfigFilesRequest(
×
56
            discovery=True,
57
            check_existence=["pyrightconfig.json"],
58
            check_content={"pyproject.toml": b"[tool.pyright"},
59
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc