public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/
@ 2016-09-04 18:58 David Seifert
  0 siblings, 0 replies; 5+ messages in thread
From: David Seifert @ 2016-09-04 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     5077441631135a94971860a8df76236db9437150
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  4 17:14:23 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Sep  4 18:57:51 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50774416

dev-python/future: Add py3.5 support

* Requires backporting some fixes for the testsuite

Package-Manager: portage-2.3.0

 .../future-0.15.2-fix-py35-test-failures.patch     | 57 ++++++++++++++++++++++
 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 00000000..8d8e5da
--- /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 1c5c970..9bafd05 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
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/
@ 2018-08-21 14:46 Louis Sautier
  0 siblings, 0 replies; 5+ messages in thread
From: Louis Sautier @ 2018-08-21 14:46 UTC (permalink / raw
  To: gentoo-commits

commit:     0608ebb48275246bb82f837af007d9aab2469202
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 21 14:39:59 2018 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Tue Aug 21 14:46:25 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0608ebb4

dev-python/future: add Python 3.7, doc, EAPI=7

Closes: https://github.com/gentoo/gentoo/pull/9597
Package-Manager: Portage-2.3.47, Repoman-2.3.10

 ....0-disable-tests-with-internet-connection.patch | 50 +++++++++++++++++++++
 .../files/future-0.16.0-fix-tests-py37.patch       | 43 ++++++++++++++++++
 dev-python/future/future-0.16.0-r1.ebuild          | 52 ++++++++++++++++++++++
 3 files changed, 145 insertions(+)

diff --git a/dev-python/future/files/future-0.16.0-disable-tests-with-internet-connection.patch b/dev-python/future/files/future-0.16.0-disable-tests-with-internet-connection.patch
new file mode 100644
index 00000000000..b4ba01ed796
--- /dev/null
+++ b/dev-python/future/files/future-0.16.0-disable-tests-with-internet-connection.patch
@@ -0,0 +1,50 @@
+##Skipping tests due to connection failures on Fedora build-system
+##See https://github.com/PythonCharmers/python-future/issues/165 
+
+--- a/tests/test_future/test_standard_library.orig.py	2014-11-21 12:52:03.000000000 +0100
++++ b/tests/test_future/test_standard_library.py	2015-09-02 11:37:36.808826777 +0200
+@@ -318,7 +318,7 @@
+         import builtins
+         self.assertTrue(hasattr(builtins, 'tuple'))
+ 
+-    # @unittest.skip("ssl support has been stripped out for now ...")
++    @unittest.skip("ConnectionError: ('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))...")
+     def test_urllib_request_ssl_redirect(self):
+         """
+         This site redirects to https://...
+@@ -332,6 +332,7 @@
+         # pprint(r.read().decode('utf-8'))
+         self.assertTrue(True)
+ 
++    @unittest.skip("ConnectionError: ('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))...")
+     def test_moves_urllib_request_http(self):
+         """
+         This site (python-future.org) uses plain http (as of 2014-09-23).
+@@ -343,6 +343,7 @@
+         data = r.read()
+         self.assertTrue(b'</html>' in data)
+ 
++    @unittest.skip("ConnectionError: ('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))...")
+     def test_urllib_request_http(self):
+         """
+         This site (python-future.org) uses plain http (as of 2014-09-23).
+
+--- a/tests/test_future/test_requests.orig.py	2014-11-21 12:52:03.000000000 +0100
++++ b/tests/test_future/test_requests.py	2015-09-02 11:39:01.509378296 +0200
+@@ -57,6 +57,7 @@
+     This class tests whether the requests module conflicts with the
+     standard library import hooks, as in issue #19.
+     """
++    @unittest.skip("ConnectionError: ('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))...")
+     def test_remove_hooks_then_requests(self):
+         code = """
+             from future import standard_library
+@@ -79,6 +80,7 @@
+             self.assertTrue(True)
+ 
+ 
++    @unittest.skip("ConnectionError: ('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))...")
+     def test_requests_cm(self):
+         """
+         Tests whether requests can be used importing standard_library modules
+

diff --git a/dev-python/future/files/future-0.16.0-fix-tests-py37.patch b/dev-python/future/files/future-0.16.0-fix-tests-py37.patch
new file mode 100644
index 00000000000..d925d49f983
--- /dev/null
+++ b/dev-python/future/files/future-0.16.0-fix-tests-py37.patch
@@ -0,0 +1,43 @@
+commit ce4f015978d250718ec8dd9f50721da90a9bd18b
+Author: Louis Sautier <sautier.louis@gmail.com>
+Date:   Mon Aug 20 12:42:29 2018 +0200
+
+    Skip int() keyword tests with Python 3.7
+    
+    The first argument must be positional since
+    https://github.com/python/cpython/commit/2e5642422f6234fd8d0c082142b27340e588f96e
+
+diff --git a/tests/test_future/test_int.py b/tests/test_future/test_int.py
+index f1d9c5d..e306550 100644
+--- a/tests/test_future/test_int.py
++++ b/tests/test_future/test_int.py
+@@ -265,6 +265,9 @@ class IntTestCases(unittest.TestCase):
+     def test_no_args(self):
+         self.assertEqual(int(), 0)
+ 
++    @unittest.skipIf(sys.version_info >= (3, 7),
++            "The first parameter must be positional with Python >= 3.7"
++    )
+     def test_keyword_args(self):
+         # Test invoking int() using keyword arguments.
+         self.assertEqual(int(x=1.2), 1)
+
+commit d7a3451753982d944ae0894c9e9f01d0460d03d5
+Author: Louis Sautier <sautier.louis@gmail.com>
+Date:   Mon Aug 20 11:17:59 2018 +0200
+
+    Make test_bad_status_repr work for Python 3.7
+
+diff --git a/tests/test_future/test_httplib.py b/tests/test_future/test_httplib.py
+index 968e933..a1e2b19 100644
+--- a/tests/test_future/test_httplib.py
++++ b/tests/test_future/test_httplib.py
+@@ -197,7 +197,7 @@ class BasicTest(TestCase):
+         if not utils.PY3:
+             self.assertEqual(repr(exc), '''BadStatusLine("u\'\'",)''')
+         else:
+-            self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
++            self.assertIn(repr(exc), ('''BadStatusLine("''",)''', '''BadStatusLine("''")'''))
+ 
+     def test_partial_reads(self):
+         # if we have a length, the system knows when to close itself

diff --git a/dev-python/future/future-0.16.0-r1.ebuild b/dev-python/future/future-0.16.0-r1.ebuild
new file mode 100644
index 00000000000..69fc0afd395
--- /dev/null
+++ b/dev-python/future/future-0.16.0-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{4,5,6,7}} )
+
+inherit distutils-r1
+
+DESCRIPTION="Easy, clean, reliable Python 2/3 compatibility"
+HOMEPAGE="http://python-future.org/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc test"
+
+BDEPEND="
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	doc? (
+		dev-python/sphinx[${PYTHON_USEDEP}]
+		dev-python/sphinx-bootstrap-theme[${PYTHON_USEDEP}]
+	)
+	test? (
+		dev-python/numpy[${PYTHON_USEDEP}]
+		dev-python/pytest[${PYTHON_USEDEP}]
+	)
+"
+
+PATCHES=(
+	# https://github.com/PythonCharmers/python-future/issues/165
+	"${FILESDIR}/${P}-disable-tests-with-internet-connection.patch"
+	# https://github.com/PythonCharmers/python-future/pull/355
+	"${FILESDIR}/${P}-fix-tests-py37.patch"
+)
+
+python_prepare_all() {
+	sed -i "/'sphinx.ext.intersphinx'/d" docs/conf.py || die
+	distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+	if use doc; then
+		sphinx-build docs/ docs/_build/html || die
+		HTML_DOCS=( docs/_build/html/. )
+	fi
+}
+
+python_test() {
+	pytest -vv || die "Tests failed under ${EPYTHON}"
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/
@ 2019-11-15 22:55 Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2019-11-15 22:55 UTC (permalink / raw
  To: gentoo-commits

commit:     ed80835ba92a55f6ff0589dcc6b6da8f078a7d30
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 15 22:51:39 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 15 22:55:08 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed80835b

dev-python/future: Enable pypy*, and fix tests on py38

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/future/files/future-0.18.2-tests.patch | 269 ++++++++++++++++++++++
 dev-python/future/future-0.18.2.ebuild            |   6 +-
 2 files changed, 274 insertions(+), 1 deletion(-)

diff --git a/dev-python/future/files/future-0.18.2-tests.patch b/dev-python/future/files/future-0.18.2-tests.patch
new file mode 100644
index 00000000000..3742adb7282
--- /dev/null
+++ b/dev-python/future/files/future-0.18.2-tests.patch
@@ -0,0 +1,269 @@
+diff --git a/tests/test_future/test_backports.py b/tests/test_future/test_backports.py
+index 9eeb741..63b1afe 100644
+--- a/tests/test_future/test_backports.py
++++ b/tests/test_future/test_backports.py
+@@ -87,7 +87,8 @@ class TestChainMap(unittest.TestCase):
+         d['b'] = 20
+         d['c'] = 30
+         self.assertEqual(d.maps, [{'b':20, 'c':30}, {'a':1, 'b':2}])  # check internal state
+-        self.assertEqual(d.items(), dict(a=1, b=20, c=30).items())    # check items/iter/getitem
++        self.assertEqual(sorted(d.items()),
++                         sorted(dict(a=1, b=20, c=30).items()))       # check items/iter/getitem
+         self.assertEqual(len(d), 3)                                   # check len
+         for key in 'abc':                                             # check contains
+             self.assertIn(key, d)
+@@ -96,7 +97,8 @@ class TestChainMap(unittest.TestCase):
+ 
+         del d['b']                                                    # unmask a value
+         self.assertEqual(d.maps, [{'c':30}, {'a':1, 'b':2}])          # check internal state
+-        self.assertEqual(d.items(), dict(a=1, b=2, c=30).items())     # check items/iter/getitem
++        self.assertEqual(sorted(d.items()),
++                         sorted(dict(a=1, b=2, c=30).items()))        # check items/iter/getitem
+         self.assertEqual(len(d), 3)                                   # check len
+         for key in 'abc':                                             # check contains
+             self.assertIn(key, d)
+diff --git a/tests/test_future/test_builtins.py b/tests/test_future/test_builtins.py
+index ca07b9e..944d97b 100644
+--- a/tests/test_future/test_builtins.py
++++ b/tests/test_future/test_builtins.py
+@@ -8,7 +8,7 @@ from future.builtins import (bytes, dict, int, range, round, str, super,
+                              ascii, chr, hex, input, next, oct, open, pow,
+                              filter, map, zip, min, max)
+ 
+-from future.utils import PY3, exec_, native_str, implements_iterator
++from future.utils import PYPY, PY2, PY3, exec_, native_str, implements_iterator
+ from future.tests.base import (unittest, skip26, expectedFailurePY2,
+                                expectedFailurePY26)
+ 
+@@ -699,12 +699,13 @@ class BuiltinTest(unittest.TestCase):
+         self.assertEqual(eval('dir()', g, m), list('xyz'))
+         self.assertEqual(eval('globals()', g, m), g)
+         self.assertEqual(eval('locals()', g, m), m)
+-        self.assertRaises(TypeError, eval, 'a', m)
++        if not (PYPY and PY2):
++            self.assertRaises(TypeError, eval, 'a', m)
+         class A:
+             "Non-mapping"
+             pass
+         m = A()
+-        self.assertRaises(TypeError, eval, 'a', g, m)
++        self.assertRaises((AttributeError, TypeError), eval, 'a', g, m)
+ 
+         # Verify that dict subclasses work as well
+         class D(dict):
+@@ -784,8 +785,9 @@ class BuiltinTest(unittest.TestCase):
+         # self.assertRaisesRegex(NameError, "name 'print' is not defined",
+         #                        exec_, code, {'__builtins__': {}})
+         # Now:
+-        self.assertRaises(NameError,
+-                          exec_, code, {'__builtins__': {}})
++        if not PYPY:
++            self.assertRaises(NameError,
++                              exec_, code, {'__builtins__': {}})
+         # __builtins__ must be a mapping type
+         # Was:
+         # self.assertRaises(TypeError,
+@@ -797,8 +799,9 @@ class BuiltinTest(unittest.TestCase):
+         # Was:
+         # self.assertRaisesRegex(NameError, "__build_class__ not found",
+         #                        exec_, code, {'__builtins__': {}})
+-        self.assertRaises(NameError,
+-                          exec_, code, {'__builtins__': {}})
++        if not PYPY:
++            self.assertRaises(NameError,
++                              exec_, code, {'__builtins__': {}})
+ 
+         class frozendict_error(Exception):
+             pass
+@@ -1304,8 +1307,9 @@ class BuiltinTest(unittest.TestCase):
+         self.assertAlmostEqual(pow(-1, 0.5), 1j)
+         self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
+ 
+-        # Raises TypeError in Python < v3.5, ValueError in v3.5:
+-        self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
++        if sys.hexversion < 0x03080000:
++            # Raises TypeError in Python < v3.5, ValueError in v3.5:
++            self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
+         self.assertRaises(ValueError, pow, 1, 2, 0)
+ 
+         self.assertRaises(TypeError, pow)
+diff --git a/tests/test_future/test_futurize.py b/tests/test_future/test_futurize.py
+index 0d7c42d..4590185 100644
+--- a/tests/test_future/test_futurize.py
++++ b/tests/test_future/test_futurize.py
+@@ -13,7 +13,7 @@ from lib2to3.pygram import token
+ 
+ from future.tests.base import (CodeHandler, unittest, skip26, reformat_code,
+                                order_future_lines, expectedFailurePY26)
+-from future.utils import PY2
++from future.utils import PY2, PY3, PYPY
+ 
+ 
+ class TestLibFuturize(unittest.TestCase):
+@@ -565,6 +565,7 @@ class TestFuturizeSimple(CodeHandler):
+         #     tarball.write(r2.content)
+ 
+     @expectedFailurePY26
++    @unittest.skipIf(PYPY and PY3, '')
+     def test_raw_input(self):
+         """
+         Passes in a string to the waiting input() after futurize
+diff --git a/tests/test_future/test_int.py b/tests/test_future/test_int.py
+index 573a0d5..6172e48 100644
+--- a/tests/test_future/test_int.py
++++ b/tests/test_future/test_int.py
+@@ -6,7 +6,7 @@ from __future__ import (absolute_import, division,
+                         print_function, unicode_literals)
+ from future.builtins import *
+ from future.tests.base import unittest, expectedFailurePY2
+-from future.utils import PY26, PY2, raise_from
++from future.utils import PY26, PY2, PY3, PYPY, raise_from
+ 
+ import sys
+ import random
+@@ -357,7 +357,8 @@ class IntTestCases(unittest.TestCase):
+         self.assertEqual(int(Foo0()), 42)
+         self.assertEqual(int(Foo1()), 42)
+         self.assertEqual(int(Foo2()), 42)
+-        self.assertEqual(int(Foo3()), 0)
++        if not (PYPY and PY3):
++            self.assertEqual(int(Foo3()), 0)
+         self.assertEqual(int(Foo4()), 42)
+         self.assertRaises(TypeError, int, Foo5())
+ 
+diff --git a/tests/test_future/test_isinstance.py b/tests/test_future/test_isinstance.py
+index 33c0a58..ccda709 100644
+--- a/tests/test_future/test_isinstance.py
++++ b/tests/test_future/test_isinstance.py
+@@ -4,6 +4,7 @@ From the Python 3.3 test suite
+ 
+ from __future__ import (absolute_import, division, unicode_literals)
+ from future.builtins import *
++from future.utils import PYPY
+ 
+ # Tests some corner cases with isinstance() and issubclass().  While these
+ # tests use new style classes and properties, they actually do whitebox
+@@ -264,11 +265,13 @@ class TestIsInstanceIsSubclass(unittest.TestCase):
+         self.assertEqual(True, issubclass(int, (int, (float, int))))
+         self.assertEqual(True, issubclass(str, (str, (Child, NewChild, str))))
+ 
++    @unittest.skipIf(PYPY, '')
+     def test_subclass_recursion_limit(self):
+         # make sure that issubclass raises RuntimeError before the C stack is
+         # blown
+         self.assertRaises(RuntimeError, blowstack, issubclass, str, str)
+ 
++    @unittest.skipIf(PYPY, '')
+     def test_isinstance_recursion_limit(self):
+         # make sure that issubclass raises RuntimeError before the C stack is
+         # blown
+diff --git a/tests/test_future/test_str.py b/tests/test_future/test_str.py
+index 5108548..eac602f 100644
+--- a/tests/test_future/test_str.py
++++ b/tests/test_future/test_str.py
+@@ -201,6 +201,7 @@ class TestStr(unittest.TestCase):
+         with self.assertRaises(TypeError):
+             s.join(byte_strings2)
+ 
++    @unittest.skipIf(utils.PYPY and utils.PY2, '')
+     def test_str_join_staticmethod(self):
+         """
+         Issue #33
+@@ -430,10 +431,11 @@ class TestStr(unittest.TestCase):
+             e = s * long(4)
+             self.assertTrue(isinstance(e, str))
+             self.assertEqual(e, u'ABCABCABCABC')
+-        with self.assertRaises(TypeError):
+-            s * 3.3
+-        with self.assertRaises(TypeError):
+-            s * (3.3 + 3j)
++        if not (utils.PYPY and utils.PY2):
++            with self.assertRaises(TypeError):
++                s * 3.3
++            with self.assertRaises(TypeError):
++                s * (3.3 + 3j)
+ 
+     def test_rmul(self):
+         s = str(u'XYZ')
+@@ -447,10 +449,11 @@ class TestStr(unittest.TestCase):
+             e = long(3) * s
+             self.assertTrue(isinstance(e, str))
+             self.assertEqual(e, u'XYZXYZXYZ')
+-        with self.assertRaises(TypeError):
+-            3.3 * s
+-        with self.assertRaises(TypeError):
+-            (3.3 + 3j) * s
++        if not (utils.PYPY and utils.PY2):
++            with self.assertRaises(TypeError):
++                3.3 * s
++            with self.assertRaises(TypeError):
++                (3.3 + 3j) * s
+ 
+     @unittest.skip('Fails on Python <= 2.7.6 due to string subclass slicing bug')
+     def test_slice(self):
+diff --git a/tests/test_future/test_urllib2.py b/tests/test_future/test_urllib2.py
+index 2d69dad..3750737 100644
+--- a/tests/test_future/test_urllib2.py
++++ b/tests/test_future/test_urllib2.py
+@@ -691,10 +691,7 @@ class HandlerTests(unittest.TestCase):
+         h = NullFTPHandler(data)
+         h.parent = MockOpener()
+ 
+-        # MIME guessing works in Python 3.8!
+         guessed_mime = None
+-        if sys.hexversion >= 0x03080000:
+-            guessed_mime = "image/gif"
+         for url, host, port, user, passwd, type_, dirs, filename, mimetype in [
+             ("ftp://localhost/foo/bar/baz.html",
+              "localhost", ftplib.FTP_PORT, "", "", "I",
+diff --git a/tests/test_past/test_builtins.py b/tests/test_past/test_builtins.py
+index d16978e..f37b26c 100644
+--- a/tests/test_past/test_builtins.py
++++ b/tests/test_past/test_builtins.py
+@@ -21,6 +21,7 @@ import random
+ from os import unlink
+ from operator import neg
+ from future.tests.base import unittest, expectedFailurePY3, skip26
++from future.utils import PYPY, PY2
+ 
+ # count the number of test runs.
+ # used to skip running test_execfile() multiple times
+@@ -423,6 +424,7 @@ class BuiltinTest(unittest.TestCase):
+         self.assertRaises(TypeError, eval, ())
+ 
+     @expectedFailurePY3
++    @unittest.skipIf(PYPY and PY2, '')
+     def test_general_eval(self):
+         # Tests that general mappings can be used for the locals argument
+ 
+@@ -1174,7 +1176,8 @@ class BuiltinTest(unittest.TestCase):
+             def __cmp__(self, other):
+                 raise RuntimeError
+             __hash__ = None # Invalid cmp makes this unhashable
+-        self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
++        if not (PYPY and PY2):
++            self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
+ 
+         # Reject floats.
+         self.assertRaises(TypeError, range, 1., 1., 1.)
+diff --git a/tests/test_past/test_olddict.py b/tests/test_past/test_olddict.py
+index 9f21060..539c277 100644
+--- a/tests/test_past/test_olddict.py
++++ b/tests/test_past/test_olddict.py
+@@ -7,7 +7,7 @@ from __future__ import absolute_import, unicode_literals, print_function
+ import os
+ import sys
+ 
+-from future.utils import implements_iterator, PY3
++from future.utils import implements_iterator, PYPY, PY2, PY3
+ from future.tests.base import unittest, skip26
+ from past.builtins import dict
+ 
+@@ -415,6 +415,7 @@ class Py2DictTest(unittest.TestCase):
+         self.assertRaises(Exc, d.setdefault, x, [])
+ 
+     @skip26
++    @unittest.skipIf(PYPY, '')
+     def test_setdefault_atomic(self):
+         # Issue #13521: setdefault() calls __hash__ and __eq__ only once.
+         class Hashed(object):

diff --git a/dev-python/future/future-0.18.2.ebuild b/dev-python/future/future-0.18.2.ebuild
index 0aee1d1a931..8b471a58cec 100644
--- a/dev-python/future/future-0.18.2.ebuild
+++ b/dev-python/future/future-0.18.2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} pypy{,3} )
 
 inherit distutils-r1
 
@@ -33,6 +33,10 @@ BDEPEND="
 	)
 "
 
+PATCHES=(
+	"${FILESDIR}"/${P}-tests.patch
+)
+
 python_check_deps() {
 	use doc || return 0
 	has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/
@ 2020-05-26 12:58 Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2020-05-26 12:58 UTC (permalink / raw
  To: gentoo-commits

commit:     68bbadc9dccc320c5de6bf1dd346809bc1e81a36
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 26 12:50:07 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 26 12:58:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68bbadc9

dev-python/future: Port to py39

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/future/files/future-0.18.2-py39.patch | 65 ++++++++++++++++++++++++
 dev-python/future/future-0.18.2.ebuild           |  4 +-
 2 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/dev-python/future/files/future-0.18.2-py39.patch b/dev-python/future/files/future-0.18.2-py39.patch
new file mode 100644
index 00000000000..4524cb0c093
--- /dev/null
+++ b/dev-python/future/files/future-0.18.2-py39.patch
@@ -0,0 +1,65 @@
+From edda349a2d4fffa6c7f277483ccb40a66c0795b9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Mon, 10 Feb 2020 23:17:28 +0100
+Subject: [PATCH] Test fixes for Python 3.9
+
+Fixes https://github.com/PythonCharmers/python-future/issues/540
+Fixes https://github.com/PythonCharmers/python-future/issues/541
+---
+ src/future/moves/_dummy_thread.py          | 2 +-
+ src/future/standard_library/__init__.py    | 2 +-
+ tests/test_future/test_standard_library.py | 1 -
+ tests/test_future/test_urllib_toplevel.py  | 2 --
+ 4 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/src/future/moves/_dummy_thread.py b/src/future/moves/_dummy_thread.py
+index 688d249b..cc2fc891 100644
+--- a/src/future/moves/_dummy_thread.py
++++ b/src/future/moves/_dummy_thread.py
+@@ -2,7 +2,7 @@
+ from future.utils import PY3
+ 
+ if PY3:
+-    from _dummy_thread import *
++    from _thread import *
+ else:
+     __future_module__ = True
+     from dummy_thread import *
+diff --git a/src/future/standard_library/__init__.py b/src/future/standard_library/__init__.py
+index cff02f95..3e8da8a6 100644
+--- a/src/future/standard_library/__init__.py
++++ b/src/future/standard_library/__init__.py
+@@ -125,7 +125,7 @@
+            # 'Tkinter': 'tkinter',
+            '_winreg': 'winreg',
+            'thread': '_thread',
+-           'dummy_thread': '_dummy_thread',
++           'dummy_thread': '_thread',
+            # 'anydbm': 'dbm',   # causes infinite import loop
+            # 'whichdb': 'dbm',  # causes infinite import loop
+            # anydbm and whichdb are handled by fix_imports2
+diff --git a/tests/test_future/test_standard_library.py b/tests/test_future/test_standard_library.py
+index 3ac5d2d7..8ab27a27 100644
+--- a/tests/test_future/test_standard_library.py
++++ b/tests/test_future/test_standard_library.py
+@@ -422,7 +422,6 @@ def test_urllib_imports_install_hooks(self):
+ 
+     def test_underscore_prefixed_modules(self):
+         import _thread
+-        import _dummy_thread
+         import _markupbase
+         self.assertTrue(True)
+ 
+diff --git a/tests/test_future/test_urllib_toplevel.py b/tests/test_future/test_urllib_toplevel.py
+index 11e77201..25f4ca82 100644
+--- a/tests/test_future/test_urllib_toplevel.py
++++ b/tests/test_future/test_urllib_toplevel.py
+@@ -781,8 +781,6 @@ def test_unquoting(self):
+                          "%s" % result)
+         self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, None)
+         self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, ())
+-        with support.check_warnings(('', BytesWarning), quiet=True):
+-            self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, bytes(b''))
+ 
+     def test_unquoting_badpercent(self):
+         # Test unquoting on bad percent-escapes

diff --git a/dev-python/future/future-0.18.2.ebuild b/dev-python/future/future-0.18.2.ebuild
index 1107c385f9c..d30157b8e13 100644
--- a/dev-python/future/future-0.18.2.ebuild
+++ b/dev-python/future/future-0.18.2.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
+PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 )
 DISTUTILS_USE_SETUPTOOLS=rdepend
 
 inherit distutils-r1
@@ -24,10 +24,10 @@ distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme
 
 PATCHES=(
 	"${FILESDIR}"/${P}-tests.patch
+	"${FILESDIR}"/${P}-py39.patch
 )
 
 python_prepare_all() {
-	sed -i "/'sphinx.ext.intersphinx'/d" docs/conf.py || die
 	# tests requiring network access
 	rm tests/test_future/test_requests.py || die
 	sed -i -e 's:test.*request_http:_&:' \


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/
@ 2023-06-27 12:01 Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2023-06-27 12:01 UTC (permalink / raw
  To: gentoo-commits

commit:     40783e1ecef4091509c1538bb7cfdc35e0242934
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 27 11:58:46 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 27 11:58:46 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40783e1e

dev-python/future: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/future/Manifest                         |   1 -
 .../files/future-0.18.2-cve-2022-40899.patch       |  52 ----
 dev-python/future/files/future-0.18.2-tests.patch  | 269 ---------------------
 dev-python/future/future-0.18.2-r3.ebuild          |  46 ----
 4 files changed, 368 deletions(-)

diff --git a/dev-python/future/Manifest b/dev-python/future/Manifest
index d125a5c89a75..fff2affc2df3 100644
--- a/dev-python/future/Manifest
+++ b/dev-python/future/Manifest
@@ -1,3 +1,2 @@
-DIST future-0.18.2.tar.gz 829220 BLAKE2B 68574b589bf54aa8dacbd162a54885589faa32829ccf212f50de5bf036ebd8b9aba0c13e63e80d34e507cc0dae4d8d3d47fea33433b17d2c2e6dbf6c37f66d8f SHA512 91c025f7d94bcdf93df838fab67053165a414fc84e8496f92ecbb910dd55f6b6af5e360bbd051444066880c5a6877e75157bd95e150ead46e5c605930dfc50f2
 DIST future-0.18.3-tests.patch.xz 2736 BLAKE2B 55f9f233fb65f006d2055adf8b5d5b3ab00b4cd9b9f5a78d09b3fa2c1e347ef2d8370569fa5374968bf3e84b4fcbc220ad8da1cc2b32da57c46d36050ba1440a SHA512 c18434bc6efe88381aed8c86ed494352a2749c5680a52f62ae043bec70e3adb0163f91a971daa04134508d59172fe2e71ebbf694a74afce060b7fa1e7c385810
 DIST future-0.18.3.tar.gz 840896 BLAKE2B 13172c639b0eee80581133a2d46b9fa3a38fb9c47ea6eecc8f0715782536be5965bbd153d6a6dda49d8fa9cfea29231c6cc60a4b3b3a6c0cc5406f02c494a425 SHA512 6de56a5aa5c5dd56a0dc5a6732c753530f9868036bd97e9d355f9ee6e1305e266a60c167de779cba93f09b5b3fae615193074caba2afe857ca7ea944532ef910

diff --git a/dev-python/future/files/future-0.18.2-cve-2022-40899.patch b/dev-python/future/files/future-0.18.2-cve-2022-40899.patch
deleted file mode 100644
index c7341e0d6fdb..000000000000
--- a/dev-python/future/files/future-0.18.2-cve-2022-40899.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From c91d70b34ef0402aef3e9d04364ba98509dca76f Mon Sep 17 00:00:00 2001
-From: Will Shanks <wshaos@posteo.net>
-Date: Fri, 23 Dec 2022 13:38:26 -0500
-Subject: [PATCH] Backport fix for bpo-38804
-
-The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
-expression denial of service (REDoS). The regex contained multiple
-overlapping \s* capture groups. A long sequence of spaces can trigger
-bad performance.
-
-See https://github.com/python/cpython/pull/17157 and https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/
----
- src/future/backports/http/cookiejar.py | 18 ++++++++++++------
- 1 file changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/future/backports/http/cookiejar.py b/src/future/backports/http/cookiejar.py
-index af3ef415..0ad80a02 100644
---- a/src/future/backports/http/cookiejar.py
-+++ b/src/future/backports/http/cookiejar.py
-@@ -225,10 +225,14 @@ def _str2time(day, mon, yr, hr, min, sec, tz):
-        (?::(\d\d))?    # optional seconds
-     )?                 # optional clock
-        \s*
--    ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+)? # timezone
-+    (?:
-+       ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone
-+       \s*
-+    )?
-+    (?:
-+       \(\w+\)         # ASCII representation of timezone in parens.
-        \s*
--    (?:\(\w+\))?       # ASCII representation of timezone in parens.
--       \s*$""", re.X | re.ASCII)
-+    )?$""", re.X | re.ASCII)
- def http2time(text):
-     """Returns time in seconds since epoch of time represented by a string.
- 
-@@ -298,9 +302,11 @@ def http2time(text):
-       (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
-    )?                    # optional clock
-       \s*
--   ([-+]?\d\d?:?(:?\d\d)?
--    |Z|z)?               # timezone  (Z is "zero meridian", i.e. GMT)
--      \s*$""", re.X | re. ASCII)
-+   (?:
-+      ([-+]?\d\d?:?(:?\d\d)?
-+       |Z|z)             # timezone  (Z is "zero meridian", i.e. GMT)
-+      \s*
-+   )?$""", re.X | re. ASCII)
- def iso2time(text):
-     """
-     As for http2time, but parses the ISO 8601 formats:

diff --git a/dev-python/future/files/future-0.18.2-tests.patch b/dev-python/future/files/future-0.18.2-tests.patch
deleted file mode 100644
index 3742adb72821..000000000000
--- a/dev-python/future/files/future-0.18.2-tests.patch
+++ /dev/null
@@ -1,269 +0,0 @@
-diff --git a/tests/test_future/test_backports.py b/tests/test_future/test_backports.py
-index 9eeb741..63b1afe 100644
---- a/tests/test_future/test_backports.py
-+++ b/tests/test_future/test_backports.py
-@@ -87,7 +87,8 @@ class TestChainMap(unittest.TestCase):
-         d['b'] = 20
-         d['c'] = 30
-         self.assertEqual(d.maps, [{'b':20, 'c':30}, {'a':1, 'b':2}])  # check internal state
--        self.assertEqual(d.items(), dict(a=1, b=20, c=30).items())    # check items/iter/getitem
-+        self.assertEqual(sorted(d.items()),
-+                         sorted(dict(a=1, b=20, c=30).items()))       # check items/iter/getitem
-         self.assertEqual(len(d), 3)                                   # check len
-         for key in 'abc':                                             # check contains
-             self.assertIn(key, d)
-@@ -96,7 +97,8 @@ class TestChainMap(unittest.TestCase):
- 
-         del d['b']                                                    # unmask a value
-         self.assertEqual(d.maps, [{'c':30}, {'a':1, 'b':2}])          # check internal state
--        self.assertEqual(d.items(), dict(a=1, b=2, c=30).items())     # check items/iter/getitem
-+        self.assertEqual(sorted(d.items()),
-+                         sorted(dict(a=1, b=2, c=30).items()))        # check items/iter/getitem
-         self.assertEqual(len(d), 3)                                   # check len
-         for key in 'abc':                                             # check contains
-             self.assertIn(key, d)
-diff --git a/tests/test_future/test_builtins.py b/tests/test_future/test_builtins.py
-index ca07b9e..944d97b 100644
---- a/tests/test_future/test_builtins.py
-+++ b/tests/test_future/test_builtins.py
-@@ -8,7 +8,7 @@ from future.builtins import (bytes, dict, int, range, round, str, super,
-                              ascii, chr, hex, input, next, oct, open, pow,
-                              filter, map, zip, min, max)
- 
--from future.utils import PY3, exec_, native_str, implements_iterator
-+from future.utils import PYPY, PY2, PY3, exec_, native_str, implements_iterator
- from future.tests.base import (unittest, skip26, expectedFailurePY2,
-                                expectedFailurePY26)
- 
-@@ -699,12 +699,13 @@ class BuiltinTest(unittest.TestCase):
-         self.assertEqual(eval('dir()', g, m), list('xyz'))
-         self.assertEqual(eval('globals()', g, m), g)
-         self.assertEqual(eval('locals()', g, m), m)
--        self.assertRaises(TypeError, eval, 'a', m)
-+        if not (PYPY and PY2):
-+            self.assertRaises(TypeError, eval, 'a', m)
-         class A:
-             "Non-mapping"
-             pass
-         m = A()
--        self.assertRaises(TypeError, eval, 'a', g, m)
-+        self.assertRaises((AttributeError, TypeError), eval, 'a', g, m)
- 
-         # Verify that dict subclasses work as well
-         class D(dict):
-@@ -784,8 +785,9 @@ class BuiltinTest(unittest.TestCase):
-         # self.assertRaisesRegex(NameError, "name 'print' is not defined",
-         #                        exec_, code, {'__builtins__': {}})
-         # Now:
--        self.assertRaises(NameError,
--                          exec_, code, {'__builtins__': {}})
-+        if not PYPY:
-+            self.assertRaises(NameError,
-+                              exec_, code, {'__builtins__': {}})
-         # __builtins__ must be a mapping type
-         # Was:
-         # self.assertRaises(TypeError,
-@@ -797,8 +799,9 @@ class BuiltinTest(unittest.TestCase):
-         # Was:
-         # self.assertRaisesRegex(NameError, "__build_class__ not found",
-         #                        exec_, code, {'__builtins__': {}})
--        self.assertRaises(NameError,
--                          exec_, code, {'__builtins__': {}})
-+        if not PYPY:
-+            self.assertRaises(NameError,
-+                              exec_, code, {'__builtins__': {}})
- 
-         class frozendict_error(Exception):
-             pass
-@@ -1304,8 +1307,9 @@ class BuiltinTest(unittest.TestCase):
-         self.assertAlmostEqual(pow(-1, 0.5), 1j)
-         self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
- 
--        # Raises TypeError in Python < v3.5, ValueError in v3.5:
--        self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
-+        if sys.hexversion < 0x03080000:
-+            # Raises TypeError in Python < v3.5, ValueError in v3.5:
-+            self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
-         self.assertRaises(ValueError, pow, 1, 2, 0)
- 
-         self.assertRaises(TypeError, pow)
-diff --git a/tests/test_future/test_futurize.py b/tests/test_future/test_futurize.py
-index 0d7c42d..4590185 100644
---- a/tests/test_future/test_futurize.py
-+++ b/tests/test_future/test_futurize.py
-@@ -13,7 +13,7 @@ from lib2to3.pygram import token
- 
- from future.tests.base import (CodeHandler, unittest, skip26, reformat_code,
-                                order_future_lines, expectedFailurePY26)
--from future.utils import PY2
-+from future.utils import PY2, PY3, PYPY
- 
- 
- class TestLibFuturize(unittest.TestCase):
-@@ -565,6 +565,7 @@ class TestFuturizeSimple(CodeHandler):
-         #     tarball.write(r2.content)
- 
-     @expectedFailurePY26
-+    @unittest.skipIf(PYPY and PY3, '')
-     def test_raw_input(self):
-         """
-         Passes in a string to the waiting input() after futurize
-diff --git a/tests/test_future/test_int.py b/tests/test_future/test_int.py
-index 573a0d5..6172e48 100644
---- a/tests/test_future/test_int.py
-+++ b/tests/test_future/test_int.py
-@@ -6,7 +6,7 @@ from __future__ import (absolute_import, division,
-                         print_function, unicode_literals)
- from future.builtins import *
- from future.tests.base import unittest, expectedFailurePY2
--from future.utils import PY26, PY2, raise_from
-+from future.utils import PY26, PY2, PY3, PYPY, raise_from
- 
- import sys
- import random
-@@ -357,7 +357,8 @@ class IntTestCases(unittest.TestCase):
-         self.assertEqual(int(Foo0()), 42)
-         self.assertEqual(int(Foo1()), 42)
-         self.assertEqual(int(Foo2()), 42)
--        self.assertEqual(int(Foo3()), 0)
-+        if not (PYPY and PY3):
-+            self.assertEqual(int(Foo3()), 0)
-         self.assertEqual(int(Foo4()), 42)
-         self.assertRaises(TypeError, int, Foo5())
- 
-diff --git a/tests/test_future/test_isinstance.py b/tests/test_future/test_isinstance.py
-index 33c0a58..ccda709 100644
---- a/tests/test_future/test_isinstance.py
-+++ b/tests/test_future/test_isinstance.py
-@@ -4,6 +4,7 @@ From the Python 3.3 test suite
- 
- from __future__ import (absolute_import, division, unicode_literals)
- from future.builtins import *
-+from future.utils import PYPY
- 
- # Tests some corner cases with isinstance() and issubclass().  While these
- # tests use new style classes and properties, they actually do whitebox
-@@ -264,11 +265,13 @@ class TestIsInstanceIsSubclass(unittest.TestCase):
-         self.assertEqual(True, issubclass(int, (int, (float, int))))
-         self.assertEqual(True, issubclass(str, (str, (Child, NewChild, str))))
- 
-+    @unittest.skipIf(PYPY, '')
-     def test_subclass_recursion_limit(self):
-         # make sure that issubclass raises RuntimeError before the C stack is
-         # blown
-         self.assertRaises(RuntimeError, blowstack, issubclass, str, str)
- 
-+    @unittest.skipIf(PYPY, '')
-     def test_isinstance_recursion_limit(self):
-         # make sure that issubclass raises RuntimeError before the C stack is
-         # blown
-diff --git a/tests/test_future/test_str.py b/tests/test_future/test_str.py
-index 5108548..eac602f 100644
---- a/tests/test_future/test_str.py
-+++ b/tests/test_future/test_str.py
-@@ -201,6 +201,7 @@ class TestStr(unittest.TestCase):
-         with self.assertRaises(TypeError):
-             s.join(byte_strings2)
- 
-+    @unittest.skipIf(utils.PYPY and utils.PY2, '')
-     def test_str_join_staticmethod(self):
-         """
-         Issue #33
-@@ -430,10 +431,11 @@ class TestStr(unittest.TestCase):
-             e = s * long(4)
-             self.assertTrue(isinstance(e, str))
-             self.assertEqual(e, u'ABCABCABCABC')
--        with self.assertRaises(TypeError):
--            s * 3.3
--        with self.assertRaises(TypeError):
--            s * (3.3 + 3j)
-+        if not (utils.PYPY and utils.PY2):
-+            with self.assertRaises(TypeError):
-+                s * 3.3
-+            with self.assertRaises(TypeError):
-+                s * (3.3 + 3j)
- 
-     def test_rmul(self):
-         s = str(u'XYZ')
-@@ -447,10 +449,11 @@ class TestStr(unittest.TestCase):
-             e = long(3) * s
-             self.assertTrue(isinstance(e, str))
-             self.assertEqual(e, u'XYZXYZXYZ')
--        with self.assertRaises(TypeError):
--            3.3 * s
--        with self.assertRaises(TypeError):
--            (3.3 + 3j) * s
-+        if not (utils.PYPY and utils.PY2):
-+            with self.assertRaises(TypeError):
-+                3.3 * s
-+            with self.assertRaises(TypeError):
-+                (3.3 + 3j) * s
- 
-     @unittest.skip('Fails on Python <= 2.7.6 due to string subclass slicing bug')
-     def test_slice(self):
-diff --git a/tests/test_future/test_urllib2.py b/tests/test_future/test_urllib2.py
-index 2d69dad..3750737 100644
---- a/tests/test_future/test_urllib2.py
-+++ b/tests/test_future/test_urllib2.py
-@@ -691,10 +691,7 @@ class HandlerTests(unittest.TestCase):
-         h = NullFTPHandler(data)
-         h.parent = MockOpener()
- 
--        # MIME guessing works in Python 3.8!
-         guessed_mime = None
--        if sys.hexversion >= 0x03080000:
--            guessed_mime = "image/gif"
-         for url, host, port, user, passwd, type_, dirs, filename, mimetype in [
-             ("ftp://localhost/foo/bar/baz.html",
-              "localhost", ftplib.FTP_PORT, "", "", "I",
-diff --git a/tests/test_past/test_builtins.py b/tests/test_past/test_builtins.py
-index d16978e..f37b26c 100644
---- a/tests/test_past/test_builtins.py
-+++ b/tests/test_past/test_builtins.py
-@@ -21,6 +21,7 @@ import random
- from os import unlink
- from operator import neg
- from future.tests.base import unittest, expectedFailurePY3, skip26
-+from future.utils import PYPY, PY2
- 
- # count the number of test runs.
- # used to skip running test_execfile() multiple times
-@@ -423,6 +424,7 @@ class BuiltinTest(unittest.TestCase):
-         self.assertRaises(TypeError, eval, ())
- 
-     @expectedFailurePY3
-+    @unittest.skipIf(PYPY and PY2, '')
-     def test_general_eval(self):
-         # Tests that general mappings can be used for the locals argument
- 
-@@ -1174,7 +1176,8 @@ class BuiltinTest(unittest.TestCase):
-             def __cmp__(self, other):
-                 raise RuntimeError
-             __hash__ = None # Invalid cmp makes this unhashable
--        self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
-+        if not (PYPY and PY2):
-+            self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
- 
-         # Reject floats.
-         self.assertRaises(TypeError, range, 1., 1., 1.)
-diff --git a/tests/test_past/test_olddict.py b/tests/test_past/test_olddict.py
-index 9f21060..539c277 100644
---- a/tests/test_past/test_olddict.py
-+++ b/tests/test_past/test_olddict.py
-@@ -7,7 +7,7 @@ from __future__ import absolute_import, unicode_literals, print_function
- import os
- import sys
- 
--from future.utils import implements_iterator, PY3
-+from future.utils import implements_iterator, PYPY, PY2, PY3
- from future.tests.base import unittest, skip26
- from past.builtins import dict
- 
-@@ -415,6 +415,7 @@ class Py2DictTest(unittest.TestCase):
-         self.assertRaises(Exc, d.setdefault, x, [])
- 
-     @skip26
-+    @unittest.skipIf(PYPY, '')
-     def test_setdefault_atomic(self):
-         # Issue #13521: setdefault() calls __hash__ and __eq__ only once.
-         class Hashed(object):

diff --git a/dev-python/future/future-0.18.2-r3.ebuild b/dev-python/future/future-0.18.2-r3.ebuild
deleted file mode 100644
index 65a5f973d309..000000000000
--- a/dev-python/future/future-0.18.2-r3.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{9..11} pypy3 )
-
-inherit distutils-r1 pypi
-
-DESCRIPTION="Easy, clean, reliable Python 2/3 compatibility"
-HOMEPAGE="
-	https://python-future.org/
-	https://github.com/PythonCharmers/python-future/
-	https://pypi.org/project/future/
-"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-
-BDEPEND="
-	test? (
-		$(python_gen_cond_dep '
-			dev-python/numpy[${PYTHON_USEDEP}]
-		' 'python*')
-	)
-"
-
-distutils_enable_tests pytest
-distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme
-
-PATCHES=(
-	"${FILESDIR}"/${P}-tests.patch
-	"${FILESDIR}"/${P}-py39.patch
-	"${FILESDIR}"/${P}-py39-fileurl.patch
-	"${FILESDIR}"/${P}-py3.10.patch
-	"${FILESDIR}"/${P}-cve-2022-40899.patch
-)
-
-EPYTEST_DESELECT=(
-	# tests requiring network access
-	tests/test_future/test_requests.py
-	tests/test_future/test_standard_library.py::TestStandardLibraryReorganization::test_moves_urllib_request_http
-	tests/test_future/test_standard_library.py::TestStandardLibraryReorganization::test_urllib_request_http
-)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-27 12:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-15 22:55 [gentoo-commits] repo/gentoo:master commit in: dev-python/future/files/, dev-python/future/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2023-06-27 12:01 Michał Górny
2020-05-26 12:58 Michał Górny
2018-08-21 14:46 Louis Sautier
2016-09-04 18:58 David Seifert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox