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

pantsbuild / pants / 24560789611

17 Apr 2026 10:35AM UTC coverage: 52.377% (-40.5%) from 92.924%
24560789611

Pull #23268

github

web-flow
Merge a1d019376 into a92bc34b6
Pull Request #23268: pref: Remove python coroutine/trampoline overhead in awaits for ~22% faster `dependencies` goal

29 of 37 new or added lines in 4 files covered. (78.38%)

23045 existing lines in 605 files now uncovered.

31649 of 60425 relevant lines covered (52.38%)

0.52 hits per line

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

92.86
/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).
3
from __future__ import annotations
1✔
4

5
from dataclasses import dataclass
1✔
6

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

13

14
@union(in_scope_types=[EnvironmentName])
1✔
15
@dataclass(frozen=True)
1✔
16
class GoModuleImportPathsMappingsHook:
1✔
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

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

29

30
@dataclass(frozen=True)
1✔
31
class GoModuleImportPathsMapping:
1✔
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

35
    mapping: FrozenDict[str, GoImportPathsMappingAddressSet]
1✔
36
    address_to_import_path: FrozenDict[Address, str]
1✔
37

38

39
@dataclass(frozen=True)
1✔
40
class GoModuleImportPathsMappings:
1✔
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

47
    modules: FrozenDict[Address, GoModuleImportPathsMapping]
1✔
48

49

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

56

57
class AllGoModuleImportPathsMappings(GoModuleImportPathsMappings):
1✔
58
    pass
1✔
59

60

61
def rules():
1✔
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

© 2026 Coveralls, Inc