diff options
author | Marius Bakke <mbakke@fastmail.com> | 2016-09-10 11:19:37 +0100 |
---|---|---|
committer | Ben Woodcroft <donttrustben@gmail.com> | 2016-09-11 09:48:54 +1000 |
commit | b30565bd8ab311e41b6169090f8cbbb61d408d36 (patch) | |
tree | 2ec0e198cad52009c68cc95ca69396a9cc210505 | |
parent | debf4179b4312ad3ea02f994154a2d989bc16089 (diff) | |
download | guix-b30565bd8ab311e41b6169090f8cbbb61d408d36.tar.gz |
gnu: Add python-cachecontrol.
* gnu/packages/python.scm (python-cachecontrol, python2-cachecontrol): New variables.
-rw-r--r-- | gnu/packages/python.scm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 0987b8fe47..8c361456b6 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -10278,3 +10278,52 @@ Python to manipulate OpenDocument 1.2 files.") (define-public python2-odfpy (package-with-python2 python-odfpy)) + +(define-public python-cachecontrol + (package + (name "python-cachecontrol") + (version "0.11.6") + (source + (origin + (method url-fetch) + ;; Pypi does not have tests. + (uri (string-append + "https://github.com/ionrock/cachecontrol/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0yj60d0f69a2l8p7y86k4zhzzm6rnxpq74sfl240pry9l0lfw2vw")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + ;; Drop test that requires internet access. + (delete-file "tests/test_regressions.py") + (setenv "PYTHONPATH" + (string-append (getcwd) "/build/lib:" + (getenv "PYTHONPATH"))) + (zero? (system* "py.test" "-vv"))))))) + (native-inputs + `(("python-pytest" ,python-pytest) + ("python-redis" ,python-redis) + ("python-webtest" ,python-webtest) + ("python-mock" ,python-mock))) + (propagated-inputs + `(("python-requests" ,python-requests) + ("python-lockfile" ,python-lockfile))) + (home-page "https://github.com/ionrock/cachecontrol") + (synopsis "The httplib2 caching algorithms for use with requests") + (description "CacheControl is a port of the caching algorithms in +@code{httplib2} for use with @code{requests} session objects.") + (license license:asl2.0) + (properties `((python2-variant . ,(delay python2-cachecontrol))) + +(define-public python2-cachecontrol + (let ((base (package-with-python2 (strip-python2-variant python-cachecontrol)))) + (package (inherit base) + (native-inputs + `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs base)))))) |