[packages/python-future] - updated to 0.17.0 - updated tests patch - removed obsolete py37,div patches
qboosh
qboosh at pld-linux.org
Sun Oct 6 17:05:58 CEST 2019
commit 8f33d0a9c5a45f83fb4d4d8b78d4096fc5f0aa98
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Oct 6 17:09:14 2019 +0200
- updated to 0.17.0
- updated tests patch
- removed obsolete py37,div patches
python-future-div.patch | 130 ----------------------------------------------
python-future-py37.patch | 59 ---------------------
python-future-tests.patch | 26 +++++++---
python-future.spec | 12 ++---
4 files changed, 22 insertions(+), 205 deletions(-)
---
diff --git a/python-future.spec b/python-future.spec
index 2b8962f..5c60028 100644
--- a/python-future.spec
+++ b/python-future.spec
@@ -8,16 +8,14 @@
Summary: Clean single-source support for Python 3 and 2
Summary(pl.UTF-8): Czysta obsługa Pythona 3 i 2 w jednych źródłach
Name: python-future
-Version: 0.16.0
+Version: 0.17.0
Release: 1
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/future/
Source0: https://files.pythonhosted.org/packages/source/f/future/future-%{version}.tar.gz
-# Source0-md5: 3e8e88a2bda48d54b1da7634d04760d7
-Patch0: %{name}-py37.patch
-Patch1: %{name}-div.patch
-Patch2: %{name}-tests.patch
+# Source0-md5: d76ae771a06273c0469b90fbe9c1abfa
+Patch0: %{name}-tests.patch
URL: https://python-future.org/
%if %{with python2}
BuildRequires: python-modules >= 1:2.6
@@ -89,8 +87,6 @@ Dokumentacja API modułu Pythona future.
%prep
%setup -q -n future-%{version}
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
%build
%if %{with python2}
@@ -106,7 +102,7 @@ PYTHONPATH=$(pwd)/build-2/lib \
%py3_build
%if %{with tests}
-# FIXME: fails with py3.7(?) as of future-0.16.0
+# FIXME: fails with py3.7(?) as of future-0.17.0
%{__rm} tests/test_past/test_translation.py
PYTHONPATH=$(pwd)/build-3/lib \
diff --git a/python-future-div.patch b/python-future-div.patch
deleted file mode 100644
index d22f0c3..0000000
--- a/python-future-div.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From 8209539e0f4c20c47ce455957c7b2f00bad30b69 Mon Sep 17 00:00:00 2001
-From: Jordan Adler <jadler at pinterest.com>
-Date: Fri, 13 Jul 2018 15:46:29 -0700
-Subject: [PATCH 1/3] Skip float divisions in fix_division_safe
-
----
- src/libfuturize/fixes/fix_division_safe.py | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
-
-diff --git a/src/libfuturize/fixes/fix_division_safe.py b/src/libfuturize/fixes/fix_division_safe.py
-index 5e16b0a..5cdd626 100644
---- a/src/libfuturize/fixes/fix_division_safe.py
-+++ b/src/libfuturize/fixes/fix_division_safe.py
-@@ -13,6 +13,9 @@
- nothing.
- """
-
-+import re
-+import lib2to3.pytree as pytree
-+from lib2to3.fixer_util import Leaf, Node
- from lib2to3 import fixer_base
- from lib2to3.fixer_util import syms, does_tree_import
- from libfuturize.fixer_util import (token, future_import, touch_import_top,
-@@ -28,6 +31,18 @@ def match_division(node):
- return node.type == slash and not node.next_sibling.type == slash and \
- not node.prev_sibling.type == slash
-
-+const_re = re.compile('^[0-9.]+$')
-+
-+
-+def _is_floaty(expr):
-+ if isinstance(expr, Leaf):
-+ # If it's a leaf, let's see if it's a numeric constant containing a '.'
-+ return const_re.match(expr.value)
-+ elif isinstance(expr, Node):
-+ # If the expression is a node, let's see if it's a direct cast to float
-+ return expr.children[0].value == u'float'
-+ return False
-+
-
- class FixDivisionSafe(fixer_base.BaseFix):
- # BM_compatible = True
-@@ -68,5 +83,10 @@ def transform(self, node, results):
- expr1, expr2 = results[0].clone(), results[1].clone()
- # Strip any leading space for the first number:
- expr1.prefix = u''
-+ # if expr1 or expr2 are obviously floats, we don't need to wrap in
-+ # old_div, as the behavior of division between any number and a float
-+ # should be the same in 2 or 3
-+ if _is_floaty(expr1) or _is_floaty(expr2):
-+ return
- return wrap_in_fn_call("old_div", (expr1, expr2), prefix=node.prefix)
-
-
-From 03770dbc4494433fa711c9a4b4bce091efa0c6e9 Mon Sep 17 00:00:00 2001
-From: Jordan Adler <jadler at pinterest.com>
-Date: Fri, 3 Aug 2018 15:35:01 -0700
-Subject: [PATCH 2/3] bugfix
-
----
- src/libfuturize/fixes/fix_division_safe.py | 2 +-
- tests/test_future/test_futurize.py | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/libfuturize/fixes/fix_division_safe.py b/src/libfuturize/fixes/fix_division_safe.py
-index 5cdd626..a2ef098 100644
---- a/src/libfuturize/fixes/fix_division_safe.py
-+++ b/src/libfuturize/fixes/fix_division_safe.py
-@@ -31,7 +31,7 @@ def match_division(node):
- return node.type == slash and not node.next_sibling.type == slash and \
- not node.prev_sibling.type == slash
-
--const_re = re.compile('^[0-9.]+$')
-+const_re = re.compile('^[0-9]*[.][0-9]*$')
-
-
- def _is_floaty(expr):
-diff --git a/tests/test_future/test_futurize.py b/tests/test_future/test_futurize.py
-index f3fe0b8..5943f8a 100644
---- a/tests/test_future/test_futurize.py
-+++ b/tests/test_future/test_futurize.py
-@@ -1179,7 +1179,7 @@ def test_safe_division(self):
- from __future__ import division
- from past.utils import old_div
- x = old_div(3, 2)
-- y = old_div(3., 2)
-+ y = 3. / 2
- assert x == 1 and isinstance(x, int)
- assert y == 1.5 and isinstance(y, float)
- """
-
-From ef625b060ebef20f50999f319b466789d50df295 Mon Sep 17 00:00:00 2001
-From: Jordan Adler <jadler at pinterest.com>
-Date: Wed, 8 Aug 2018 14:44:43 -0700
-Subject: [PATCH 3/3] Only import past.utils.old_div() if needed; Verify the
- expression isnt a nested expression when doing a floaty check
-
----
- src/libfuturize/fixes/fix_division_safe.py | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/src/libfuturize/fixes/fix_division_safe.py b/src/libfuturize/fixes/fix_division_safe.py
-index a2ef098..3a0d9ae 100644
---- a/src/libfuturize/fixes/fix_division_safe.py
-+++ b/src/libfuturize/fixes/fix_division_safe.py
-@@ -40,7 +40,8 @@ def _is_floaty(expr):
- return const_re.match(expr.value)
- elif isinstance(expr, Node):
- # If the expression is a node, let's see if it's a direct cast to float
-- return expr.children[0].value == u'float'
-+ if isinstance(expr.children[0], Leaf):
-+ return expr.children[0].value == u'float'
- return False
-
-
-@@ -79,7 +80,6 @@ def transform(self, node, results):
- return
- future_import(u"division", node)
-
-- touch_import_top(u'past.utils', u'old_div', node)
- expr1, expr2 = results[0].clone(), results[1].clone()
- # Strip any leading space for the first number:
- expr1.prefix = u''
-@@ -88,5 +88,6 @@ def transform(self, node, results):
- # should be the same in 2 or 3
- if _is_floaty(expr1) or _is_floaty(expr2):
- return
-+ touch_import_top(u'past.utils', u'old_div', node)
- return wrap_in_fn_call("old_div", (expr1, expr2), prefix=node.prefix)
-
diff --git a/python-future-py37.patch b/python-future-py37.patch
deleted file mode 100644
index 441ece9..0000000
--- a/python-future-py37.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 05270673dd1e3e353454dbe12a61bc982eb094c6 Mon Sep 17 00:00:00 2001
-From: Louis Sautier <sautier.louis at gmail.com>
-Date: Mon, 20 Aug 2018 11:17:59 +0200
-Subject: [PATCH 1/2] Make test_bad_status_repr work for Python 3.7
-
-Allow a different representation for the exception.
----
- tests/test_future/test_httplib.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-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 @@ def test_bad_status_repr(self):
- 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
-
-From 2218d6fb139294a73b00abeb894d31bfc799f07a Mon Sep 17 00:00:00 2001
-From: Louis Sautier <sautier.louis at gmail.com>
-Date: Mon, 20 Aug 2018 12:42:29 +0200
-Subject: [PATCH 2/2] Skip int(x) keyword tests with Python 3.7
-
-The first argument must be positional since
-https://github.com/python/cpython/commit/2e5642422f6234fd8d0c082142b27340e588f96e
----
- tests/test_future/test_int.py | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/tests/test_future/test_int.py b/tests/test_future/test_int.py
-index f1d9c5d..9acbd23 100644
---- a/tests/test_future/test_int.py
-+++ b/tests/test_future/test_int.py
-@@ -265,12 +265,17 @@ def test_small_ints(self):
- def test_no_args(self):
- self.assertEqual(int(), 0)
-
-- def test_keyword_args(self):
-+ @unittest.skipIf(sys.version_info >= (3, 7),
-+ "The first parameter must be positional with Python >= 3.7"
-+ )
-+ def test_x_keyword_arg(self):
- # Test invoking int() using keyword arguments.
- self.assertEqual(int(x=1.2), 1)
-- self.assertEqual(int('100', base=2), 4)
- self.assertEqual(int(x='100', base=2), 4)
-
-+ def text_base_keyword_arg(self):
-+ self.assertEqual(int('100', base=2), 4)
-+
- def test_newint_plus_float(self):
- minutes = int(100)
- second = 0.0
diff --git a/python-future-tests.patch b/python-future-tests.patch
index 5eeb127..bfaf900 100644
--- a/python-future-tests.patch
+++ b/python-future-tests.patch
@@ -1,14 +1,24 @@
# disable network tests
---- future-0.16.0/tests/test_future/test_standard_library.py.orig 2016-10-27 22:05:38.000000000 +0200
-+++ future-0.16.0/tests/test_future/test_standard_library.py 2018-09-14 19:20:53.083784127 +0200
-@@ -320,6 +320,7 @@
- self.assertTrue(hasattr(builtins, 'tuple'))
+--- future-0.17.0/tests/test_future/test_requests.py.orig 2019-10-06 11:19:07.248145375 +0200
++++ future-0.17.0/tests/test_future/test_requests.py 2019-10-06 11:19:55.894548502 +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('breaks test_bool2')
+ def test_remove_hooks_then_requests(self):
+ code = """
+ from future import standard_library
+@@ -79,6 +80,7 @@
+ self.assertTrue(True)
+
- # @unittest.skip("ssl support has been stripped out for now ...")
-+ @unittest.skip("outdated URL")
- def test_urllib_request_ssl_redirect(self):
++ @unittest.skip('uses networks, breaks test_bool2')
+ def test_requests_cm(self):
"""
- This site redirects to https://...
+ Tests whether requests can be used importing standard_library modules
+--- future-0.16.0/tests/test_future/test_standard_library.py.orig 2016-10-27 22:05:38.000000000 +0200
++++ future-0.16.0/tests/test_future/test_standard_library.py 2018-09-14 19:20:53.083784127 +0200
@@ -333,6 +334,7 @@
# pprint(r.read().decode('utf-8'))
self.assertTrue(True)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-future.git/commitdiff/8f33d0a9c5a45f83fb4d4d8b78d4096fc5f0aa98
More information about the pld-cvs-commit
mailing list