unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add python-cachecontrol.
@ 2016-09-10 10:24 Marius Bakke
  2016-09-11  0:01 ` Ben Woodcroft
  0 siblings, 1 reply; 3+ messages in thread
From: Marius Bakke @ 2016-09-10 10:24 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-python-cachecontrol.patch --]
[-- Type: text/x-patch, Size: 2578 bytes --]

From e924847f7f1b226b7abe2dcf176d83b9ae2852d5 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Sat, 10 Sep 2016 11:19:37 +0100
Subject: [PATCH] gnu: Add python-cachecontrol.

* gnu/packages/python.scm (python-cachecontrol, python2-cachecontrol):
  New variables.
---
 gnu/packages/python.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 33674fa..f965dc7 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10278,3 +10278,51 @@ 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)))
+
+(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))))))
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gnu: Add python-cachecontrol.
  2016-09-10 10:24 [PATCH] gnu: Add python-cachecontrol Marius Bakke
@ 2016-09-11  0:01 ` Ben Woodcroft
  2016-09-11  1:11   ` Marius Bakke
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Woodcroft @ 2016-09-11  0:01 UTC (permalink / raw)
  To: Marius Bakke, guix-devel

Hi Marius, thanks for the patch.

I added a 'python2-variant' line and pushed as 'b30565b'.

The thing is, the list has already seen this package before, in this 
thread where I tried packaging scikit-bio (I suspect you are trying to 
do the same):
https://lists.gnu.org/archive/html/guix-devel/2016-04/msg01012.html

I never pushed that series because of Leo's comment about pandas. There 
has since been a new scikit-bio release which fixes those issues, and I 
believe I've made some further changes in response to other comments in 
this branch:
https://github.com/wwood/guix/tree/skbio

Anyway, I'm keen to make sure that we don't ask the list to re-review 
patches. Would you like to take a look at my branch and see if there is 
anything useful there? If this current patch is anything to go by, I'd 
prefer your patches over mine ..

Thanks and apologies for the duplicated work.
ben

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gnu: Add python-cachecontrol.
  2016-09-11  0:01 ` Ben Woodcroft
@ 2016-09-11  1:11   ` Marius Bakke
  0 siblings, 0 replies; 3+ messages in thread
From: Marius Bakke @ 2016-09-11  1:11 UTC (permalink / raw)
  To: Ben Woodcroft, guix-devel

Ben Woodcroft <b.woodcroft@uq.edu.au> writes:

> Hi Marius, thanks for the patch.
>
> I added a 'python2-variant' line and pushed as 'b30565b'.

*facepalm* thanks. Here I was wondering why my next patches didn't build
for python2. You may want to do the same for "python-freezegun" above.

Btw, it seems you missed a couple of parenthesis in the commit:

-    (properties `((python2-variant . ,(delay python2-cachecontrol)))
+    (properties `((python2-variant . ,(delay python2-cachecontrol))))))

> The thing is, the list has already seen this package before, in this 
> thread where I tried packaging scikit-bio (I suspect you are trying to 
> do the same):
> https://lists.gnu.org/archive/html/guix-devel/2016-04/msg01012.html

I am indeed sending these to prepare for scikit-bio. Natsort coming up.
There have been a few dependency updates as well, since that thread.

I'll take a look at your branch to see if it contains anything I might
have missed. The remaining dependencies are pretty much ready to go.

Cheers!
Marius

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-11  1:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-10 10:24 [PATCH] gnu: Add python-cachecontrol Marius Bakke
2016-09-11  0:01 ` Ben Woodcroft
2016-09-11  1:11   ` Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).