Debian Codegraph @

debian/patches/packaging-25

raw
1 From: Stefano Rivera <[email protected]>
2 Date: Tue, 3 Feb 2026 19:04:14 -0400
3 Subject: Handle packaging < 26 in tests
4
5 The tests were updated for this change in packaging 26.0, but Debian
6 hasn't updated to this yet. https://github.com/pypa/packaging/pull/953
7
8 Forwarded: not-needed
9 ---
10 tests/test_metadata.py | 8 ++++++++
11 1 file changed, 8 insertions(+)
12
13 diff --git a/tests/test_metadata.py b/tests/test_metadata.py
14 index 364d950..339d4ea 100644
15 --- a/tests/test_metadata.py
16 +++ b/tests/test_metadata.py
17 @@ -34,6 +34,14 @@ def test_pkginfo_to_metadata(tmp_path: Path) -> None:
18 ("Requires-Dist", 'pytest-cov; extra == "test"'),
19 ]
20
21 + import packaging
22 + from packaging.version import Version
23 + if Version(packaging.__version__) < Version("26.0"):
24 + expected_metadata = [
25 + (k, v.replace(" @ ", "@ "))
26 + for k, v in expected_metadata
27 + ]
28 +
29 pkg_info = tmp_path.joinpath("PKG-INFO")
30 pkg_info.write_text(
31 """\