• 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/makeself/subsystem.py
1
# Copyright 2024 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
import logging
×
UNCOV
6
from collections.abc import Iterable
×
UNCOV
7
from dataclasses import dataclass
×
8

UNCOV
9
from pants.core.goals.resolves import ExportableTool
×
UNCOV
10
from pants.core.util_rules import external_tool
×
UNCOV
11
from pants.core.util_rules.external_tool import (
×
12
    DownloadedExternalTool,
13
    TemplatedExternalTool,
14
    download_external_tool,
15
)
UNCOV
16
from pants.engine.fs import Digest, RemovePrefix
×
UNCOV
17
from pants.engine.intrinsics import remove_prefix
×
UNCOV
18
from pants.engine.platform import Platform
×
UNCOV
19
from pants.engine.process import execute_process_or_raise
×
UNCOV
20
from pants.engine.rules import Rule, collect_rules, implicitly, rule
×
UNCOV
21
from pants.engine.unions import UnionRule
×
UNCOV
22
from pants.util.logging import LogLevel
×
23

UNCOV
24
logger = logging.getLogger(__name__)
×
25

26

UNCOV
27
class MakeselfSubsystem(TemplatedExternalTool):
×
UNCOV
28
    options_scope = "makeself"
×
UNCOV
29
    help = "A tool to generate a self-extractable compressed tar archives."
×
30

UNCOV
31
    default_version = "2.5.0"
×
UNCOV
32
    default_known_versions = [
×
33
        "2.5.0|macos_arm64|4d2fa9d898be22c63bb3c6bb7cc3dc97237700dea6d6ad898dcbec0289df0bc4|45867",
34
        "2.5.0|macos_x86_64|4d2fa9d898be22c63bb3c6bb7cc3dc97237700dea6d6ad898dcbec0289df0bc4|45867",
35
        "2.5.0|linux_arm64|4d2fa9d898be22c63bb3c6bb7cc3dc97237700dea6d6ad898dcbec0289df0bc4|45867",
36
        "2.5.0|linux_x86_64|4d2fa9d898be22c63bb3c6bb7cc3dc97237700dea6d6ad898dcbec0289df0bc4|45867",
37
    ]
UNCOV
38
    default_url_template = "https://github.com/megastep/makeself/releases/download/release-{version}/makeself-{version}.run"
×
39

40

UNCOV
41
class MakeselfDistribution(DownloadedExternalTool):
×
42
    """The makeself distribution.
43

44
    You can find releases here: https://github.com/megastep/makeself/releases
45
    """
46

47

UNCOV
48
@rule(desc="Download makeself distribution", level=LogLevel.DEBUG)
×
UNCOV
49
async def download_makeself_distribution(
×
50
    options: MakeselfSubsystem,
51
    platform: Platform,
52
) -> MakeselfDistribution:
53
    tool = await download_external_tool(options.get_request(platform))
×
54
    logger.debug("makeself external tool: %s", tool)
×
55
    return MakeselfDistribution(digest=tool.digest, exe=tool.exe)
×
56

57

UNCOV
58
class MakeselfTool(DownloadedExternalTool):
×
59
    """The Makeself tool."""
60

61

UNCOV
62
@dataclass(frozen=True)
×
UNCOV
63
class RunMakeselfArchive:
×
UNCOV
64
    exe: str
×
UNCOV
65
    input_digest: Digest
×
UNCOV
66
    description: str
×
UNCOV
67
    level: LogLevel = LogLevel.INFO
×
UNCOV
68
    output_directory: str | None = None
×
UNCOV
69
    extra_args: tuple[str, ...] | None = None
×
UNCOV
70
    extra_tools: tuple[str, ...] = ()
×
71

72

UNCOV
73
@rule(desc="Extract makeself distribution", level=LogLevel.DEBUG)
×
UNCOV
74
async def extract_makeself_distribution(
×
75
    dist: MakeselfDistribution,
76
) -> MakeselfTool:
77
    out = "__makeself"
×
78
    result = await execute_process_or_raise(
×
79
        **implicitly(
80
            RunMakeselfArchive(
81
                exe=dist.exe,
82
                extra_args=(
83
                    "--keep",
84
                    "--accept",
85
                    "--noprogress",
86
                    "--nox11",
87
                    "--nochown",
88
                    "--nodiskspace",
89
                    "--quiet",
90
                ),
91
                input_digest=dist.digest,
92
                output_directory=out,
93
                description=f"Extracting Makeself archive: {out}",
94
                level=LogLevel.DEBUG,
95
            )
96
        )
97
    )
98
    digest = await remove_prefix(RemovePrefix(result.output_digest, out))
×
99
    return MakeselfTool(digest=digest, exe="makeself.sh")
×
100

101

UNCOV
102
def rules() -> Iterable[Rule | UnionRule]:
×
UNCOV
103
    return (
×
104
        *collect_rules(),
105
        *external_tool.rules(),
106
        UnionRule(ExportableTool, MakeselfSubsystem),
107
    )
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