summaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-02-14 12:16:49 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-02-21 19:00:32 -0800
commit4cb122cd8d81b58d88920ec1c8fb09a72de3db70 (patch)
tree954c4d1e0415aae36764fbc86a89a665a873dc24 /gnu/packages/python.scm
parentaa6313d6995d243d551cfcdc0c80dc13c7cef444 (diff)
gnu: Add python-anyjson.
* gnu/packages/python.scm (python-anyjson, python2-anyjson): New variables.
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm40
1 files changed, 40 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 93bf4bd247..785267dd31 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -7857,3 +7857,43 @@ minimum of WSGI.")
(inherit webtest)
(native-inputs `(("python2-setuptools" ,python2-setuptools)
,@(package-native-inputs webtest))))))
+
+(define-public python-anyjson
+ (package
+ (name "python-anyjson")
+ (version "0.3.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "anyjson" version))
+ (sha256
+ (base32
+ "1fjph4alvcscsl5d4b6qpv1yh31jy05jxi1l0xff7lws7j32v09p"))))
+ (build-system python-build-system)
+ (arguments
+ `(;; We could possibly get tests working, but on Python 3 it's not so easy.
+ ;; Very strangely, 2to3 is run *during setup.py install* (or bdist, or
+ ;; whatever) so this transformation needs to be done before the tests
+ ;; can be run. Maybe we could add a build step to transform beforehand
+ ;; but it could be annoying/difficult.
+ ;; We can enable tests for the Python 2 version, though, and do below.
+ #:tests? #f))
+ (home-page "http://bitbucket.org/runeh/anyjson/")
+ (synopsis
+ "Wraps best available JSON implementation in a common interface")
+ (description
+ "Anyjson loads whichever is the fastest JSON module installed
+and provides a uniform API regardless of which JSON implementation is used.")
+ (license bsd-3)
+ (properties `((python2-variant . ,(delay python2-anyjson))))))
+
+(define-public python2-anyjson
+ (let ((anyjson (package-with-python2
+ (strip-python2-variant python-anyjson))))
+ (package
+ (inherit anyjson)
+ (arguments `(;; Unlike the python 3 variant, we do run tests. See above!
+ #:tests? #t
+ ,@(package-arguments anyjson)))
+ (native-inputs `(("python2-setuptools" ,python2-setuptools)
+ ("python2-nose" ,python2-nose))))))