File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
src/python/pants/backend/nfpm/native_libs/deb Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11# Copyright 2025 Pants project contributors (see CONTRIBUTORS.md).
22# Licensed under the Apache License, Version 2.0 (see LICENSE).
33
4+ """A standalone script that uses asyncio to find packages that contain a SONAME.
5+
6+ Rule code should run this script as a subprocess in a sandboxed venv. Generally, that venv should
7+ be a subset of the pants venv (using the version of packages that pants depends on).
8+
9+ WARNING: This script relies on aiohttp and asyncio, so their are probably incompatibilities
10+ with rule code in the pants engine. So, avoid importing this script in rule code.
11+ """
12+
413from __future__ import annotations
514
615import argparse
Original file line number Diff line number Diff line change 88
99import pytest
1010
11+ from pants .backend .nfpm .native_libs .deb .rules import (
12+ DebPackagesForSonames ,
13+ DebSearchForSonamesRequest ,
14+ )
15+ from pants .backend .nfpm .native_libs .deb .rules import rules as native_libs_deb_rules
1116from pants .backend .python .util_rules import pex_from_targets
1217from pants .engine .rules import QueryRule
1318from pants .testutil .rule_runner import RuleRunner
1419
15- from . rules import DebPackagesForSonames , DebSearchForSonamesRequest
16- from . rules import rules as native_libs_deb_rules
20+ # The relative import emphasizes that `search_for_sonames` is a standalone script that runs
21+ # from a sandbox root (thus avoiding a dependency on the pants code structure).
1722from .search_for_sonames import deb_search_for_sonames
1823
1924_libldap_soname = "libldap-2.5.so.0"
Original file line number Diff line number Diff line change 33
44from __future__ import annotations
55
6+ # The relative import emphasizes that `search_for_sonames` is a standalone script that runs
7+ # from a sandbox root (thus avoiding a dependency on the pants code structure).
68from .search_for_sonames import deb_packages_from_html_response
79
810# simplified for readability and to keep it focused
You can’t perform that action at this time.
0 commit comments