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

pantsbuild / pants / 20328535594

18 Dec 2025 06:46AM UTC coverage: 57.969% (-22.3%) from 80.295%
20328535594

Pull #22954

github

web-flow
Merge ccc9c5409 into 407284c67
Pull Request #22954: free up disk space in runner image

39083 of 67421 relevant lines covered (57.97%)

0.91 hits per line

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

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

4
from __future__ import annotations
×
5

6
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
×
7
from pants.backend.python.target_types import ConsoleScript
×
8
from pants.core.util_rules.config_files import ConfigFilesRequest
×
9
from pants.option.option_types import ArgsListOption, FileOption, SkipOption
×
10
from pants.util.strutil import help_text, softwrap
×
11

12

13
class Pytype(PythonToolBase):
×
14
    options_scope = "pytype"
×
15
    name = "Pytype"
×
16
    help_short = help_text(
×
17
        """
18
        The Pytype utility for typechecking Python code
19
        (https://github.com/google/pytype).
20
        """
21
    )
22

23
    default_main = ConsoleScript("pytype")
×
24
    default_requirements = ["pytype==2024.9.13"]
×
25
    default_version = "pytype@2024.9.13"
×
26

27
    register_interpreter_constraints = True
×
28

29
    default_lockfile_resource = ("pants.backend.python.typecheck.pytype", "pytype.lock")
×
30

31
    skip = SkipOption("check")
×
32
    args = ArgsListOption(example="--version")
×
33
    config = FileOption(
×
34
        default=None,
35
        help=softwrap(
36
            """
37
            Path to an toml config file understood by Pytype
38
            (https://github.com/google/pytype#config-file).
39
            """
40
        ),
41
    )
42

43
    def config_request(self) -> ConfigFilesRequest:
×
44
        """Pytype will look for a  `pyproject.toml` (with a `[tool.pytype]` section) in the project
45
        root.
46

47
        Pytype's configuration content is specified here: https://github.com/google/pytype#config-
48
        file.
49
        """
50

51
        return ConfigFilesRequest(
×
52
            discovery=True,
53
            check_existence=[self.config] if self.config else [],
54
            check_content={"pyproject.toml": b"[tool.pytype"},
55
        )
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