gnu: Add python-pypump

Message ID 20160813123242.6162b166@openmailbox.org
State New
Headers

Commit Message

Dylan Jeffers Aug. 13, 2016, 7:32 p.m. UTC
  On Sat, 13 Aug 2016 08:57:00 -0400
Leo Famulari <leo@famulari.name> wrote:

> On Fri, Aug 12, 2016 at 06:31:29PM -0700, Dylan Jeffers wrote:
> > When submitting patches that require other patches I've submitted,
> > should I put them together in a single patch, or keep them separate
> > like this?  
> 
> For patches that depend on each other, sending them as a "patch
> series" will communicate the dependencies and ensure that they apply
> properly. If you've made your patches on a branch besides master, you
> can do:
> 
> $ git format-patch -n master
> 
> ... and attach those patches to an email.
> 
> You can also use `git send-email`, which uses `git format-patch` but
> will also send the patch series if you set up SMTP and configure Git
> to use it.
> 
> Can you resubmit these two patches using that method? Normally I
> wouldn't ask you to do that but, in this case, this patch does not
> apply cleanly after having applied the patch for
> python-requests-oauthlib; they both have the same leading context:
> 
> > @@ -9852,3 +9853,34 @@ etc.")
> >      (package
> >        (inherit base)
> >        (name "ptpython2"))))  
> 
> Thanks!

Thanks for getting back. Here is the series!

Dylan
  

Comments

Leo Famulari Aug. 13, 2016, 11:07 p.m. UTC | #1
On Sat, Aug 13, 2016 at 12:32:42PM -0700, Dylan Jeffers wrote:
> Thanks for getting back. Here is the series!

Cool, you showed me something new. I didn't know you could put the whole
series in a single attachment, apply it with `git am`, and have the
patch ordering handled automatically. Very nice :)

> Subject: [PATCH 1/2] gnu: Add python-requests-oauthlib
> 
> * gnu/packages/python.scm (python-requests-oauthlib,
> * python2-requests-oauthlib): New variables.

Somewhere in the re-creation of the patch series, this line was
forgotten:

+  #:use-module (gnu packages openstack)

I put it back in on my local branch.

> * gnu/packages/python.scm (python-pypump, python2-pypump): New
> * variables.

How about putting this in gnu/packages/pumpio.scm? Seems appropriate to
me :)

> +(define-public python-pypump
> +  (package
> +    (name "python-pypump")
> +    (version "0.6")

The latest upstream version 0.7. Is there a reason not to use the latest
version in this case?

https://pypi.python.org/pypi/PyPump/
  
Dylan Jeffers Aug. 14, 2016, 11:07 p.m. UTC | #2
Hi Leo,

Yeah, following your advice, i used git format-patch -n master, but
then added --stdout > filename.patch to get a single file.

> How about putting this in gnu/packages/pumpio.scm? Seems appropriate
> to me :)

Was not aware of pumpio.scm, seems quite appropriate!

> The latest upstream version 0.7. Is there a reason not to use the
> latest version in this case?

For my immediate purposes, I need pypump 0.6, since thats the version
used in my projects. Since the versions are quite different, maybe we
include both of them?
  
Leo Famulari Aug. 15, 2016, 6:41 p.m. UTC | #3
On Sun, Aug 14, 2016 at 04:07:11PM -0700, Dylan Jeffers wrote:
> > The latest upstream version 0.7. Is there a reason not to use the
> > latest version in this case?
> 
> For my immediate purposes, I need pypump 0.6, since thats the version
> used in my projects. Since the versions are quite different, maybe we
> include both of them?

I think we should package the latest version, at least.

Maybe we could also package 0.6 with a package 'python-pypump-0.6' that
inherits from python-pypump. Or, you could keep that inherited
python-pypump-0.6 in a private package repo, and use GUIX_PACKAGE_PATH.

I'd prefer the latter option. I don't think we have a precedent of
adding old releases, although we do sometimes keep them around for
compatibility. But I could be mistaken.

What do people think we should do?
  
Dylan Jeffers Aug. 15, 2016, 10:17 p.m. UTC | #4
On Mon, 15 Aug 2016 14:41:28 -0400
Leo Famulari <leo@famulari.name> wrote:

> On Sun, Aug 14, 2016 at 04:07:11PM -0700, Dylan Jeffers wrote:
> > > The latest upstream version 0.7. Is there a reason not to use the
> > > latest version in this case?  
> > 
> > For my immediate purposes, I need pypump 0.6, since thats the
> > version used in my projects. Since the versions are quite
> > different, maybe we include both of them?  
> 
> I think we should package the latest version, at least.
> 
> Maybe we could also package 0.6 with a package 'python-pypump-0.6'
> that inherits from python-pypump. Or, you could keep that inherited
> python-pypump-0.6 in a private package repo, and use
> GUIX_PACKAGE_PATH.
> 
> I'd prefer the latter option. I don't think we have a precedent of
> adding old releases, although we do sometimes keep them around for
> compatibility. But I could be mistaken.
> 
> What do people think we should do?

Yes I agree with the second alternative as well.

Dylan
  
Danny Milosavljevic Aug. 15, 2016, 10:29 p.m. UTC | #5
> I think we should package the latest version, at least.
> 
> Maybe we could also package 0.6 with a package 'python-pypump-0.6' that
> inherits from python-pypump. Or, you could keep that inherited
> python-pypump-0.6 in a private package repo, and use GUIX_PACKAGE_PATH.

It depends on whether pypump-0.6 is a major API-incompatible version that is still required by other Free Software packages in the wild on the internet. If so, it makes sense to carry it too. Otherwise not.
  
Leo Famulari Aug. 15, 2016, 10:41 p.m. UTC | #6
On Tue, Aug 16, 2016 at 12:29:27AM +0200, Danny Milosavljevic wrote:
> > I think we should package the latest version, at least.
> > 
> > Maybe we could also package 0.6 with a package 'python-pypump-0.6' that
> > inherits from python-pypump. Or, you could keep that inherited
> > python-pypump-0.6 in a private package repo, and use GUIX_PACKAGE_PATH.
> 
> It depends on whether pypump-0.6 is a major API-incompatible version
> that is still required by other Free Software packages in the wild on
> the internet. If so, it makes sense to carry it too. Otherwise not.

That's a good point. But I don't see any pending packages on the list
that require pypump-0.6 ;)
  
Leo Famulari Aug. 16, 2016, 6:02 p.m. UTC | #7
On Tue, Aug 16, 2016 at 12:29:27AM +0200, Danny Milosavljevic wrote:
> > I think we should package the latest version, at least.
> > 
> > Maybe we could also package 0.6 with a package 'python-pypump-0.6' that
> > inherits from python-pypump. Or, you could keep that inherited
> > python-pypump-0.6 in a private package repo, and use GUIX_PACKAGE_PATH.
> 
> It depends on whether pypump-0.6 is a major API-incompatible version
> that is still required by other Free Software packages in the wild on
> the internet. If so, it makes sense to carry it too. Otherwise not.

That would be a good reason to keep it. But so far, I haven't seen any
patches that would use it :)
  
Leo Famulari Aug. 19, 2016, 10:17 p.m. UTC | #8
On Mon, Aug 15, 2016 at 03:17:57PM -0700, Dylan Jeffers wrote:
> On Mon, 15 Aug 2016 14:41:28 -0400
> Leo Famulari <leo@famulari.name> wrote:
> 
> > On Sun, Aug 14, 2016 at 04:07:11PM -0700, Dylan Jeffers wrote:
> > > > The latest upstream version 0.7. Is there a reason not to use the
> > > > latest version in this case?  
> > > 
> > > For my immediate purposes, I need pypump 0.6, since thats the
> > > version used in my projects. Since the versions are quite
> > > different, maybe we include both of them?  
> > 
> > I think we should package the latest version, at least.
> > 
> > Maybe we could also package 0.6 with a package 'python-pypump-0.6'
> > that inherits from python-pypump. Or, you could keep that inherited
> > python-pypump-0.6 in a private package repo, and use
> > GUIX_PACKAGE_PATH.
> > 
> > I'd prefer the latter option. I don't think we have a precedent of
> > adding old releases, although we do sometimes keep them around for
> > compatibility. But I could be mistaken.
> > 
> > What do people think we should do?
> 
> Yes I agree with the second alternative as well.

Okay, will you send a patch for it?
  

Patch

From 536a71345f1b96905c430850bdb78b83fd6b3c5c Mon Sep 17 00:00:00 2001
From: Dylan Jeffers <sapientech@openmailbox.org>
Date: Sat, 13 Aug 2016 12:23:31 -0700
Subject: [PATCH 1/2] gnu: Add python-requests-oauthlib

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

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 6ff1c5c..a7e5d42 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -24,6 +24,7 @@ 
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -9852,3 +9853,45 @@  etc.")
     (package
       (inherit base)
       (name "ptpython2"))))
+
+(define-public python-requests-oauthlib
+  (package
+    (name "python-requests-oauthlib")
+    (version "0.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "requests-oauthlib" version))
+       (sha256
+        (base32
+         "0ykff67sjcl227c23g0rxzfx34rr5bf21kwv0z3zmgk0lfmch7hn"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; removes tests that require network access
+         (add-before 'check 'pre-check
+           (lambda _ (delete-file "tests/test_core.py")
+                   #t)))))
+    (native-inputs
+     `(("python-requests-mock" ,python-requests-mock)
+       ("python-mock" ,python-mock)))
+    (inputs
+     `(("python-oauthlib" ,python-oauthlib)
+       ("python-requests" ,python-requests)))
+    (home-page
+     "https://github.com/requests/requests-oauthlib")
+    (synopsis
+     "OAuthlib authentication support for Requests")
+    (description
+     "This package provides first-class OAuth library
+support for python-requests.")
+    (license isc)))
+
+(define-public python2-requests-oauthlib
+  (let ((base (package-with-python2 (strip-python2-variant python-requests-oauthlib))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools)
+                       ,@(package-native-inputs base))))))
+
-- 
2.7.3


From 5300fd89c45514077551eeceaede84139b127854 Mon Sep 17 00:00:00 2001
From: Dylan Jeffers <sapientech@openmailbox.org>
Date: Sat, 13 Aug 2016 12:29:13 -0700
Subject: [PATCH 2/2] gnu: Add python-pypump.

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

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index a7e5d42..465ee2b 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9895,3 +9895,42 @@  support for python-requests.")
       (native-inputs `(("python2-setuptools" ,python2-setuptools)
                        ,@(package-native-inputs base))))))
 
+(define-public python-pypump
+  (package
+    (name "python-pypump")
+    (version "0.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/xray7224/PyPump")
+             (commit  "6b612a7ed3c5a9b0a0190f3999fcddb851d1900f")))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32
+         "0xy9kw54a2dasc5jig1rmllwv6y3pngbw8pvi0yx2qfpswgr5qbg"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("python-requests" ,python-requests)
+       ("python-oauthlib" ,python-oauthlib)
+       ("python-requests-oauthlib" ,python-requests-oauthlib)
+       ("python-dateutil-2" ,python-dateutil-2)))
+    (home-page "https://github.com/xray7224/PyPump")
+    (synopsis "Python Pump.io library")
+    (description "PyPump is a simple but powerful and pythonic
+way of interfacing with the pump.io API.")
+    (license gpl3+)))
+
+(define-public python2-pypump
+  (let ((base (package-with-python2 (strip-python2-variant python-pypump))))
+    (package
+      (inherit base)
+      (inputs `(("python2-requests" ,python2-requests)
+                ("python2-oauthlib" ,python2-oauthlib)
+                ("python2-requests-oauthlib" ,python2-requests-oauthlib)
+                ("python2-pyasn1" ,python2-pyasn1)
+                ("python2-pyopenssl" ,python2-pyopenssl)
+                ("python2-ndg-httpsclient" ,python2-ndg-httpsclient)
+                ("python2-dateutil-2" ,python2-dateutil-2))))))
-- 
2.7.3