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

pantsbuild / pants / 19120576134

06 Nov 2025 12:22AM UTC coverage: 80.307% (+0.007%) from 80.3%
19120576134

Pull #22861

github

web-flow
Merge 9479b1cb5 into 89462b7ef
Pull Request #22861: nfpm.native_libs: new backend to generate pkg deps for nfpm packages

613 of 767 new or added lines in 18 files covered. (79.92%)

1 existing line in 1 file now uncovered.

78600 of 97875 relevant lines covered (80.31%)

3.35 hits per line

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

40.0
/src/python/pants/backend/nfpm/native_libs/deb/utils.py
1
# Copyright 2025 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
import re
1✔
7
from collections.abc import Iterable
1✔
8

9

10
def shlibdeps_filter_sonames(sonames: Iterable[str]) -> set[str]:
1✔
11
    """Filter any SONAMEs that dpkg-shlibdeps would ignore.
12

13
    dpkg-shlibdeps ignores:
14
      - SONAMEs that do not look like .so files
15
      - libm.so if libstdc++.so is already in deps
16
    dpkg-shlibdeps can also exclude deps based on command line args.
17
    Consuming rules are responsible for such exclusions, as this rule helper doesn't handle that.
18
    """
NEW
19
    sonames = tuple(sonames)  # this might be a generator, but this loops through it twice
×
20

NEW
21
    so_patt = re.compile(r"^.*\.so(\..*)?$")
×
NEW
22
    libm_patt = re.compile(r"^libm\.so\.\d+$")
×
NEW
23
    libstdcpp_patt = re.compile(r"^libstdc\+\+\.so\.\d+$")
×
NEW
24
    has_libstdcpp = any(libstdcpp_patt.match(soname) for soname in sonames)
×
25

NEW
26
    return {
×
27
        soname
28
        for soname in sonames
29
        if so_patt.match(soname) and (not has_libstdcpp or libm_patt.match(soname))
30
    }
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