From e99de4e2d1904612c8317e458e1757f8684f863b8670b919786b8615851abbda Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 1 Feb 2021 17:34:14 +0000 Subject: [PATCH] Accepting request 868396 from home:bnavigator:branches:devel:languages:python - Update to version 6.1.0 * Full changelog can be found at https://www.tornadoweb.org/en/stable/releases/v6.1.0.html - Drop patches not applying anymore. * python-tornado6-httpclient-test.patch * skip-failing-tests.patch * tornado-testsuite_timeout.patch - Refresh and comment ignore-resourcewarning-doctests.patch - Fix documentation deduplication OBS-URL: https://build.opensuse.org/request/show/868396 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tornado6?expand=0&rev=13 --- ignore-resourcewarning-doctests.patch | 44 ++++++++-------- python-tornado6-httpclient-test.patch | 74 --------------------------- python-tornado6.changes | 13 +++++ python-tornado6.spec | 35 +++++++------ skip-failing-tests.patch | 40 --------------- tornado-6.0.4.tar.gz | 3 -- tornado-6.1.tar.gz | 3 ++ tornado-testsuite_timeout.patch | 22 -------- 8 files changed, 57 insertions(+), 177 deletions(-) delete mode 100644 python-tornado6-httpclient-test.patch delete mode 100644 skip-failing-tests.patch delete mode 100644 tornado-6.0.4.tar.gz create mode 100644 tornado-6.1.tar.gz delete mode 100644 tornado-testsuite_timeout.patch diff --git a/ignore-resourcewarning-doctests.patch b/ignore-resourcewarning-doctests.patch index 7de5d76..d25be7b 100644 --- a/ignore-resourcewarning-doctests.patch +++ b/ignore-resourcewarning-doctests.patch @@ -3,35 +3,35 @@ Index: tornado-6.0.4/tornado/util.py --- tornado-6.0.4.orig/tornado/util.py 2020-03-11 11:42:49.610254636 +0100 +++ tornado-6.0.4/tornado/util.py 2020-03-11 11:43:51.470603323 +0100 @@ -468,5 +468,7 @@ else: - def doctests(): - # type: () -> unittest.TestSuite - import doctest -+ import warnings -+ warnings.simplefilter("ignore", ResourceWarning) - - return doctest.DocTestSuite() + def doctests(): + # type: () -> unittest.TestSuite + import doctest ++ import warnings ++ warnings.simplefilter("ignore", ResourceWarning) + + return doctest.DocTestSuite() Index: tornado-6.0.4/tornado/httputil.py =================================================================== --- tornado-6.0.4.orig/tornado/httputil.py 2020-03-11 11:42:49.610254636 +0100 +++ tornado-6.0.4/tornado/httputil.py 2020-03-11 11:44:46.178911693 +0100 @@ -1032,6 +1032,8 @@ def encode_username_password( - def doctests(): - # type: () -> unittest.TestSuite - import doctest -+ import warnings -+ warnings.simplefilter("ignore", ResourceWarning) - - return doctest.DocTestSuite() - + def doctests(): + # type: () -> unittest.TestSuite + import doctest ++ import warnings ++ warnings.simplefilter("ignore", ResourceWarning) + + return doctest.DocTestSuite() + Index: tornado-6.0.4/tornado/iostream.py =================================================================== --- tornado-6.0.4.orig/tornado/iostream.py 2020-03-11 11:42:49.610254636 +0100 +++ tornado-6.0.4/tornado/iostream.py 2020-03-11 11:45:31.015164413 +0100 @@ -1677,5 +1677,7 @@ class PipeIOStream(BaseIOStream): - - def doctests() -> Any: - import doctest -+ import warnings -+ warnings.simplefilter("ignore", ResourceWarning) - - return doctest.DocTestSuite() + + def doctests() -> Any: + import doctest ++ import warnings ++ warnings.simplefilter("ignore", ResourceWarning) + + return doctest.DocTestSuite() diff --git a/python-tornado6-httpclient-test.patch b/python-tornado6-httpclient-test.patch deleted file mode 100644 index 1e4a2fb..0000000 --- a/python-tornado6-httpclient-test.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff -PpuriN tornado-6.0.4/tornado/simple_httpclient.py tornado-6.0.4-mod/tornado/simple_httpclient.py ---- tornado-6.0.4/tornado/simple_httpclient.py 2020-03-02 20:21:37.000000000 +0100 -+++ tornado-6.0.4-mod/tornado/simple_httpclient.py 2020-05-05 17:52:46.375282118 +0200 -@@ -626,17 +626,14 @@ class _HTTPConnection(httputil.HTTPMessa - ) - new_request.max_redirects = self.request.max_redirects - 1 - del new_request.headers["Host"] -- # https://tools.ietf.org/html/rfc7231#section-6.4 -- # -- # The original HTTP spec said that after a 301 or 302 -- # redirect, the request method should be preserved. -- # However, browsers implemented this by changing the -- # method to GET, and the behavior stuck. 303 redirects -- # always specified this POST-to-GET behavior (arguably 303 -- # redirects should change *all* requests to GET, but -- # libcurl only does this for POST so we follow their -- # example). -- if self.code in (301, 302, 303) and self.request.method == "POST": -+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4 -+ # Client SHOULD make a GET request after a 303. -+ # According to the spec, 302 should be followed by the same -+ # method as the original request, but in practice browsers -+ # treat 302 the same as 303, and many servers use 302 for -+ # compatibility with pre-HTTP/1.1 user agents which don't -+ # understand the 303 status. -+ if self.code in (302, 303): - new_request.method = "GET" - new_request.body = None - for h in [ -diff -PpuriN tornado-6.0.4/tornado/test/httpclient_test.py tornado-6.0.4-mod/tornado/test/httpclient_test.py ---- tornado-6.0.4/tornado/test/httpclient_test.py 2020-03-02 20:21:37.000000000 +0100 -+++ tornado-6.0.4-mod/tornado/test/httpclient_test.py 2020-05-05 17:53:39.259950459 +0200 -@@ -126,7 +126,7 @@ class AllMethodsHandler(RequestHandler): - def method(self): - self.write(self.request.method) - -- get = head = post = put = delete = options = patch = other = method # type: ignore -+ get = post = put = delete = options = patch = other = method # type: ignore - - - class SetHeaderHandler(RequestHandler): -@@ -322,32 +322,6 @@ Transfer-Encoding: chunked - ) - self.assertEqual(response.body, b"Put body: ") - -- def test_method_after_redirect(self): -- # Legacy redirect codes (301, 302) convert POST requests to GET. -- for status in [301, 302, 303]: -- url = "/redirect?url=/all_methods&status=%d" % status -- resp = self.fetch(url, method="POST", body=b"") -- self.assertEqual(b"GET", resp.body) -- -- # Other methods are left alone. -- for method in ["GET", "OPTIONS", "PUT", "DELETE"]: -- resp = self.fetch(url, method=method, allow_nonstandard_methods=True) -- self.assertEqual(utf8(method), resp.body) -- # HEAD is different so check it separately. -- resp = self.fetch(url, method="HEAD") -- self.assertEqual(200, resp.code) -- self.assertEqual(b"", resp.body) -- -- # Newer redirects always preserve the original method. -- for status in [307, 308]: -- url = "/redirect?url=/all_methods&status=307" -- for method in ["GET", "OPTIONS", "POST", "PUT", "DELETE"]: -- resp = self.fetch(url, method=method, allow_nonstandard_methods=True) -- self.assertEqual(method, to_unicode(resp.body)) -- resp = self.fetch(url, method="HEAD") -- self.assertEqual(200, resp.code) -- self.assertEqual(b"", resp.body) -- - def test_credentials_in_url(self): - url = self.get_url("/auth").replace("http://", "http://me:secret@") - response = self.fetch(url) diff --git a/python-tornado6.changes b/python-tornado6.changes index c6e1911..2c438b2 100644 --- a/python-tornado6.changes +++ b/python-tornado6.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sat Jan 30 20:22:29 UTC 2021 - Ben Greiner + +- Update to version 6.1.0 + * Full changelog can be found at + https://www.tornadoweb.org/en/stable/releases/v6.1.0.html +- Drop patches not applying anymore. + * python-tornado6-httpclient-test.patch + * skip-failing-tests.patch + * tornado-testsuite_timeout.patch +- Refresh and comment ignore-resourcewarning-doctests.patch +- Fix documentation deduplication + ------------------------------------------------------------------- Tue May 5 16:36:45 UTC 2020 - Pedro Monreal Gonzalez diff --git a/python-tornado6.spec b/python-tornado6.spec index fdaa4f1..3c2b90f 100644 --- a/python-tornado6.spec +++ b/python-tornado6.spec @@ -1,7 +1,7 @@ # # spec file for package python-tornado6 # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,26 +19,22 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-tornado6 -Version: 6.0.4 +Version: 6.1 Release: 0 Summary: Open source version of scalable, non-blocking web server that power FriendFeed License: Apache-2.0 URL: https://www.tornadoweb.org Source: https://files.pythonhosted.org/packages/source/t/tornado/tornado-%{version}.tar.gz -Patch1: tornado-testsuite_timeout.patch -Patch2: skip-failing-tests.patch -Patch3: ignore-resourcewarning-doctests.patch -Patch4: python-tornado6-httpclient-test.patch +# PATCH-FIX-OPENSUSE ignore-resourcewarning-doctests.patch -- ignore resource warnings on OBS +Patch0: ignore-resourcewarning-doctests.patch BuildRequires: %{python_module base >= 3.5} -BuildRequires: %{python_module certifi} BuildRequires: %{python_module devel} +BuildRequires: %{python_module pycares} BuildRequires: %{python_module pycurl} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module simplejson} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python -Requires: python-simplejson Recommends: python-Twisted Recommends: python-pycares Recommends: python-pycurl @@ -67,10 +63,9 @@ FriendFeed servers. (For more information on scaling servers to support thousands of clients, see The C10K problem.) %prep -%setup -q -n tornado-%{version} +%autosetup -p1 -n tornado-%{version} # Fix non-executable script rpmlint issue: -find demos tornado -name "*.py" -exec sed -i "/#\!\/usr\/bin\/.*/d" {} \; -%autopatch -p1 +find tornado -name "*.py" -exec sed -i "/#\!\/usr\/bin\/.*/d" {} \; %pre # remove egg-info _file_, being replaced by an egg-info directory @@ -83,9 +78,17 @@ fi %install %python_install -%fdupes demos -%python_expand rm -r %{buildroot}%{$python_sitearch}/tornado/test -%python_expand %fdupes %{buildroot}%{$python_sitearch} +%{python_expand # +# do not install tests +rm -r %{buildroot}%{$python_sitearch}/tornado/test +# deduplicate files in python platlibdir +%fdupes %{buildroot}%{$python_sitearch} +# install demos into docdir and deduplicate +mkdir -p %{buildroot}%{_docdir}/$python-tornado6/ +cp -r demos %{buildroot}%{_docdir}/$python-tornado6/ +find %{buildroot}%{_docdir}/$python-tornado6 -name "*.py" -exec sed -i "1{s|^#!.*$|%{_bindir}/$python|}" {} \; +%fdupes %{buildroot}%{_docdir}/$python-tornado6 +} %check export ASYNC_TEST_TIMEOUT=30 @@ -95,7 +98,7 @@ export TRAVIS=1 %files %{python_files} %license LICENSE -%doc demos +%doc %{_docdir}/%{python_prefix}-tornado6 %{python_sitearch}/tornado %{python_sitearch}/tornado-%{version}-py*.egg-info diff --git a/skip-failing-tests.patch b/skip-failing-tests.patch deleted file mode 100644 index 308171b..0000000 --- a/skip-failing-tests.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Benjamin Drung -Date: Tue, 18 Dec 2018 18:35:28 +0100 -Subject: [PATCH] Skip failing openssl 1.1.1 tests (for now) - -Four tests fail when using openssl 1.1.1 with TLS 1.3 support. Disable -these tests for now. Please fix the bug and re-enable them again. - -Bug: https://github.com/tornadoweb/tornado/issues/2536 ---- - tornado/test/iostream_test.py | 3 +++ - 1 file changed, 3 insertions(+) - -Index: tornado-6.0.4/tornado/test/iostream_test.py -=================================================================== ---- tornado-6.0.4.orig/tornado/test/iostream_test.py 2020-03-11 11:39:55.709274416 +0100 -+++ tornado-6.0.4/tornado/test/iostream_test.py 2020-03-11 11:40:43.305542700 +0100 -@@ -189,6 +189,7 @@ class TestReadWriteMixin(object): - return IOStreamPairContext(self, kwargs) - - @gen_test -+ @unittest.skip("Failing when using openssl 1.1.1 with TLS 1.3 support. See https://github.com/tornadoweb/tornado/issues/2536") - def test_write_zero_bytes(self): - # Attempting to write zero bytes should run the callback without - # going into an infinite loop. -@@ -240,6 +241,7 @@ class TestReadWriteMixin(object): - rs.close() - - @gen_test -+ @unittest.skip("Failing when using openssl 1.1.1 with TLS 1.3 support. See https://github.com/tornadoweb/tornado/issues/2536") - def test_read_until_close_after_close(self): - # Similar to test_delayed_close_callback, but read_until_close takes - # a separate code path so test it separately. -@@ -793,6 +795,7 @@ class TestIOStreamMixin(TestReadWriteMix - @skipIfNonUnix - @skipPypy3V58 - @gen_test -+ @unittest.skip("Failing when using openssl 1.1.1 with TLS 1.3 support. See https://github.com/tornadoweb/tornado/issues/2536") - def test_inline_read_error(self): - # An error on an inline read is raised without logging (on the - # assumption that it will eventually be noticed or logged further diff --git a/tornado-6.0.4.tar.gz b/tornado-6.0.4.tar.gz deleted file mode 100644 index af41086..0000000 --- a/tornado-6.0.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0fe2d45ba43b00a41cd73f8be321a44936dc1aba233dee979f17a042b83eb6dc -size 496204 diff --git a/tornado-6.1.tar.gz b/tornado-6.1.tar.gz new file mode 100644 index 0000000..2c1a3ab --- /dev/null +++ b/tornado-6.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33c6e81d7bd55b468d2e793517c909b139960b6c790a60b7991b9b6b76fb9791 +size 497359 diff --git a/tornado-testsuite_timeout.patch b/tornado-testsuite_timeout.patch deleted file mode 100644 index 3b66670..0000000 --- a/tornado-testsuite_timeout.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: tornado-6.0.4/tornado/test/testing_test.py -=================================================================== ---- tornado-6.0.4.orig/tornado/test/testing_test.py 2020-03-11 11:37:45.016537755 +0100 -+++ tornado-6.0.4/tornado/test/testing_test.py 2020-03-11 11:38:38.740840572 +0100 -@@ -54,7 +54,7 @@ class AsyncTestCaseTest(AsyncTestCase): - self.io_loop.add_timeout(self.io_loop.time() + 0.00, self.stop) - self.wait(timeout=0.02) - self.io_loop.add_timeout(self.io_loop.time() + 0.03, self.stop) -- self.wait(timeout=0.15) -+ self.wait(timeout=0.25) - - - class LeakTest(AsyncTestCase): -@@ -262,7 +262,7 @@ class GenTest(AsyncTestCase): - self.finished = True - - def test_timeout_environment_variable(self): -- @gen_test(timeout=0.5) -+ @gen_test(timeout=0.9) - def test_long_timeout(self): - yield gen.sleep(0.25) -