[PATCH] gnu: python-shouldbe: Python 3.8 compatibility

DoneSubmitted by Lars-Dominik Braun.
Details
2 participants
  • Lars-Dominik Braun
  • Marius Bakke
Owner
unassigned
Severity
normal
L
L
Lars-Dominik Braun wrote on 19 May 2020 09:46
(address . guix-patches@gnu.org)
20200519074649.GA11910@zpidnp36

* gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch: Add compatibility patch
* gnu/local.mk (dist_patch_DATA): Add new file
* gnu/packages/python-xyz.scm (python-shouldbe)[source]: Add patch
---
gnu/local.mk | 1 +
.../python-shouldbe-0.1.2-cpy3.8.patch | 78 +++++++++++++++++++
gnu/packages/python-xyz.scm | 3 +-
3 files changed, 81 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch

Toggle diff (112 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 38b286203e..7ab5882f1b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1432,6 +1432,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
   %D%/packages/patches/python-robotframework-honor-source-date-epoch.patch \
+  %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch	\
   %D%/packages/patches/python-slugify-depend-on-unidecode.patch	\
   %D%/packages/patches/python2-subprocess32-disable-input-test.patch	\
   %D%/packages/patches/python-unittest2-python3-compat.patch	\
diff --git a/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch b/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch
new file mode 100644
index 0000000000..0a80d15cd2
--- /dev/null
+++ b/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch
@@ -0,0 +1,78 @@
+diff -x '*.pyc' -Naur shouldbe-0.1.2/should_be/core.py shouldbe-0.1.2.patched/should_be/core.py
+--- shouldbe-0.1.2/should_be/core.py	2019-03-06 07:38:22.000000000 +0100
++++ shouldbe-0.1.2.patched/should_be/core.py	2020-05-18 08:44:24.214664704 +0200
+@@ -103,7 +103,7 @@
+     return resf
+ 
+ 
+-def buildCode(baseCode, argcount=None, kwonlyargcount=None,
++def buildCode(baseCode, argcount=None, posonlyargcount=None, kwonlyargcount=None,
+               nlocals=None, stacksize=None, flags=None,
+               code=None, consts=None, names=None,
+               varnames=None, filename=None, name=None,
+@@ -121,6 +121,24 @@
+                         nlocals or baseCode.co_nlocals,
+                         stacksize or baseCode.co_stacksize,
+                         flags or baseCode.co_flags,
++                        code or baseCode.co_code,
++                        consts or baseCode.co_consts,
++                        names or baseCode.co_names,
++                        varnames or baseCode.co_varnames,
++                        filename or baseCode.co_filename,
++                        name or baseCode.co_name,
++                        firstlineno or baseCode.co_firstlineno,
++                        lnotab or baseCode.co_lnotab,
++                        freevars or baseCode.co_freevars,
++                        cellvars or baseCode.co_cellvars)
++    elif hasattr(baseCode, 'co_posonlyargcount'):
++        # Python 3.8
++        resc = CodeType(argcount or baseCode.co_argcount,
++                        posonlyargcount or baseCode.co_posonlyargcount,
++                        kwonlyargcount or baseCode.co_kwonlyargcount,
++                        nlocals or baseCode.co_nlocals,
++                        stacksize or baseCode.co_stacksize,
++                        flags or baseCode.co_flags,
+                         code or baseCode.co_code,
+                         consts or baseCode.co_consts,
+                         names or baseCode.co_names,
+diff -x '*.pyc' -Naur shouldbe-0.1.2/should_be/tests/test_container_mixin.py shouldbe-0.1.2.patched/should_be/tests/test_container_mixin.py
+--- shouldbe-0.1.2/should_be/tests/test_container_mixin.py	2019-03-01 06:38:16.000000000 +0100
++++ shouldbe-0.1.2.patched/should_be/tests/test_container_mixin.py	2020-05-18 09:00:51.372531064 +0200
+@@ -7,31 +7,31 @@
+         self.lst = [1, 2, 3]
+ 
+     def test_should_include_iter(self):
+-        err_msg = (r'[a-zA-Z0-9.]+ should have included \[.+?\]'
++        err_msg = (r'[a-zA-Z0-9.()]+ should have included \[.+?\]'
+                    r', but did not have items .+')
+-        self.assertRaisesRegexp(AssertionError, err_msg,
++        self.assertRaisesRegex(AssertionError, err_msg,
+                                 self.lst.should_include, [4])
+ 
+         self.lst.should_include([1, 2, 3])
+ 
+     def test_should_include_item(self):
+-        err_msg = (r'[a-zA-Z0-9.]+ should have included .+?'
++        err_msg = (r'[a-zA-Z0-9.()]+ should have included .+?'
+                    r', but did not')
+-        self.assertRaisesRegexp(AssertionError, err_msg,
++        self.assertRaisesRegex(AssertionError, err_msg,
+                                 self.lst.should_include, 4)
+ 
+         self.lst.should_include(3)
+ 
+     def test_shouldnt_include_iter(self):
+         err_msg = 'should not have included'
+-        self.assertRaisesRegexp(AssertionError, err_msg,
++        self.assertRaisesRegex(AssertionError, err_msg,
+                                 self.lst.shouldnt_include, [2, 3])
+ 
+         self.lst.shouldnt_include([4, 5])
+ 
+     def test_shouldnt_include_item(self):
+         err_msg = 'should not have included'
+-        self.assertRaisesRegexp(AssertionError, err_msg,
++        self.assertRaisesRegex(AssertionError, err_msg,
+                                 self.lst.shouldnt_include, 3)
+ 
+         self.lst.shouldnt_include(4)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c26a766d64..00a4fd51c4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18749,7 +18749,8 @@ and cuts down boilerplate code when testing libraries for asyncio.")
        (uri (pypi-uri "shouldbe" version))
        (sha256
         (base32
-         "16zbvjxf71dl4yfbgcr6idyim3mdrfvix1dv8b95p0s9z07372pj"))))
+         "16zbvjxf71dl4yfbgcr6idyim3mdrfvix1dv8b95p0s9z07372pj"))
+       (patches (search-patches "python-shouldbe-0.1.2-cpy3.8.patch"))))
     (build-system python-build-system)
     (propagated-inputs
       `(("python-forbiddenfruit" ,python-forbiddenfruit)))
-- 
2.20.1
-----BEGIN PGP SIGNATURE-----

iQGzBAABCgAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAl7DjuYACgkQQhN3ARo3
hEYLWgv+K0VSFV/vwFsvLSZ/33Dn9QEb0iXVKVunIFRgpFKCBLKoLZGGhfeHpsK2
Jcj6nf4zDoSBppzdqGhxOCNc97uBem6YZCeyTdtlzpqJ3mxJX/x0so4O91fX9dN8
OBhh9Gn8R7do+7yvitUkQs0vtOydEPVfonXN9IJ4oK2EWI7gooWT4Jnluh/Orf+H
IslJ5tjWBJfwazZGN45P39Ox3GfvcNt91J/+Ux16Ead/7GgCeDqUWT5TDMN6nS85
rL/QNgMFy7G07gyYASwTyjTFS8Id2JhqdOu00xUpwdpcj3cvEGVMXpUEafTbaaZn
yvxZCjQcH9w6wJWv4xytWA7jx/pXGT5Gh5hXQ3nGttoFS57wR+R7YGAVkOhOKZQY
72Zax8aVSnNcjLwiCmcz0wBqsreqGvXYeGNhR5bLbMFmLe1Gq3Xh8KF4jQ0PPp+j
rP8EiiwgkkQRieXmsQ4O38f33kV8CrKbIwpOlF1grzAC7CM783vnsANBX2s077gv
3GTtX7m7
=xmTm
-----END PGP SIGNATURE-----


M
M
Marius Bakke wrote on 20 May 2020 22:39
87zha29w91.fsf@devup.no
Lars-Dominik Braun <ldb@leibniz-psychology.org> writes:

Toggle quote (6 lines)
>
> * gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch: Add compatibility patch
> * gnu/local.mk (dist_patch_DATA): Add new file
> * gnu/packages/python-xyz.scm (python-shouldbe)[source]: Add patch

Applied!

I moved the link to the upstream issue into the patch file and added a
short comment about it, as is customs.

Thank you!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7FlXsACgkQoqBt8qM6
VPoPDAf+O7NCZMNN21T54dGYPBKN7kgWrxTMcsp32d0N/zGzAe3z7Vjf9I6yCoIw
2ixr5y0ARxquSn+syDGcM+E0OgbAs7KK4HfeRbzKjMvID7BlZOKC1nXEPwYFECTn
TlGyHHWeSXCiGyiAvj/EbCpGQKVnb3oiuKkFBs6QwHaeb9E23YV65PfgfU83UVnz
o5QFFT1WdsvnVaPd5tuQ/dX1TtOypuDRGibX1jo9EB39SYQN2NWE5YS1gxwrlxBB
1zIlR67Wz8oR3xG7XIM77PXMrFC2AkYADxP+aYMqXeHYbs+xqiNMiCq7faGow8qb
OpnC+NAKXR+Cwe3KXD6G3Z+Mbgn8YQ==
=4hCm
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

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