• 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/go/dependency_inference.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
UNCOV
3
from __future__ import annotations
×
4

UNCOV
5
from dataclasses import dataclass
×
6

UNCOV
7
from pants.build_graph.address import Address
×
UNCOV
8
from pants.engine.environment import EnvironmentName
×
UNCOV
9
from pants.engine.rules import collect_rules, rule
×
UNCOV
10
from pants.engine.unions import union
×
UNCOV
11
from pants.util.frozendict import FrozenDict
×
12

13

UNCOV
14
@union(in_scope_types=[EnvironmentName])
×
UNCOV
15
@dataclass(frozen=True)
×
UNCOV
16
class GoModuleImportPathsMappingsHook:
×
17
    """An entry point for a specific implementation of mapping Go import paths to owning targets.
18

19
    All implementations will be merged together. The core Go dependency inference rules will request
20
    the `GoModuleImportPathsMappings` type using implementations of this union.
21
    """
22

23

UNCOV
24
@dataclass(frozen=True)
×
UNCOV
25
class GoImportPathsMappingAddressSet:
×
UNCOV
26
    addresses: tuple[Address, ...]
×
UNCOV
27
    infer_all: bool
×
28

29

UNCOV
30
@dataclass(frozen=True)
×
UNCOV
31
class GoModuleImportPathsMapping:
×
32
    """Maps import paths (as strings) to one or more addresses of targets providing those import
33
    path(s) for a single Go module."""
34

UNCOV
35
    mapping: FrozenDict[str, GoImportPathsMappingAddressSet]
×
UNCOV
36
    address_to_import_path: FrozenDict[Address, str]
×
37

38

UNCOV
39
@dataclass(frozen=True)
×
UNCOV
40
class GoModuleImportPathsMappings:
×
41
    """Import path mappings for all Go modules in the repository.
42

43
    This type is requested from plugins which provide implementations for the GoCodegenBuildRequest
44
    union and then merged.
45
    """
46

UNCOV
47
    modules: FrozenDict[Address, GoModuleImportPathsMapping]
×
48

49

UNCOV
50
@rule(polymorphic=True)
×
UNCOV
51
async def get_go_module_import_paths_mapping(
×
52
    req: GoModuleImportPathsMappingsHook, env_name: EnvironmentName
53
) -> GoModuleImportPathsMappings:
54
    raise NotImplementedError()
×
55

56

UNCOV
57
class AllGoModuleImportPathsMappings(GoModuleImportPathsMappings):
×
UNCOV
58
    pass
×
59

60

UNCOV
61
def rules():
×
UNCOV
62
    return collect_rules()
×
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