summary refs log tree commit diff
path: root/gnu/packages/check.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-12 22:44:35 +0200
committerMarius Bakke <marius@gnu.org>2022-08-13 19:09:13 +0200
commitc5860b97e9b9acb1e791db67cfe425e4cbc8dff0 (patch)
treed63cdfa8f01aa5e31b46b29015c96dbac03e2ef9 /gnu/packages/check.scm
parenta20a93408153254898638a968e1894efb0945a04 (diff)
downloadguix-c5860b97e9b9acb1e791db67cfe425e4cbc8dff0.tar.gz
gnu: python-freezegun: Adjust for Python 3.10.
* gnu/packages/check.scm (python-freezegun)[source](modules, snippet): New
fields.
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r--gnu/packages/check.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index e521c92b2b..b57bfa30d8 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -2717,7 +2717,18 @@ create data based on random numbers and yet remain repeatable.")
        (method url-fetch)
        (uri (pypi-uri "freezegun" version))
        (sha256
-        (base32 "0ijlq32qvpm5zprfzbyzawpl9qjsknlxhryr1i0q84wl0sxd28nd"))))
+        (base32 "0ijlq32qvpm5zprfzbyzawpl9qjsknlxhryr1i0q84wl0sxd28nd"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Add an explicit case for static methods as they are callable
+        ;; in Python 3.10, breaking this conditional.
+        ;; XXX Taken from upstream pull request:
+        ;; https://github.com/spulec/freezegun/pull/397
+        '(substitute* "freezegun/api.py"
+           (("if not callable\\(attr_value\\) or \
+inspect\\.isclass\\(attr_value\\):")
+            "if (not callable(attr_value) or inspect.isclass(attr_value)\
+or isinstance(attr_value, staticmethod)):")))))
     (build-system python-build-system)
     (native-inputs
      (list python-pytest))