[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/1] WIP: python-3: Update to 3.6.0.
From: |
Leo Famulari |
Subject: |
[PATCH 1/1] WIP: python-3: Update to 3.6.0. |
Date: |
Sat, 4 Mar 2017 17:20:31 -0500 |
* gnu/packages/patches/python-3.4-fix-tests.patch,
gnu/packages/patches/python-3.5-fix-tests.patch: Delete files.
* gnu/packages/patches/python-3-AEAD-linux-test-failure.patch,
gnu/packages/patches/python-3.6-fix-tests.patch: New files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/python.scm (python-3.4, python-3.5): Remove variables.
(python-3.6): New variable.
(python-3): Use python-3.6.
---
gnu/local.mk | 4 +-
.../patches/python-3-AEAD-linux-test-failure.patch | 81 ++++++++++++++++++++++
gnu/packages/patches/python-3.4-fix-tests.patch | 12 ----
gnu/packages/patches/python-3.5-fix-tests.patch | 46 ------------
gnu/packages/patches/python-3.6-fix-tests.patch | 78 +++++++++++++++++++++
gnu/packages/patches/python-fix-tests.patch | 19 -----
gnu/packages/python.scm | 31 +++------
7 files changed, 170 insertions(+), 101 deletions(-)
create mode 100644 gnu/packages/patches/python-3-AEAD-linux-test-failure.patch
delete mode 100644 gnu/packages/patches/python-3.4-fix-tests.patch
delete mode 100644 gnu/packages/patches/python-3.5-fix-tests.patch
create mode 100644 gnu/packages/patches/python-3.6-fix-tests.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index ce8ea3d37..2620238c0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -853,8 +853,8 @@ dist_patch_DATA =
\
%D%/packages/patches/python-2.7-source-date-epoch.patch \
%D%/packages/patches/python-3-deterministic-build-info.patch \
%D%/packages/patches/python-3-search-paths.patch \
- %D%/packages/patches/python-3.4-fix-tests.patch \
- %D%/packages/patches/python-3.5-fix-tests.patch \
+ %D%/packages/patches/python-3-AEAD-linux-test-failure.patch \
+ %D%/packages/patches/python-3.6-fix-tests.patch \
%D%/packages/patches/python-dendropy-fix-tests.patch \
%D%/packages/patches/python-file-double-encoding-bug.patch \
%D%/packages/patches/python-fix-tests.patch \
diff --git a/gnu/packages/patches/python-3-AEAD-linux-test-failure.patch
b/gnu/packages/patches/python-3-AEAD-linux-test-failure.patch
new file mode 100644
index 000000000..277eb4300
--- /dev/null
+++ b/gnu/packages/patches/python-3-AEAD-linux-test-failure.patch
@@ -0,0 +1,81 @@
+Fix a test failure with recent Linux kernels:
+
+https://bugs.python.org/issue29324
+
+Patch copied from upstream source repository:
+
+https://github.com/python/cpython/commit/9764c151c51480a7ca6042b1ccd69be2620ff360
+
+From 9764c151c51480a7ca6042b1ccd69be2620ff360 Mon Sep 17 00:00:00 2001
+From: matejcik <address@hidden>
+Date: Thu, 16 Feb 2017 14:41:31 +0100
+Subject: [PATCH] update test_socket AEAD test for kernel 4.9 and up (#133)
+
+---
+ Lib/test/test_socket.py | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index b5c9c0cf21..81f7cf774b 100644
+--- Lib/test/test_socket.py
++++ Lib/test/test_socket.py
+@@ -5487,7 +5487,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
+ self.assertEqual(len(dec), msglen * multiplier)
+ self.assertEqual(dec, msg * multiplier)
+
+- @support.requires_linux_version(4, 3) # see test_aes_cbc
++ @support.requires_linux_version(4, 9) # see issue29324
+ def test_aead_aes_gcm(self):
+ key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c')
+ iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2')
+@@ -5510,8 +5510,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
+ op.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, iv=iv,
+ assoclen=assoclen, flags=socket.MSG_MORE)
+ op.sendall(assoc, socket.MSG_MORE)
+- op.sendall(plain, socket.MSG_MORE)
+- op.sendall(b'\x00' * taglen)
++ op.sendall(plain)
+ res = op.recv(assoclen + len(plain) + taglen)
+ self.assertEqual(expected_ct, res[assoclen:-taglen])
+ self.assertEqual(expected_tag, res[-taglen:])
+@@ -5519,7 +5518,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
+ # now with msg
+ op, _ = algo.accept()
+ with op:
+- msg = assoc + plain + b'\x00' * taglen
++ msg = assoc + plain
+ op.sendmsg_afalg([msg], op=socket.ALG_OP_ENCRYPT, iv=iv,
+ assoclen=assoclen)
+ res = op.recv(assoclen + len(plain) + taglen)
+@@ -5530,7 +5529,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
+ pack_uint32 = struct.Struct('I').pack
+ op, _ = algo.accept()
+ with op:
+- msg = assoc + plain + b'\x00' * taglen
++ msg = assoc + plain
+ op.sendmsg(
+ [msg],
+ ([socket.SOL_ALG, socket.ALG_SET_OP,
pack_uint32(socket.ALG_OP_ENCRYPT)],
+@@ -5538,7 +5537,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
+ [socket.SOL_ALG, socket.ALG_SET_AEAD_ASSOCLEN,
pack_uint32(assoclen)],
+ )
+ )
+- res = op.recv(len(msg))
++ res = op.recv(len(msg) + taglen)
+ self.assertEqual(expected_ct, res[assoclen:-taglen])
+ self.assertEqual(expected_tag, res[-taglen:])
+
+@@ -5548,8 +5547,8 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
+ msg = assoc + expected_ct + expected_tag
+ op.sendmsg_afalg([msg], op=socket.ALG_OP_DECRYPT, iv=iv,
+ assoclen=assoclen)
+- res = op.recv(len(msg))
+- self.assertEqual(plain, res[assoclen:-taglen])
++ res = op.recv(len(msg) - taglen)
++ self.assertEqual(plain, res[assoclen:])
+
+ @support.requires_linux_version(4, 3) # see test_aes_cbc
+ def test_drbg_pr_sha256(self):
+--
+2.12.0
+
diff --git a/gnu/packages/patches/python-3.4-fix-tests.patch
b/gnu/packages/patches/python-3.4-fix-tests.patch
deleted file mode 100644
index d1f8138e7..000000000
--- a/gnu/packages/patches/python-3.4-fix-tests.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- Lib/test/test_posixpath.py 2014-03-01 05:46:56.984311000 +0100
-+++ Lib/test/test_posixpath.py 2014-03-07 00:59:20.888311000 +0100
-@@ -319,7 +319,11 @@
- del env['HOME']
- home = pwd.getpwuid(os.getuid()).pw_dir
- # $HOME can end with a trailing /, so strip it (see #17809)
-- self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
-+ # The Guix builders have '/' as a home directory, so
-+ # home.rstrip("/") will be an empty string and the test will
-+ # fail. Let's just disable it since it does not really make
-+ # sense with such a bizarre setup.
-+ # self.assertEqual(posixpath.expanduser("~"),
home.rstrip("/"))
diff --git a/gnu/packages/patches/python-3.5-fix-tests.patch
b/gnu/packages/patches/python-3.5-fix-tests.patch
deleted file mode 100644
index 46d2a84ef..000000000
--- a/gnu/packages/patches/python-3.5-fix-tests.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-Additional test fixes which affect Python 3.5 (and presumably later) but not
-prior revisions of Python.
-
---- Lib/test/test_pathlib.py 2014-03-01 03:02:36.088311000 +0100
-+++ Lib/test/test_pathlib.py 2014-03-01 04:56:37.768311000 +0100
-@@ -1986,8 +1986,9 @@
- expect = set() if not support.fs_is_case_insensitive(BASE) else given
- self.assertEqual(given, expect)
- self.assertEqual(set(p.rglob("FILEd*")), set())
-
-+ @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for
these tests")
- def test_expanduser(self):
- P = self.cls
- support.import_module('pwd')
- import pwd
---- Lib/test/test_tarfile.py 2016-02-24 19:22:52.597208055 +0000
-+++ Lib/test/test_tarfile.py 2016-02-24 20:50:48.941950135 +0000
-@@ -2305,11 +2305,14 @@
- try:
- import pwd, grp
- except ImportError:
- return False
-- if pwd.getpwuid(0)[0] != 'root':
-- return False
-- if grp.getgrgid(0)[0] != 'root':
-+ try:
-+ if pwd.getpwuid(0)[0] != 'root':
-+ return False
-+ if grp.getgrgid(0)[0] != 'root':
-+ return False
-+ except KeyError:
- return False
- return True
-
-
---- Lib/test/test_asyncio/test_base_events.py
-+++ Lib/test/test_asyncio/test_base_events.py
-@@ -142,6 +142,8 @@ class BaseEventTests(test_utils.TestCase):
- (INET, STREAM, TCP, '', ('1.2.3.4', 1)),
- base_events._ipaddr_info('1.2.3.4', b'1', INET, STREAM, TCP))
-
-+ @unittest.skipUnless(support.is_resource_enabled('network'),
-+ 'network is not enabled')
- def test_getaddrinfo_servname(self):
- INET = socket.AF_INET
- STREAM = socket.SOCK_STREAM
diff --git a/gnu/packages/patches/python-3.6-fix-tests.patch
b/gnu/packages/patches/python-3.6-fix-tests.patch
new file mode 100644
index 000000000..1dd79c372
--- /dev/null
+++ b/gnu/packages/patches/python-3.6-fix-tests.patch
@@ -0,0 +1,78 @@
+Additional test fixes which affect Python 3.5 (and presumably later) but not
+prior revisions of Python.
+
+--- Lib/test/test_pathlib.py 2014-03-01 03:02:36.088311000 +0100
++++ Lib/test/test_pathlib.py 2014-03-01 04:56:37.768311000 +0100
+@@ -1986,8 +1986,9 @@
+ expect = set() if not support.fs_is_case_insensitive(BASE) else given
+ self.assertEqual(given, expect)
+ self.assertEqual(set(p.rglob("FILEd*")), set())
+
++ @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for
these tests")
+ def test_expanduser(self):
+ P = self.cls
+ support.import_module('pwd')
+ import pwd
+--- Lib/test/test_tarfile.py 2016-02-24 19:22:52.597208055 +0000
++++ Lib/test/test_tarfile.py 2016-02-24 20:50:48.941950135 +0000
+@@ -2305,11 +2305,14 @@
+ try:
+ import pwd, grp
+ except ImportError:
+ return False
+- if pwd.getpwuid(0)[0] != 'root':
+- return False
+- if grp.getgrgid(0)[0] != 'root':
++ try:
++ if pwd.getpwuid(0)[0] != 'root':
++ return False
++ if grp.getgrgid(0)[0] != 'root':
++ return False
++ except KeyError:
+ return False
+ return True
+
+
+--- Lib/test/test_asyncio/test_base_events.py
++++ Lib/test/test_asyncio/test_base_events.py
+@@ -1216,6 +1216,8 @@ class
BaseEventLoopWithSelectorTests(test_utils.TestCase):
+ self._test_create_connection_ip_addr(m_socket, False)
+
+ @patch_socket
++ @unittest.skipUnless(support.is_resource_enabled('network'),
++ 'network is not enabled')
+ def test_create_connection_service_name(self, m_socket):
+ m_socket.getaddrinfo = socket.getaddrinfo
+ sock = m_socket.socket.return_value
+diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index af5f00f..135ea5d 100644
+--- Lib/test/test_shutil.py
++++ Lib/test/test_shutil.py
+@@ -1145,6 +1145,7 @@ class TestShutil(unittest.TestCase):
+ self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+
+ @requires_zlib
++ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+ def test_make_archive_owner_group(self):
+ # testing make_archive with owner and group, with various combinations
+ # this works even if there's not gid/uid support
+@@ -1173,6 +1174,7 @@ class TestShutil(unittest.TestCase):
+
+
+ @requires_zlib
++ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+ @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+ def test_tarfile_root_owner(self):
+ root_dir, base_dir = self._create_files()
+diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index e893f3a..f07022b 100644
+--- Lib/test/test_spwd.py
++++ Lib/test/test_spwd.py
+@@ -58,6 +58,7 @@ class TestSpwdRoot(unittest.TestCase):
+
+ @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
+ 'non-root user required')
address@hidden(True, "assumes that /etc/shadow exists?")
+ class TestSpwdNonRoot(unittest.TestCase):
+
+ def test_getspnam_exception(self):
diff --git a/gnu/packages/patches/python-fix-tests.patch
b/gnu/packages/patches/python-fix-tests.patch
index e093307c5..e5038a0dd 100644
--- a/gnu/packages/patches/python-fix-tests.patch
+++ b/gnu/packages/patches/python-fix-tests.patch
@@ -1,25 +1,6 @@
See the discussion about the issues fixed here at:
http://bugs.python.org/issue20868 .
---- Lib/test/test_shutil.py 2014-03-01 03:02:36.088311000 +0100
-+++ Lib/test/test_shutil.py 2014-03-01 04:56:37.768311000 +0100
-@@ -1053,6 +1053,7 @@
- self.assertRaises(ValueError, make_archive, base_name, 'xxx')
-
- @requires_zlib
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- def test_make_archive_owner_group(self):
- # testing make_archive with owner and group, with various combinations
- # this works even if there's not gid/uid support
-@@ -1081,6 +1082,7 @@
-
-
- @requires_zlib
-+ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
- @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
- def test_tarfile_root_owner(self):
- tmpdir, tmpdir2, base_name = self._create_files()
-
--- Lib/test/test_socket.py.orig 2014-03-02 22:14:12.264311000 +0100
+++ Lib/test/test_socket.py 2014-03-21 03:50:45.660311000 +0100
@@ -819,6 +819,8 @@
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 804005fa4..12be1eaf1 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -313,22 +313,26 @@ data types.")
;; Current 2.x version.
(define-public python-2 python-2.7)
-(define-public python-3.5
+(define-public python-3.6
(package (inherit python-2)
- (version "3.5.2")
+ (version "3.6.0")
(source (origin
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
version "/Python-" version ".tar.xz"))
(patches (search-patches
"python-fix-tests.patch"
- "python-3.5-fix-tests.patch"
+ "python-3.6-fix-tests.patch"
+ "python-3-AEAD-linux-test-failure.patch"
+
+ ;; unnecessary after core-updates's GCC 7 backport?
"python-3-deterministic-build-info.patch"
+
"python-3-search-paths.patch"))
(patch-flags '("-p0"))
(sha256
(base32
- "0h6a5fr7ram2s483lh0pnmc4ncijb8llnpfdxdcl5dxr01hza400"))))
+ "08inlbb2vb8lahw6wfq654lqk6l1x7ncpggp6a92vqw5yq2gkidh"))))
(arguments (substitute-keyword-arguments (package-arguments python-2)
((#:tests? _) #t)))
(native-search-paths
@@ -338,25 +342,8 @@ data types.")
(version-major+minor version)
"/site-packages"))))))))
-(define-public python-3.4
- (package (inherit python-3.5)
- (version "3.4.5")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://www.python.org/ftp/python/"
- version "/Python-" version ".tar.xz"))
- (patches (search-patches
- "python-fix-tests.patch"
- "python-3.4-fix-tests.patch"
- "python-3-deterministic-build-info.patch"
- "python-3-search-paths.patch"))
- (patch-flags '("-p0"))
- (sha256
- (base32
- "12l9klp778wklxmckhghniy5hklss8r26995pyd00qbllk4b2r7f"))))))
-
;; Current 3.x version.
-(define-public python-3 python-3.5)
+(define-public python-3 python-3.6)
;; Current major version.
(define-public python python-3)
--
2.12.0