Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/
Date: Sun, 04 Sep 2016 18:58:31
Message-Id: 1473015471.5077441631135a94971860a8df76236db9437150.soap@gentoo
1 commit: 5077441631135a94971860a8df76236db9437150
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 4 17:14:23 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 4 18:57:51 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50774416
7
8 dev-python/future: Add py3.5 support
9
10 * Requires backporting some fixes for the testsuite
11
12 Package-Manager: portage-2.3.0
13
14 .../future-0.15.2-fix-py35-test-failures.patch | 57 ++++++++++++++++++++++
15 dev-python/future/future-0.15.2.ebuild | 7 ++-
16 2 files changed, 62 insertions(+), 2 deletions(-)
17
18 diff --git a/dev-python/future/files/future-0.15.2-fix-py35-test-failures.patch b/dev-python/future/files/future-0.15.2-fix-py35-test-failures.patch
19 new file mode 100644
20 index 00000000..8d8e5da
21 --- /dev/null
22 +++ b/dev-python/future/files/future-0.15.2-fix-py35-test-failures.patch
23 @@ -0,0 +1,57 @@
24 +* Fix test failures on py3.5, backported from git, see also
25 + https://github.com/PythonCharmers/python-future/issues/183
26 +* Fix unexpected test successes on py3.5, which are now correct
27 +
28 +--- a/tests/test_future/test_bytes.py
29 ++++ b/tests/test_future/test_bytes.py
30 +@@ -10,6 +10,8 @@
31 + from numbers import Integral
32 + from future.tests.base import unittest, expectedFailurePY2
33 +
34 ++import sys
35 ++
36 +
37 + TEST_UNICODE_STR = u'ℝεα∂@ßʟ℮ ☂ℯṧт υηḯ¢☺ḓ℮'
38 + # Tk icon as a .gif:
39 +@@ -534,6 +536,8 @@
40 + self.assertRaises(ValueError, bytes.maketrans, b'abc', b'xyzq')
41 + self.assertRaises(TypeError, bytes.maketrans, 'abc', 'def')
42 +
43 ++ @unittest.skipIf(sys.version_info[:2] == (3, 5),
44 ++ 'Only works in Py3.5+')
45 + @unittest.expectedFailure
46 + def test_mod(self):
47 + """
48 +@@ -551,6 +555,8 @@
49 + a = b % (b'seventy-nine', 79)
50 + self.assertEqual(a, b'seventy-nine / 100 = 79%')
51 +
52 ++ @unittest.skipIf(sys.version_info[:2] == (3, 5),
53 ++ 'Only works in Py3.5+')
54 + @unittest.expectedFailure
55 + def test_imod(self):
56 + """
57 +--- a/tests/test_future/test_builtins.py
58 ++++ b/tests/test_future/test_builtins.py
59 +@@ -525,11 +525,10 @@
60 + self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode')
61 + self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff)
62 + # Raises TypeError in Python < v3.5, ValueError in v3.5:
63 +- # self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
64 ++ self.assertRaises((TypeError, ValueError), compile, chr(0), 'f', 'exec')
65 + self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
66 + mode='eval', source='0', filename='tmp')
67 + compile('print("\xe5")\n', '', 'exec')
68 +- self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
69 + self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad')
70 +
71 + # test the optimize argument
72 +@@ -1287,7 +1286,7 @@
73 + self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
74 +
75 + # Raises TypeError in Python < v3.5, ValueError in v3.5:
76 +- # self.assertRaises(TypeError, pow, -1, -2, 3)
77 ++ self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
78 + self.assertRaises(ValueError, pow, 1, 2, 0)
79 +
80 + self.assertRaises(TypeError, pow)
81
82 diff --git a/dev-python/future/future-0.15.2.ebuild b/dev-python/future/future-0.15.2.ebuild
83 index 1c5c970..9bafd05 100644
84 --- a/dev-python/future/future-0.15.2.ebuild
85 +++ b/dev-python/future/future-0.15.2.ebuild
86 @@ -2,8 +2,9 @@
87 # Distributed under the terms of the GNU General Public License v2
88 # $Id$
89
90 -EAPI=5
91 -PYTHON_COMPAT=(python{2_7,3_4})
92 +EAPI=6
93 +
94 +PYTHON_COMPAT=( python{2_7,3_4,3_5} )
95
96 inherit distutils-r1
97
98 @@ -16,6 +17,8 @@ SLOT="0"
99 KEYWORDS="~amd64 ~x86"
100 IUSE=""
101
102 +PATCHES=( "${FILESDIR}/${P}-fix-py35-test-failures.patch" )
103 +
104 python_test() {
105 esetup.py test || die
106 }