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

pantsbuild / pants / 21552830208

31 Jan 2026 11:40PM UTC coverage: 80.277% (-0.05%) from 80.324%
21552830208

Pull #23062

github

web-flow
Merge 808a9786c into 2c4dcf9cf
Pull Request #23062: Remove support for Get

18 of 25 new or added lines in 4 files covered. (72.0%)

17119 existing lines in 541 files now uncovered.

78278 of 97510 relevant lines covered (80.28%)

3.36 hits per line

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

100.0
/src/python/pants/backend/google_cloud_function/python/rules.py
1
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
1✔
5

UNCOV
6
import logging
1✔
UNCOV
7
from dataclasses import dataclass
1✔
8

UNCOV
9
from pants.backend.google_cloud_function.python.target_types import (
1✔
10
    PythonGoogleCloudFunction,
11
    PythonGoogleCloudFunctionHandlerField,
12
    PythonGoogleCloudFunctionRuntime,
13
    PythonGoogleCloudFunctionType,
14
)
UNCOV
15
from pants.backend.python.util_rules.faas import (
1✔
16
    BuildPythonFaaSRequest,
17
    FaaSArchitecture,
18
    PythonFaaSCompletePlatforms,
19
    PythonFaaSLayoutField,
20
    PythonFaaSPex3VenvCreateExtraArgsField,
21
    PythonFaaSPexBuildExtraArgs,
22
    build_python_faas,
23
)
UNCOV
24
from pants.backend.python.util_rules.faas import rules as faas_rules
1✔
UNCOV
25
from pants.core.environments.target_types import EnvironmentField
1✔
UNCOV
26
from pants.core.goals.package import BuiltPackage, OutputPathField, PackageFieldSet
1✔
UNCOV
27
from pants.engine.rules import collect_rules, rule
1✔
UNCOV
28
from pants.engine.unions import UnionRule
1✔
UNCOV
29
from pants.util.logging import LogLevel
1✔
30

UNCOV
31
logger = logging.getLogger(__name__)
1✔
32

33

UNCOV
34
@dataclass(frozen=True)
1✔
UNCOV
35
class PythonGoogleCloudFunctionFieldSet(PackageFieldSet):
1✔
UNCOV
36
    required_fields = (PythonGoogleCloudFunctionHandlerField,)
1✔
37

UNCOV
38
    handler: PythonGoogleCloudFunctionHandlerField
1✔
UNCOV
39
    runtime: PythonGoogleCloudFunctionRuntime
1✔
UNCOV
40
    complete_platforms: PythonFaaSCompletePlatforms
1✔
UNCOV
41
    pex3_venv_create_extra_args: PythonFaaSPex3VenvCreateExtraArgsField
1✔
UNCOV
42
    pex_build_extra_args: PythonFaaSPexBuildExtraArgs
1✔
UNCOV
43
    layout: PythonFaaSLayoutField
1✔
UNCOV
44
    type: PythonGoogleCloudFunctionType
1✔
UNCOV
45
    output_path: OutputPathField
1✔
UNCOV
46
    environment: EnvironmentField
1✔
47

48

UNCOV
49
@rule(desc="Create Python Google Cloud Function", level=LogLevel.DEBUG)
1✔
UNCOV
50
async def package_python_google_cloud_function(
1✔
51
    field_set: PythonGoogleCloudFunctionFieldSet,
52
) -> BuiltPackage:
UNCOV
53
    return await build_python_faas(
1✔
54
        BuildPythonFaaSRequest(
55
            address=field_set.address,
56
            target_name=PythonGoogleCloudFunction.alias,
57
            complete_platforms=field_set.complete_platforms,
58
            runtime=field_set.runtime,
59
            # GCF only supports x86_64 architecture for now.
60
            architecture=FaaSArchitecture.X86_64,
61
            handler=field_set.handler,
62
            pex3_venv_create_extra_args=field_set.pex3_venv_create_extra_args,
63
            pex_build_extra_args=field_set.pex_build_extra_args,
64
            layout=field_set.layout,
65
            output_path=field_set.output_path,
66
            include_requirements=True,
67
            include_sources=True,
68
            reexported_handler_module=PythonGoogleCloudFunctionHandlerField.reexported_handler_module,
69
            log_only_reexported_handler_func=True,
70
        )
71
    )
72

73

UNCOV
74
def rules():
1✔
UNCOV
75
    return [
1✔
76
        *collect_rules(),
77
        UnionRule(PackageFieldSet, PythonGoogleCloudFunctionFieldSet),
78
        *faas_rules(),
79
    ]
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