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

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 hits per line

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

0.0
/src/python/pants/backend/python/lint/pydocstyle/rules.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.python.lint.pydocstyle.subsystem import Pydocstyle, PydocstyleFieldSet
×
UNCOV
7
from pants.backend.python.util_rules import pex
×
UNCOV
8
from pants.backend.python.util_rules.pex import VenvPexProcess, create_venv_pex
×
UNCOV
9
from pants.core.goals.lint import LintResult, LintTargetsRequest
×
UNCOV
10
from pants.core.util_rules.config_files import find_config_file
×
UNCOV
11
from pants.core.util_rules.partitions import PartitionerType
×
UNCOV
12
from pants.core.util_rules.source_files import (
×
13
    SourceFiles,
14
    SourceFilesRequest,
15
    determine_source_files,
16
)
UNCOV
17
from pants.engine.fs import MergeDigests
×
UNCOV
18
from pants.engine.intrinsics import execute_process, merge_digests
×
UNCOV
19
from pants.engine.rules import collect_rules, concurrently, implicitly, rule
×
UNCOV
20
from pants.util.logging import LogLevel
×
UNCOV
21
from pants.util.strutil import pluralize
×
22

23

UNCOV
24
class PydocstyleRequest(LintTargetsRequest):
×
UNCOV
25
    field_set_type = PydocstyleFieldSet
×
UNCOV
26
    tool_subsystem = Pydocstyle  # type: ignore[assignment]
×
UNCOV
27
    partitioner_type = PartitionerType.DEFAULT_SINGLE_PARTITION
×
28

29

UNCOV
30
def generate_argv(source_files: SourceFiles, pydocstyle: Pydocstyle) -> tuple[str, ...]:
×
31
    args: list[str] = []
×
32
    if pydocstyle.config is not None:
×
33
        args.append(f"--config={pydocstyle.config}")
×
34
    args.extend(pydocstyle.args)
×
35
    args.extend(source_files.files)
×
36
    return tuple(args)
×
37

38

UNCOV
39
@rule(desc="Lint with Pydocstyle", level=LogLevel.DEBUG)
×
UNCOV
40
async def pydocstyle_lint(
×
41
    request: PydocstyleRequest.Batch,
42
    pydocstyle: Pydocstyle,
43
) -> LintResult:
44
    pydocstyle_pex_get = create_venv_pex(**implicitly(pydocstyle.to_pex_request()))
×
45
    config_files_get = find_config_file(pydocstyle.config_request)
×
46
    source_files_get = determine_source_files(
×
47
        SourceFilesRequest(field_set.source for field_set in request.elements)
48
    )
49

50
    pydocstyle_pex, config_files, source_files = await concurrently(
×
51
        pydocstyle_pex_get, config_files_get, source_files_get
52
    )
53

54
    input_digest = await merge_digests(
×
55
        MergeDigests((source_files.snapshot.digest, config_files.snapshot.digest))
56
    )
57
    result = await execute_process(
×
58
        **implicitly(
59
            VenvPexProcess(
60
                pydocstyle_pex,
61
                argv=generate_argv(source_files, pydocstyle),
62
                input_digest=input_digest,
63
                description=f"Run Pydocstyle on {pluralize(len(request.elements), 'file')}.",
64
                level=LogLevel.DEBUG,
65
            )
66
        )
67
    )
68
    return LintResult.create(request, result)
×
69

70

UNCOV
71
def rules():
×
UNCOV
72
    return (
×
73
        *collect_rules(),
74
        *PydocstyleRequest.rules(),
75
        *pex.rules(),
76
    )
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

© 2025 Coveralls, Inc