python3Packages.httpsig: Fix build with setuptools 82 (#540800)

This commit is contained in:
Yohann Boniface
2026-07-16 20:02:12 +00:00
committed by GitHub
2 changed files with 22 additions and 1 deletions

View File

@@ -20,6 +20,11 @@ buildPythonPackage rec {
hash = "sha256-cdbVAkYSnE98/sIPXlfjUdK4SS1jHMKqlnkUrPkfbOY=";
};
patches = [
# pkg_resources is gone in setuptools 82
./no-pkg-resources.patch
];
build-system = [
setuptools
setuptools-scm
@@ -29,7 +34,6 @@ buildPythonPackage rec {
pycryptodome
requests
six
setuptools
];
nativeCheckInputs = [ pytestCheckHook ];

View File

@@ -0,0 +1,17 @@
--- a/httpsig/__init__.py
+++ b/httpsig/__init__.py
@@ -1,11 +1,11 @@
-from pkg_resources import get_distribution, DistributionNotFound
+from importlib.metadata import PackageNotFoundError, version
from .sign import Signer, HeaderSigner
from .verify import Verifier, HeaderVerifier
try:
- __version__ = get_distribution(__name__).version
-except DistributionNotFound:
+ __version__ = version(__name__)
+except PackageNotFoundError:
# package is not installed
pass