diff options
author | David Seifert <soap@gentoo.org> | 2016-09-04 19:14:23 +0200 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2016-09-04 20:57:51 +0200 |
commit | 5077441631135a94971860a8df76236db9437150 (patch) | |
tree | e519b611f30442f83699565df2d4c4e347a831b0 /dev-python/future | |
parent | 15be84ce818209a329013b398ec2ae527b59a244 (diff) | |
download | gentoo-5077441631135a94971860a8df76236db9437150.tar.gz gentoo-5077441631135a94971860a8df76236db9437150.tar.xz |
dev-python/future: Add py3.5 support
* Requires backporting some fixes for the testsuite
Package-Manager: portage-2.3.0
Diffstat (limited to 'dev-python/future')
-rw-r--r-- | dev-python/future/files/future-0.15.2-fix-py35-test-failures.patch | 57 | ||||
-rw-r--r-- | dev-python/future/future-0.15.2.ebuild | 7 |
2 files changed, 62 insertions, 2 deletions
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 new file mode 100644 index 00000000000..8d8e5daccf1 --- /dev/null +++ b/dev-python/future/files/future-0.15.2-fix-py35-test-failures.patch @@ -0,0 +1,57 @@ +* Fix test failures on py3.5, backported from git, see also + https://github.com/PythonCharmers/python-future/issues/183 +* Fix unexpected test successes on py3.5, which are now correct + +--- a/tests/test_future/test_bytes.py ++++ b/tests/test_future/test_bytes.py +@@ -10,6 +10,8 @@ + from numbers import Integral + from future.tests.base import unittest, expectedFailurePY2 + ++import sys ++ + + TEST_UNICODE_STR = u'ℝεα∂@ßʟ℮ ☂ℯṧт υηḯ¢☺ḓ℮' + # Tk icon as a .gif: +@@ -534,6 +536,8 @@ + self.assertRaises(ValueError, bytes.maketrans, b'abc', b'xyzq') + self.assertRaises(TypeError, bytes.maketrans, 'abc', 'def') + ++ @unittest.skipIf(sys.version_info[:2] == (3, 5), ++ 'Only works in Py3.5+') + @unittest.expectedFailure + def test_mod(self): + """ +@@ -551,6 +555,8 @@ + a = b % (b'seventy-nine', 79) + self.assertEqual(a, b'seventy-nine / 100 = 79%') + ++ @unittest.skipIf(sys.version_info[:2] == (3, 5), ++ 'Only works in Py3.5+') + @unittest.expectedFailure + def test_imod(self): + """ +--- a/tests/test_future/test_builtins.py ++++ b/tests/test_future/test_builtins.py +@@ -525,11 +525,10 @@ + self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode') + self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff) + # Raises TypeError in Python < v3.5, ValueError in v3.5: +- # self.assertRaises(TypeError, compile, chr(0), 'f', 'exec') ++ self.assertRaises((TypeError, ValueError), compile, chr(0), 'f', 'exec') + self.assertRaises(TypeError, compile, 'pass', '?', 'exec', + mode='eval', source='0', filename='tmp') + compile('print("\xe5")\n', '', 'exec') +- self.assertRaises(TypeError, compile, chr(0), 'f', 'exec') + self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad') + + # test the optimize argument +@@ -1287,7 +1286,7 @@ + self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j) + + # Raises TypeError in Python < v3.5, ValueError in v3.5: +- # self.assertRaises(TypeError, pow, -1, -2, 3) ++ self.assertRaises((TypeError, ValueError), pow, -1, -2, 3) + self.assertRaises(ValueError, pow, 1, 2, 0) + + self.assertRaises(TypeError, pow) diff --git a/dev-python/future/future-0.15.2.ebuild b/dev-python/future/future-0.15.2.ebuild index 1c5c9700834..9bafd056787 100644 --- a/dev-python/future/future-0.15.2.ebuild +++ b/dev-python/future/future-0.15.2.ebuild @@ -2,8 +2,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI=5 -PYTHON_COMPAT=(python{2_7,3_4}) +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) inherit distutils-r1 @@ -16,6 +17,8 @@ SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" +PATCHES=( "${FILESDIR}/${P}-fix-py35-test-failures.patch" ) + python_test() { esetup.py test || die } |