[PATCH] gnu: b4: Fix setup.py version incompatibility.

  • Done
  • quality assurance status badge
Details
2 participants
  • Efraim Flashner
  • Kyle Meyer
Owner
unassigned
Submitted by
Kyle Meyer
Severity
normal

Debbugs page

Kyle Meyer wrote 4 years ago
(address . guix-patches@gnu.org)
20210302015158.16177-1-kyle@kyleam.com
Following the update of python-requests to 2.25.0, b4 fails at runtime with a
pkg_resources.ContextualVersionConflict exception. This has been addressed
upstream. Temporarily apply the upstream fix.

* gnu/packages/patches/b4-loosen-version-identifiers.patch: New patch.
* gnu/packages/version-control.scm (b4): Apply it.
---
.../b4-loosen-version-identifiers.patch | 44 +++++++++++++++++++
gnu/packages/version-control.scm | 3 +-
2 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/b4-loosen-version-identifiers.patch

Toggle diff (68 lines)
diff --git a/gnu/packages/patches/b4-loosen-version-identifiers.patch b/gnu/packages/patches/b4-loosen-version-identifiers.patch
new file mode 100644
index 0000000000..5ae5865274
--- /dev/null
+++ b/gnu/packages/patches/b4-loosen-version-identifiers.patch
@@ -0,0 +1,44 @@
+From e66d514b4113fffc81e48c7c531dcf148ba8b8e8 Mon Sep 17 00:00:00 2001
+From: Kyle Meyer <kyle@kyleam.com>
+Date: Thu, 25 Feb 2021 23:25:57 -0500
+Subject: Loosen compatible release identifiers for install_requires
+
+The install_requires entries use a compatible release operator. As an
+example, "requests~=2.24.0" maps to a requirement of ">= 2.24.0 and ==
+2.24.*". With the current version of requests (2.25.1), this leads to
+a ContextualVersionConflict failure at runtime.
+
+Allowing only Z to tick in version X.Y.Z seems unnecessarily strict
+unless there are known problems with a particular release, and it
+makes it more difficult for distributions to package b4. Drop the
+trailing digit from all of the version identifiers, allowing both Y
+and Z to increase.
+
+Signed-off-by: Kyle Meyer <kyle@kyleam.com>
+Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
+---
+ This patch was taken from the upstream repository and will be included in
+ the next release.
+
+ https://git.kernel.org/pub/scm/utils/b4/b4.git/patch/?id=e66d514b4113fffc81e48c7c531dcf148ba8b8e8
+
+ setup.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 358e6a7..a21ec76 100644
+--- a/setup.py
++++ b/setup.py
+@@ -41,9 +41,9 @@ setup(
+ data_files = [('share/man/man5', ['man/b4.5'])],
+ keywords=['git', 'lore.kernel.org', 'patches'],
+ install_requires=[
+- 'requests~=2.24.0',
+- 'dkimpy~=1.0.5',
+- 'dnspython~=2.0.0',
++ 'requests~=2.24',
++ 'dkimpy~=1.0',
++ 'dnspython~=2.0',
+ ],
+ python_requires='>=3.6',
+ entry_points={
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 3afb06ca79..2fb8fa821f 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -2347,7 +2347,8 @@ (define-public b4
(method url-fetch)
(uri (pypi-uri "b4" version))
(sha256
- (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))))
+ (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))
+ (patches (search-patches "b4-loosen-version-identifiers.patch"))))
(build-system python-build-system)
(arguments '(#:tests? #f)) ; No tests.
(inputs

base-commit: 4bc9a1f4e3bd39302b4ceaab8589a2e6ef82c4bd
--
2.31.0.rc0.254.gbdcc3b1a9d
Efraim Flashner wrote 4 years ago
(name . Kyle Meyer)(address . kyle@kyleam.com)(address . 46866@debbugs.gnu.org)
YEctPxAc/y/aIcet@3900XT
Indeed, it does fail at startup. Two things about your patch, you've
added a patch file but didn't register it in gnu/local.mk. This means
it'll get dropped during a 'make dist' which would be a problem. The
second is that it's a lot of patch for a small amount of code change.
With your permission I'd like to commit the attached patch instead.

--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
From 9b0187ac1e28edb987cb5b76c4c3ae8330bcf7eb Mon Sep 17 00:00:00 2001
From: Kyle Meyer <kyle@kyleam.com>
Date: Tue, 9 Mar 2021 10:06:13 +0200
Subject: [PATCH] gnu: b4: Fix setup.py version incompatibility.

* gnu/packages/version-control.scm (b4)[source]: Add snippet to not
require too specific of a version.

Co-authored with Efraim Flashner <efraim@flashner.co.il>

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
---
gnu/packages/version-control.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 8292a5df15..4051efed9c 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -7,7 +7,7 @@
;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2016, 2019 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2015, 2018, 2020 Kyle Meyer <kyle@kyleam.com>
+;;; Copyright © 2015, 2018, 2020, 2021 Kyle Meyer <kyle@kyleam.com>
;;; Copyright © 2015, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2016, 2017, 2018 Nikita <nikita@n0.is>
@@ -2347,7 +2347,15 @@ based on a manifest file published by servers.")
(method url-fetch)
(uri (pypi-uri "b4" version))
(sha256
- (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))))
+ (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Fixes issue with dependency requirements being too strict. See upstream commit:
+ ;; https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=31348a14afdb1d39e7faf9576eaddea1ced76e19
+ (substitute* "setup.py"
+ (("\\.0'") "'"))
+ #t))))
(build-system python-build-system)
(arguments '(#:tests? #f)) ; No tests.
(inputs
--
2.30.1
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBHLT8ACgkQQarn3Mo9
g1F4zhAAqNFLXWsx4Rk//pk4ivzZv70XfH4PtxK2fEUeA0EN+XWRGm/6y9/0KsPh
+RbpnSlgDMEmBiui2bQKu5TRj/1Nc5n2aqDgV5HOVN32GvaJkoTuUMM6KRCT7jQx
vSnVazhVFLWNdwUiaNcZ7+DXwF4m2wUh0kHZ3U2Btv9L03KZNw//2hdEv/cmDo2E
ARelTIi7yQtvah2v6Abcol/btyPQrty50cVNOCTFEJNXrXXaexqe4AuQpJiBHimz
eugtQdN9hXfTciWUUZ+MsGJa/xk63p2q2n3lT5pf3ZcdqvWBKB03GVTjNpOaaIWj
aXy8QGMlsXYuzCkyh7S9yf1b4CpY5gnDLeq72UYknl516huD74WXwecKhxB6ihVj
SCkWcjhr0K2nU5NiOMBIYGJ2TpOsg+qn0sDFWmNxt7iz1eeVg1vXReGojGDxQYuC
y+xia6FJUVtaHhhcsG5BSVKv4kSu8zeG4aphVC/OrMrM1uq6jLD2MIN1MFlnsIwJ
P2dT2r6gFimevuIPgRUoBKn5124AUiNx1+OMHxxZjRrcNC2GJqgOQ98z5Q7gxXBE
geDRDzowuFdhlpOKzkpHCFGU5kyFvE5og6x423rNqrEF3JWWbtuMQOXT3ERapb4E
SiRynQ9leinC6jvXzMA39gndcVefXW/V7jP+Cy9bVo+ov+ks3c4=
=quQA
-----END PGP SIGNATURE-----


Kyle Meyer wrote 4 years ago
(name . Efraim Flashner)(address . efraim@flashner.co.il)(address . 46866@debbugs.gnu.org)
87wnugym43.fsf@kyleam.com
Efraim Flashner writes:

Toggle quote (4 lines)
> Indeed, it does fail at startup. Two things about your patch, you've
> added a patch file but didn't register it in gnu/local.mk. This means
> it'll get dropped during a 'make dist' which would be a problem.

Doh, thanks for catching that.

Toggle quote (3 lines)
> The second is that it's a lot of patch for a small amount of code
> change.

I like that a patch fails loudly once it's no longer valid, but I'm
happy to defer to your opinion that it's an overkill here (and will try
to recalibrate for future patches).

Toggle quote (1 lines)
> With your permission I'd like to commit the attached patch instead.
[...]
Toggle quote (11 lines)
> From: Kyle Meyer <kyle@kyleam.com>
> Date: Tue, 9 Mar 2021 10:06:13 +0200
> Subject: [PATCH] gnu: b4: Fix setup.py version incompatibility.
>
> * gnu/packages/version-control.scm (b4)[source]: Add snippet to not
> require too specific of a version.
>
> Co-authored with Efraim Flashner <efraim@flashner.co.il>
>
> Signed-off-by: Efraim Flashner <efraim@flashner.co.il>

Sounds fine to me. I have a slight preference that you put yourself as
the author and put a

Noticed-by: Kyle Meyer <kyle@kyleam.com>

or

Reported-by: Kyle Meyer <kyle@kyleam.com>

trailer for me, but either way is okay.

Toggle quote (14 lines)
> @@ -2347,7 +2347,15 @@ based on a manifest file published by servers.")
> (method url-fetch)
> (uri (pypi-uri "b4" version))
> (sha256
> - (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))))
> + (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))
> + (modules '((guix build utils)))
> + (snippet
> + '(begin
> + ;; Fixes issue with dependency requirements being too strict. See upstream commit:
> + ;; https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=31348a14afdb1d39e7faf9576eaddea1ced76e19
> + (substitute* "setup.py"
> + (("\\.0'") "'"))

Just a note: This won't catch a similar problem if dkimpy (1.0.5) is
upgraded before b4, though perhaps that's unlikely and not worth
worrying about.

Thank you for the review.
Efraim Flashner wrote 4 years ago
(name . Kyle Meyer)(address . kyle@kyleam.com)(address . 46866-done@debbugs.gnu.org)
YFCkvWiU0fOgiDWn@3900XT
On Tue, Mar 09, 2021 at 05:54:04PM -0500, Kyle Meyer wrote:
Toggle quote (59 lines)
> Efraim Flashner writes:
>
> > Indeed, it does fail at startup. Two things about your patch, you've
> > added a patch file but didn't register it in gnu/local.mk. This means
> > it'll get dropped during a 'make dist' which would be a problem.
>
> Doh, thanks for catching that.
>
> > The second is that it's a lot of patch for a small amount of code
> > change.
>
> I like that a patch fails loudly once it's no longer valid, but I'm
> happy to defer to your opinion that it's an overkill here (and will try
> to recalibrate for future patches).
>
> > With your permission I'd like to commit the attached patch instead.
> [...]
> > From: Kyle Meyer <kyle@kyleam.com>
> > Date: Tue, 9 Mar 2021 10:06:13 +0200
> > Subject: [PATCH] gnu: b4: Fix setup.py version incompatibility.
> >
> > * gnu/packages/version-control.scm (b4)[source]: Add snippet to not
> > require too specific of a version.
> >
> > Co-authored with Efraim Flashner <efraim@flashner.co.il>
> >
> > Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
>
> Sounds fine to me. I have a slight preference that you put yourself as
> the author and put a
>
> Noticed-by: Kyle Meyer <kyle@kyleam.com>
>
> or
>
> Reported-by: Kyle Meyer <kyle@kyleam.com>
>
> trailer for me, but either way is okay.
>
> > @@ -2347,7 +2347,15 @@ based on a manifest file published by servers.")
> > (method url-fetch)
> > (uri (pypi-uri "b4" version))
> > (sha256
> > - (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))))
> > + (base32 "1j904dy9cwxl85k2ngc498q5cdnqwsmw3jibjr1m55w8aqdck68z"))
> > + (modules '((guix build utils)))
> > + (snippet
> > + '(begin
> > + ;; Fixes issue with dependency requirements being too strict. See upstream commit:
> > + ;; https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=31348a14afdb1d39e7faf9576eaddea1ced76e19
> > + (substitute* "setup.py"
> > + (("\\.0'") "'"))
>
> Just a note: This won't catch a similar problem if dkimpy (1.0.5) is
> upgraded before b4, though perhaps that's unlikely and not worth
> worrying about.
>
> Thank you for the review.

Not sure how I forgot I had this waiting for me. I changed the
substitution from "\\.0'" to change the ~= to >= and pushed it.

--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBQpL0ACgkQQarn3Mo9
g1GR2A//W+TDQRKTedaFJ84u8VsGdlb/+HCXn9/iXPglaw2wEWcMg+ZDOLj9khDR
Cos/HuHkwsRTc6luHP6mT3me5KywXePP5kgke3/Oe4VQOhCcRY+VriCqOJi748KK
AEKu7aFlOMweGxVRfDyaG9wJ7Koz4QTEaYci1+EMTmzOA4gAgXtLPvIxF50H5N3i
k+NeVf1C3vbcrMR70yDaFMde0I5jqi9HeSik4GA4l/0P3h27Az0Tu4JesMdD7W86
MOXG2jbhdBgIh/+qZMT5KuIsMmpyh2QiFcXwisffuskbdLDjZ1jWBMpOUnI0cBER
d1PNfO0R6/iSGKv9jNPK/Pli1KfuyGWWfa0fOBKQUwKer1STOSkLoZ8diqdE52uc
xrs41RN2RGsCOahzlcwebYFpMbtNsz5yza0zSp6oSGvrnNGpBV0A356ZYCvT5Hj2
A5T090G17xbNp3xUthEgE/QrAX9SfmrL8nh0TyhcqgV/FViajI7P1qeBgUv3bxVv
xg+iMLf9uKmqmDcy3q/+3QpTNAnkPx7VcBmtSDzqMa8UfkkrOKH4cHxG7gHX+ykI
iAhfQtoSp9fMgL4p+MsYuyik9742CcMvnQOk8uZXUdcmfJu8OOrQ7CQ2N15Gbxiy
Ny3atfi74GNL8mI3UV2H845m1tHs+f1FBiC7gmNWBmxT3vhsSaQ=
=x9bZ
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 46866@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 46866
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help