[PATCH] gnu: python-args: Patch reference to basestring.

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • Tanguy Le Carrour
Owner
unassigned
Submitted by
Tanguy Le Carrour
Severity
normal
T
T
Tanguy Le Carrour wrote on 6 Jan 2022 11:21
(address . guix-patches@gnu.org)(name . Tanguy Le Carrour)(address . tanguy@bioneland.org)
20220106102102.22512-1-tanguy@bioneland.org
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(+)

Toggle diff (21 lines)
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
M
M
Maxime Devos wrote on 9 Jan 2022 22:15
(address . tanguy@bioneland.org)(address . 53046@debbugs.gnu.org)
afcb97725c297693a58d707f78184a39aa32c433.camel@telenet.be
Toggle quote (4 lines)
> 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

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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdtQfRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7o9xAQCohfk76g+CXDBjHwLj3c8y1vAB
5d3zE3aFDRTtAR2PfgEA7mphFe1Zc3Zov6kKjGbBC9oKNeyDynvODvHK1ynG0g4=
=PPCx
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 9 Jan 2022 22:34
(address . tanguy@bioneland.org)(address . 53046@debbugs.gnu.org)
e4a300ba49b83c44343c4242b7d2d349c494c477.camel@telenet.be
Maxime Devos schreef op zo 09-01-2022 om 22:15 [+0100]:
Toggle quote (7 lines)
> > 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?
> [...]

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
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdtU/BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vBAAP9GYzH/udU6ZSJ3RbL3uK7IK1js
HC1dszGBPKDh8Mj+AAD/a9X5u+VkRf1ZQSL7i4eN0pRho0hXqA2G0t2+YvC+sg8=
=tYXW
-----END PGP SIGNATURE-----


T
T
Tanguy LE CARROUR wrote on 10 Jan 2022 08:46
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 53046@debbugs.gnu.org)
164180077632.2244.9328700620299997460@localhost
Hi Maxime,


Quoting Maxime Devos (2022-01-09 22:15:41)
Toggle quote (12 lines)
> > 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! ^_^'


Toggle quote (3 lines)
> Also, returning #true isn't necessary anymore, and this seems better
> fit for a snippet.

OK, I'll fix it.

Thanks for reviewing,

--
Tanguy
T
T
Tanguy LE CARROUR wrote on 10 Jan 2022 08:48
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 53046@debbugs.gnu.org)
164180092977.2244.10462578989817222327@localhost
Hi Maxime,


Quoting Maxime Devos (2022-01-09 22:34:52)
Toggle quote (13 lines)
> 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
T
T
Tanguy Le Carrour wrote on 17 Jan 2022 14:34
[PATCH v2] gnu: Patch reference to basestring.
(address . 53046@debbugs.gnu.org)
20220117133451.9510-1-tanguy@bioneland.org
* 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(-)

Toggle diff (57 lines)
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
M
M
Maxime Devos wrote on 17 Jan 2022 15:14
08476f4975b0d5302aee845ced79a3b4b42d7c6b.camel@telenet.be
Hi,

Tanguy Le Carrour schreef op ma 17-01-2022 om 14:34 [+0100]:
Toggle quote (4 lines)
> +                    (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.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYeV5qBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7n0pAP48hHvfLn+kSE5weUqIiy+337SU
Fuf9AY9PAm2tQHUegAEAs5DXrGjzTRCe0KiYLs57UDWuDPlByF785q1/5CXMVww=
=DRIX
-----END PGP SIGNATURE-----


T
T
Tanguy LE CARROUR wrote on 17 Jan 2022 15:22
164242936818.12945.14538087671981731319@localhost
Hi Maxime,


Quoting Maxime Devos (2022-01-17 15:14:00)
Toggle quote (13 lines)
> 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
T
T
Tanguy Le Carrour wrote on 17 Jan 2022 15:23
[PATCH v3] gnu: Patch reference to basestring.
(address . 53046@debbugs.gnu.org)
20220117142352.14713-1-tanguy@bioneland.org
* 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(-)

Toggle diff (58 lines)
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
T
T
Tanguy Le Carrour wrote on 10 Mar 2022 18:28
[PATCH v4] gnu: python-args: Patch reference to basestring.
(name . Tanguy Le Carrour)(address . tanguy@bioneland.org)
20220310172808.23485-1-tanguy@bioneland.org
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(-)

Toggle diff (58 lines)
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
L
L
Ludovic Courtès wrote on 4 Aug 2022 11:09
Re: bug#53046: [PATCH] gnu: python-args: Patch reference to basestring.
(name . Tanguy Le Carrour)(address . tanguy@bioneland.org)
874jyspe7g.fsf_-_@gnu.org
Hi Tanguy,

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

Toggle quote (6 lines)
> * 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’.
Closed
T
T
Tanguy LE CARROUR wrote on 4 Aug 2022 11:42
(name . Ludovic Courtès)(address . ludo@gnu.org)
165960617521.15352.11666579340495793305@localhost
Hi Ludo’,


Quoting Ludovic Courtès (2022-08-04 11:09:39)
Toggle quote (10 lines)
> Tanguy Le Carrour <tanguy@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
Closed
?