GNU bug report logs - #53046
[PATCH] gnu: python-args: Patch reference to basestring.

Previous Next

Package: guix-patches;

Reported by: Tanguy Le Carrour <tanguy <at> bioneland.org>

Date: Thu, 6 Jan 2022 10:22:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53046 in the body.
You can then email your comments to 53046 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Thu, 06 Jan 2022 10:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tanguy Le Carrour <tanguy <at> bioneland.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 06 Jan 2022 10:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tanguy Le Carrour <tanguy <at> bioneland.org>
To: guix-patches <at> gnu.org
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>
Subject: [PATCH] gnu: python-args: Patch reference to basestring.
Date: Thu,  6 Jan 2022 11:21:02 +0100
This fixes a build failure in the 'sanity-check' phase.

* gnu/packages/python-xyz.scm (python-args)[arguments]:
Replace reference to basestring with str.
---
 gnu/packages/python-xyz.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c9a0b7d6bf..0d9bfb1711 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -13013,6 +13013,14 @@ (define-public python-args
                (base32
                 "057qzi46h5dmxdqknsbrssn78lmqjlnm624iqdhrnpk26zcbi1d7"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-args.py
+           (lambda _
+             (substitute* "args.py"
+               (("basestring") "str"))
+             #t)))))
     (home-page "https://github.com/kennethreitz/args")
     (synopsis "Command-line argument parser")
     (description
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Sun, 09 Jan 2022 21:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: tanguy <at> bioneland.org
Cc: 53046 <at> debbugs.gnu.org
Subject: Re: bug#53046: [PATCH] gnu: python-args: Patch reference to
 basestring.
Date: Sun, 09 Jan 2022 22:15:41 +0100
[Message part 1 (text/plain, inline)]
> This fixes a build failure in the 'sanity-check' phase.
> +             (substitute* "args.py"
> +               (("basestring") "str"))

Does it actually fix the build failure, or is it only suppressed?

Looking at

<https://github.com/kennethreitz-archive/args/blob/master/args.py>,
line 15--18, it appears that basestring should actually be basestring,
at least for Python 2 (python2-args).

Also, returning #true isn't necessary anymore, and this seems better
fit for a snippet.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Sun, 09 Jan 2022 21:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: tanguy <at> bioneland.org
Cc: 53046 <at> debbugs.gnu.org
Subject: Re: bug#53046: [PATCH] gnu: python-args: Patch reference to
 basestring.
Date: Sun, 09 Jan 2022 22:34:52 +0100
[Message part 1 (text/plain, inline)]
Maxime Devos schreef op zo 09-01-2022 om 22:15 [+0100]:
> > This fixes a build failure in the 'sanity-check' phase.
> > +             (substitute* "args.py"
> > +               (("basestring") "str"))
> 
> Does it actually fix the build failure, or is it only suppressed?
> [...]

According to <https://github.com/kennethreitz-archive/args/pull/19>,
the tests are excluded from the tarball.  It would be useful to
switch to git-fetch such that tests can be run, verifying whether
this change causes problems or not.

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Mon, 10 Jan 2022 07:47:01 GMT) Full text and rfc822 format available.

Message #14 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 53046 <at> debbugs.gnu.org
Subject: Re: bug#53046: [PATCH] gnu: python-args: Patch reference to
 basestring.
Date: Mon, 10 Jan 2022 08:46:16 +0100
Hi Maxime,


Quoting Maxime Devos (2022-01-09 22:15:41)
> > This fixes a build failure in the 'sanity-check' phase.
> > +             (substitute* "args.py"
> > +               (("basestring") "str"))
> 
> Does it actually fix the build failure, or is it only suppressed?
> 
> Looking at
> 
> <https://github.com/kennethreitz-archive/args/blob/master/args.py>,
> line 15--18, it appears that basestring should actually be basestring,
> at least for Python 2 (python2-args).

Believe it or not, I had totally forgotten about Python 2 when I wrote
that! ^_^'


> Also, returning #true isn't necessary anymore, and this seems better
> fit for a snippet.

OK, I'll fix it.

Thanks for reviewing,

-- 
Tanguy




Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Mon, 10 Jan 2022 07:49:02 GMT) Full text and rfc822 format available.

Message #17 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 53046 <at> debbugs.gnu.org
Subject: Re: bug#53046: [PATCH] gnu: python-args: Patch reference to
 basestring.
Date: Mon, 10 Jan 2022 08:48:49 +0100
Hi Maxime,


Quoting Maxime Devos (2022-01-09 22:34:52)
> Maxime Devos schreef op zo 09-01-2022 om 22:15 [+0100]:
> > > This fixes a build failure in the 'sanity-check' phase.
> > > +             (substitute* "args.py"
> > > +               (("basestring") "str"))
> > 
> > Does it actually fix the build failure, or is it only suppressed?
> > [...]
> 
> According to <https://github.com/kennethreitz-archive/args/pull/19>,
> the tests are excluded from the tarball.  It would be useful to
> switch to git-fetch such that tests can be run, verifying whether
> this change causes problems or not.

I'll switch to `git-fetch` and see! Maybe Python 2 tests will also pass
with the patch!?

I'll apply all your suggestions and send a v2.

Thanks again for your time and advice.

-- 
Tanguy




Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Mon, 17 Jan 2022 13:36:01 GMT) Full text and rfc822 format available.

Message #20 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy Le Carrour <tanguy <at> bioneland.org>
To: 53046 <at> debbugs.gnu.org
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>, maximedevos <at> telenet.be
Subject: [PATCH v2] gnu: Patch reference to basestring.
Date: Mon, 17 Jan 2022 14:34:51 +0100
* gnu/packages/python-xyz.scm (python-args): Use tho latest version
from the git repository to get the test suite.
* gnu/packages/python-xyz.scm (python-args)[arguments]: Replace
reference to basestring with str. Invoke nosetests.
* gnu/packages/python-xyz.scm (python-args)[native-inputs]: Add
python-nose.
---
 gnu/packages/python-xyz.scm | 44 ++++++++++++++++++++++++-------------
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 80ce58400a..4f2e9cb73d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -13368,21 +13368,35 @@ (define-public python-icalendar
     (license license:bsd-2)))
 
 (define-public python-args
-  (package
-    (name "python-args")
-    (version "0.1.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "args" version))
-              (sha256
-               (base32
-                "057qzi46h5dmxdqknsbrssn78lmqjlnm624iqdhrnpk26zcbi1d7"))))
-    (build-system python-build-system)
-    (home-page "https://github.com/kennethreitz/args")
-    (synopsis "Command-line argument parser")
-    (description
-     "This library provides a Python module to parse command-line arguments.")
-    (license license:bsd-3)))
+  (let ((commit "9460f1a35eb3055e9e4de1f0a6932e0883c72d65") (revision "0"))
+    (package
+      (name "python-args")
+      (version (git-version "0.1.0" revision commit))
+      (home-page "https://github.com/kennethreitz/args")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url home-page)
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1zfxpbp9vldqdrjmd0c6y3wisl35mx5v8zlyp3nhwpy1730wrc9j"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (add-after 'unpack 'patch-args.py
+                      (lambda _
+                        (substitute* "args.py"
+                          (("basestring") "str"))))
+                    (replace 'check
+                      (lambda _
+                        (invoke "nosetests" "-v"))))))
+      (native-inputs (list python-nose))
+      (synopsis "Command-line argument parser")
+      (description
+       "This library provides a Python module to parse command-line arguments.")
+      (license license:bsd-3))))
 
 (define-public python2-args
   (package-with-python2 python-args))
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Mon, 17 Jan 2022 14:15:02 GMT) Full text and rfc822 format available.

Message #23 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Tanguy Le Carrour <tanguy <at> bioneland.org>, 53046 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: Patch reference to basestring.
Date: Mon, 17 Jan 2022 15:14:00 +0100
[Message part 1 (text/plain, inline)]
Hi,

Tanguy Le Carrour schreef op ma 17-01-2022 om 14:34 [+0100]:
> +                    (replace 'check
> +                      (lambda _
> +                        (invoke "nosetests" "-v"))))))

This needs to be

(lambda* (#:key tests? #:allow-other-keys)
  (when tests?
    (invoke ...)))

to make "--without-tests" work.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Mon, 17 Jan 2022 14:23:01 GMT) Full text and rfc822 format available.

Message #26 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: 53046 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: [PATCH v2] gnu: Patch reference to basestring.
Date: Mon, 17 Jan 2022 15:22:48 +0100
Hi Maxime,


Quoting Maxime Devos (2022-01-17 15:14:00)
> Tanguy Le Carrour schreef op ma 17-01-2022 om 14:34 [+0100]:
> > +                    (replace 'check
> > +                      (lambda _
> > +                        (invoke "nosetests" "-v"))))))
> 
> This needs to be
> 
> (lambda* (#:key tests? #:allow-other-keys)
>   (when tests?
>     (invoke ...)))
> 
> to make "--without-tests" work.

Oh, OK, good to know! Thanks!

I'm fixing it and sending a v3.


-- 
Tanguy




Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Mon, 17 Jan 2022 14:25:02 GMT) Full text and rfc822 format available.

Message #29 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy Le Carrour <tanguy <at> bioneland.org>
To: 53046 <at> debbugs.gnu.org
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>, maximedevos <at> telenet.be
Subject: [PATCH v3] gnu: Patch reference to basestring.
Date: Mon, 17 Jan 2022 15:23:51 +0100
* gnu/packages/python-xyz.scm (python-args): Use tho latest version
from the git repository to get the test suite.
* gnu/packages/python-xyz.scm (python-args)[arguments]: Replace
reference to basestring with str. Invoke nosetests.
* gnu/packages/python-xyz.scm (python-args)[native-inputs]: Add
python-nose.
---
 gnu/packages/python-xyz.scm | 45 ++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 80ce58400a..3b35cb2cba 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -13368,21 +13368,36 @@ (define-public python-icalendar
     (license license:bsd-2)))
 
 (define-public python-args
-  (package
-    (name "python-args")
-    (version "0.1.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "args" version))
-              (sha256
-               (base32
-                "057qzi46h5dmxdqknsbrssn78lmqjlnm624iqdhrnpk26zcbi1d7"))))
-    (build-system python-build-system)
-    (home-page "https://github.com/kennethreitz/args")
-    (synopsis "Command-line argument parser")
-    (description
-     "This library provides a Python module to parse command-line arguments.")
-    (license license:bsd-3)))
+  (let ((commit "9460f1a35eb3055e9e4de1f0a6932e0883c72d65") (revision "0"))
+    (package
+      (name "python-args")
+      (version (git-version "0.1.0" revision commit))
+      (home-page "https://github.com/kennethreitz/args")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url home-page)
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1zfxpbp9vldqdrjmd0c6y3wisl35mx5v8zlyp3nhwpy1730wrc9j"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (add-after 'unpack 'patch-args.py
+                      (lambda _
+                        (substitute* "args.py"
+                          (("basestring") "str"))))
+                    (replace 'check
+                      (lambda* (#:key tests? #:allow-other-keys)
+                        (when tests?
+                          (invoke "nosetests" "-v")))))))
+      (native-inputs (list python-nose))
+      (synopsis "Command-line argument parser")
+      (description
+       "This library provides a Python module to parse command-line arguments.")
+      (license license:bsd-3))))
 
 (define-public python2-args
   (package-with-python2 python-args))
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Thu, 10 Mar 2022 17:29:02 GMT) Full text and rfc822 format available.

Message #32 received at 53046 <at> debbugs.gnu.org (full text, mbox):

From: Tanguy Le Carrour <tanguy <at> bioneland.org>
To: 53046 <at> debbugs.gnu.org,
	maximedevos <at> telenet.be
Cc: Tanguy Le Carrour <tanguy <at> bioneland.org>
Subject: [PATCH v4] gnu: python-args: Patch reference to basestring.
Date: Thu, 10 Mar 2022 18:28:08 +0100
Hi Maxime,

I **totally** forgot about this one! Seems like no one is using it.
`python2-args` also builds. But no package seems to depend on it anyway.

Regards,

Tanguy


* gnu/packages/python-xyz.scm (python-args)[source]: Use the latest version
from the git repository to get the test suite.
[home-page]: Update URL.
[native-inputs]: Add python-nose.
[arguments]: Replace reference to basestring with str. Invoke nosetests.
---
 gnu/packages/python-xyz.scm | 45 ++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5c003e3c1a..b8798fa671 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -13638,21 +13638,36 @@ (define-public python-icalendar
     (license license:bsd-2)))
 
 (define-public python-args
-  (package
-    (name "python-args")
-    (version "0.1.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "args" version))
-              (sha256
-               (base32
-                "057qzi46h5dmxdqknsbrssn78lmqjlnm624iqdhrnpk26zcbi1d7"))))
-    (build-system python-build-system)
-    (home-page "https://github.com/kennethreitz/args")
-    (synopsis "Command-line argument parser")
-    (description
-     "This library provides a Python module to parse command-line arguments.")
-    (license license:bsd-3)))
+  (let ((commit "9460f1a35eb3055e9e4de1f0a6932e0883c72d65") (revision "0"))
+    (package
+      (name "python-args")
+      (version (git-version "0.1.0" revision commit))
+      (home-page "https://github.com/kennethreitz-archive/args")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url home-page)
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1zfxpbp9vldqdrjmd0c6y3wisl35mx5v8zlyp3nhwpy1730wrc9j"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (add-after 'unpack 'patch-args.py
+                      (lambda _
+                        (substitute* "args.py"
+                          (("basestring") "str"))))
+                    (replace 'check
+                      (lambda* (#:key tests? #:allow-other-keys)
+                        (when tests?
+                          (invoke "nosetests" "-v")))))))
+      (native-inputs (list python-nose))
+      (synopsis "Command-line argument parser")
+      (description
+       "This library provides a Python module to parse command-line arguments.")
+      (license license:bsd-3))))
 
 (define-public python2-args
   (package-with-python2 python-args))
-- 
2.34.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 04 Aug 2022 09:10:02 GMT) Full text and rfc822 format available.

Notification sent to Tanguy Le Carrour <tanguy <at> bioneland.org>:
bug acknowledged by developer. (Thu, 04 Aug 2022 09:10:03 GMT) Full text and rfc822 format available.

Message #37 received at 53046-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tanguy Le Carrour <tanguy <at> bioneland.org>
Cc: 53046-done <at> debbugs.gnu.org, maximedevos <at> telenet.be
Subject: Re: bug#53046: [PATCH] gnu: python-args: Patch reference to
 basestring.
Date: Thu, 04 Aug 2022 11:09:39 +0200
Hi Tanguy,

Tanguy Le Carrour <tanguy <at> bioneland.org> skribis:

> * gnu/packages/python-xyz.scm (python-args)[source]: Use the latest version
> from the git repository to get the test suite.
> [home-page]: Update URL.
> [native-inputs]: Add python-nose.
> [arguments]: Replace reference to basestring with str. Invoke nosetests.

Finally applied, sorry for the delay, and thanks for reminding us!  :-)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#53046; Package guix-patches. (Thu, 04 Aug 2022 09:44:02 GMT) Full text and rfc822 format available.

Message #40 received at 53046-done <at> debbugs.gnu.org (full text, mbox):

From: Tanguy LE CARROUR <tanguy <at> bioneland.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 53046-done <at> debbugs.gnu.org, maximedevos <at> telenet.be
Subject: Re: bug#53046: [PATCH] gnu: python-args: Patch reference to
 basestring.
Date: Thu, 04 Aug 2022 11:42:55 +0200
Hi Ludo’,


Quoting Ludovic Courtès (2022-08-04 11:09:39)
> Tanguy Le Carrour <tanguy <at> bioneland.org> skribis:
> 
> > * gnu/packages/python-xyz.scm (python-args)[source]: Use the latest version
> > from the git repository to get the test suite.
> > [home-page]: Update URL.
> > [native-inputs]: Add python-nose.
> > [arguments]: Replace reference to basestring with str. Invoke nosetests.
> 
> Finally applied, sorry for the delay, and thanks for reminding us!  :-)

Thanks!

-- 
Tanguy




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 Sep 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.