From 8c343a1064617802f01492391abeeb34351411a3 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 11 Jul 2026 12:37:38 -0400 Subject: [PATCH] python3Packages.httpsig: Fix build with setuptools 82 --- .../python-modules/httpsig/default.nix | 6 +++++- .../httpsig/no-pkg-resources.patch | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/httpsig/no-pkg-resources.patch diff --git a/pkgs/development/python-modules/httpsig/default.nix b/pkgs/development/python-modules/httpsig/default.nix index dd7034304f25..a2e96ec2caa9 100644 --- a/pkgs/development/python-modules/httpsig/default.nix +++ b/pkgs/development/python-modules/httpsig/default.nix @@ -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 ]; diff --git a/pkgs/development/python-modules/httpsig/no-pkg-resources.patch b/pkgs/development/python-modules/httpsig/no-pkg-resources.patch new file mode 100644 index 000000000000..2ef147d088cd --- /dev/null +++ b/pkgs/development/python-modules/httpsig/no-pkg-resources.patch @@ -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 +