guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/12: gnu: python-freezegun: Adjust for Python 3.10.


From: guix-commits
Subject: 06/12: gnu: python-freezegun: Adjust for Python 3.10.
Date: Sat, 13 Aug 2022 13:25:19 -0400 (EDT)

mbakke pushed a commit to branch staging
in repository guix.

commit c5860b97e9b9acb1e791db67cfe425e4cbc8dff0
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Fri Aug 12 22:44:35 2022 +0200

    gnu: python-freezegun: Adjust for Python 3.10.
    
    * gnu/packages/check.scm (python-freezegun)[source](modules, snippet): New
    fields.
---
 gnu/packages/check.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]