From 867b96a4dc461b0496a3ffbf8af7f97892f01cde Mon Sep 17 00:00:00 2001
From: Jacob MacDonald <jaccarmac@gmail.com>
Date: Thu, 11 Jul 2019 15:43:31 -0500
Subject: [PATCH 1/9] gnu: Add python-cached-property.
* gnu/packages/python-xyz.scm (python-cached-property): New variable.
---
gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
@@ -15923,3 +15923,39 @@ Complete support for Berkeley DB Base Replication. Support for RPC.")
types for further processing. It is primarily intended for batch jobs and
one-off scripts.")
(license license:expat)))
+
+(define-public python-cached-property
+ (package
+ (name "python-cached-property")
+ (version "1.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "cached-property" version))
+ (sha256
+ (base32
+ "010m1bl380l2r3vwq24r5v14l6gwvgm9v0mqqjkjss552jgsa5wj"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ ;; https://github.com/pydanny/cached-property/issues/131
+ ;; recent versions of freezegun break one test
+ (add-after 'unpack 'disable-broken-test
+ (lambda _
+ (substitute* "tests/test_cached_property.py"
+ (("def test_threads_ttl_expiry\\(self\\)" m)
+ (string-append "@unittest.skip(\"Disabled by Guix\")\n"
+ " " m)))
+ #t)))))
+ (native-inputs
+ `(("python-freezegun" ,python-freezegun)))
+ (home-page
+ "https://github.com/pydanny/cached-property")
+ (synopsis
+ "Decorator for caching properties in classes")
+ (description
+ "This package provides a decorator which makes caching
+time-or-computationally-expensive properties quick and easy and works in Python
+2 or 3.")
+ (license license:bsd-3)))
--
2.22.0