From f0aefd0b5c1032927b4969a18047dd363cf8c831 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Thu, 2 Oct 2025 21:39:49 +0200 Subject: [PATCH] gnu: Add python-respx. * gnu/packages/python-check.scm (python-respx): New variable. Change-Id: Iddfdcc6dd2cc0f518e7046ac8df743c4b535d639 --- gnu/packages/python-check.scm | 44 ++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 4a4815fd91a..913e1ab9e3c 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2018-2020 Tobias Geerinckx-Rice ;;; Copyright © 2019-2025 Ricardo Wurmus ;;; Copyright © 2019-2024 Maxim Cournoyer -;;; Copyright © 2019, 2021 Hartmut Goebel +;;; Copyright © 2019, 2021, 2025 Hartmut Goebel ;;; Copyright © 2020, 2022 Julien Lepiller ;;; Copyright © 2020 Matthew James Kraai ;;; Copyright © 2020 Edouard Klein @@ -3746,6 +3746,48 @@ libraries.") simpler.") (license license:expat))) +(define-public python-respx + (package + (name "python-respx") + (version "0.22.0") + (source + (origin + ;; There are no tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/lundberg/respx/") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0pl6vlyva837bnz3cy9mwmvvh8fq943rkrbq3mzj34bjf8swnw2g")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-pytest-config + (lambda _ + ;; Drop test coverage requirements. + (substitute* "setup.cfg" + (("--cov(-[^ ]*)?=[^ ]*") + "\n") + (("--cov-fail-under [^ ]*") + "\n"))))))) + (propagated-inputs (list python-httpx)) + (native-inputs (list nss-certs-for-test + python-starlette + python-flask + python-pytest + python-pytest-asyncio + python-setuptools + python-wheel)) + (home-page "https://lundberg.github.io/respx/") + (synopsis "Mocking for Python libraries HTTPX and HTTPCore") + (description + "This package provides a utility for mocking out the Python libraries HTTPX and +HTTPCore.") + (license license:bsd-3))) + (define-public python-robber (package (name "python-robber")