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

pantsbuild / pants / 18538208066

15 Oct 2025 06:04PM UTC coverage: 53.298% (-27.0%) from 80.267%
18538208066

Pull #22750

github

web-flow
Merge 1f9a15135 into 99919310e
Pull Request #22750: Experiment with `--changed-since` and `--transitive`

1 of 1 new or added line in 1 file covered. (100.0%)

14164 existing lines in 472 files now uncovered.

35776 of 67125 relevant lines covered (53.3%)

2.31 hits per line

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

0.0
/src/python/pants/backend/nfpm/config.py
1
# Copyright 2023 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 typing import TypedDict
×
7

UNCOV
8
import yaml
×
9

10

UNCOV
11
class OctalInt(int):
×
12
    # noinspection PyUnusedLocal
UNCOV
13
    @staticmethod
×
UNCOV
14
    def represent_octal(dumper: yaml.representer.BaseRepresenter, data: int) -> yaml.Node:
×
15
        # YAML 1.2 octal: 0o7777 (py: f"0o{data:o}" or f"{data:#o}" or oct(data))
16
        # YAML 1.1 octal: 07777 (py: f"0{data:o}")
17
        # Both octal reprs are supported by `gopkg.in/yaml.v3` which parses YAML in nFPM.
18
        # See: https://github.com/go-yaml/yaml/tree/v3.0.1#compatibility
19
        # PyYAML only supports reading YAML 1.1, so we use that.
20
        return yaml.ScalarNode("tag:yaml.org,2002:int", f"0{data:o}")
×
21

22

23
# This is an unfortunate import-time side effect: PyYAML does registration globally.
UNCOV
24
yaml.SafeDumper.add_representer(OctalInt, OctalInt.represent_octal)
×
25

26

UNCOV
27
class NfpmFileInfo(TypedDict, total=False):
×
28
    # nFPM allows these to be None or missing.
29
    # Each of the fields has a default, so in practice, these won't be None.
UNCOV
30
    owner: str | None
×
UNCOV
31
    group: str | None
×
UNCOV
32
    mode: OctalInt | None
×
UNCOV
33
    mtime: str | None
×
34

35

UNCOV
36
class NfpmContent(TypedDict, total=False):
×
UNCOV
37
    src: str
×
UNCOV
38
    dst: str
×
UNCOV
39
    type: str
×
UNCOV
40
    packager: str
×
UNCOV
41
    file_info: NfpmFileInfo
×
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