[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20/20: gnu: python-shouldbe: Python 3.8 compatibility.
From: |
guix-commits |
Subject: |
20/20: gnu: python-shouldbe: Python 3.8 compatibility. |
Date: |
Wed, 20 May 2020 17:53:35 -0400 (EDT) |
mbakke pushed a commit to branch master
in repository guix.
commit 9b65cdd902ec39115dbf3e0ad34e49f544ab4267
Author: Lars-Dominik Braun <address@hidden>
AuthorDate: Tue May 19 09:46:49 2020 +0200
gnu: python-shouldbe: Python 3.8 compatibility.
* 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.
Signed-off-by: Marius Bakke <address@hidden>
---
gnu/local.mk | 1 +
.../patches/python-shouldbe-0.1.2-cpy3.8.patch | 82 ++++++++++++++++++++++
gnu/packages/python-xyz.scm | 3 +-
3 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 8d737f2..91f094c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1434,6 +1434,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 0000000..f3b56e4
--- /dev/null
+++ b/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch
@@ -0,0 +1,82 @@
+Fix compatibility with Python 3.8.
+
+Upstream issue: https://github.com/DirectXMan12/should_be/pull/5
+
+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 1f96ed4..a0f44dd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18788,7 +18788,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)))
- 04/20: gnu: Add ruby-single-cov., (continued)
- 04/20: gnu: Add ruby-single-cov., guix-commits, 2020/05/20
- 07/20: gnu: Add ruby-maxitest., guix-commits, 2020/05/20
- 05/20: gnu: ruby-mocha: Update to 1.11.2., guix-commits, 2020/05/20
- 06/20: gnu: ruby-mocha: Update license., guix-commits, 2020/05/20
- 08/20: gnu: Add ruby-fakefs., guix-commits, 2020/05/20
- 09/20: gnu: Add ruby-gherkin-ruby., guix-commits, 2020/05/20
- 10/20: gnu: Add ruby-colorize., guix-commits, 2020/05/20
- 13/20: gnu: Add ruby-forking-test-runner., guix-commits, 2020/05/20
- 14/20: gnu: Add ruby-fast-gettext., guix-commits, 2020/05/20
- 15/20: gnu: varnish-modules: Update to 0.16.0., guix-commits, 2020/05/20
- 20/20: gnu: python-shouldbe: Python 3.8 compatibility.,
guix-commits <=
- 11/20: gnu: Add ruby-spinach., guix-commits, 2020/05/20
- 12/20: gnu: Add ruby-parallel-tests., guix-commits, 2020/05/20
- 16/20: gnu: varnish-modules: Update description., guix-commits, 2020/05/20
- 17/20: gnu: fontconfig: Add replacement with font-dejavu instead of gs-fonts., guix-commits, 2020/05/20
- 18/20: gnu: Add python-random-user-agent., guix-commits, 2020/05/20
- 19/20: gnu: racket-minimal: Fix hash for version 7.7., guix-commits, 2020/05/20