From 5174de4fa04ec0d12485e49b185319b8118c376d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= Date: Thu, 7 Jul 2022 11:13:22 +0200 Subject: [PATCH] Update to 2.2.1 --- .gitignore | 1 + 0001-Python-3.11-ignore-ResourceWarning.patch | 24 ---- py310-deprecations.patch | 103 ------------------ python-werkzeug.spec | 17 +-- sources | 2 +- 5 files changed, 11 insertions(+), 136 deletions(-) delete mode 100644 0001-Python-3.11-ignore-ResourceWarning.patch delete mode 100644 py310-deprecations.patch diff --git a/.gitignore b/.gitignore index 51804e1..a8e0798 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ Werkzeug-0.6.2.tar.gz /Werkzeug-2.0.1.tar.gz /Werkzeug-2.0.2.tar.gz /Werkzeug-2.0.3.tar.gz +/Werkzeug-2.2.1.tar.gz diff --git a/0001-Python-3.11-ignore-ResourceWarning.patch b/0001-Python-3.11-ignore-ResourceWarning.patch deleted file mode 100644 index 670eb6a..0000000 --- a/0001-Python-3.11-ignore-ResourceWarning.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 660318fc363dc008f9911065dc3477de7152e264 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= -Date: Tue, 31 May 2022 15:05:22 +0200 -Subject: [PATCH] Python 3.11 ignore ResourceWarning - ---- - setup.cfg | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/setup.cfg b/setup.cfg -index 6596935..29c751d 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -44,6 +44,7 @@ where = src - testpaths = tests - filterwarnings = - error -+ ignore:.*Unclosed file.*:ResourceWarning - - [coverage:run] - branch = True --- -2.36.1 - diff --git a/py310-deprecations.patch b/py310-deprecations.patch deleted file mode 100644 index 56a0166..0000000 --- a/py310-deprecations.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 584f3cff7d5cb8a588189ae1137b814cf5c47e05 Mon Sep 17 00:00:00 2001 -From: David Lord -Date: Wed, 19 May 2021 20:01:58 -0700 -Subject: [PATCH] address deprecation warnings from Python 3.10b1 - ---- - tests/conftest.py | 5 ++++- - tests/test_local.py | 34 +++++++++++++++++++++++++--------- - 2 files changed, 29 insertions(+), 10 deletions(-) - -diff --git a/tests/conftest.py b/tests/conftest.py -index 3b5cbd71c..4ad1ff23e 100644 ---- a/tests/conftest.py -+++ b/tests/conftest.py -@@ -66,7 +66,10 @@ def connect(self, **kwargs): - - if protocol == "https": - if "context" not in kwargs: -- kwargs["context"] = ssl.SSLContext() -+ context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) -+ context.check_hostname = False -+ context.verify_mode = ssl.CERT_NONE -+ kwargs["context"] = context - - return http.client.HTTPSConnection(self.addr, **kwargs) - -diff --git a/tests/test_local.py b/tests/test_local.py -index 537fc32fb..b5c392890 100644 ---- a/tests/test_local.py -+++ b/tests/test_local.py -@@ -12,6 +12,18 @@ - from werkzeug import local - - -+if sys.version_info < (3, 7): -+ -+ def run_async(coro): -+ return asyncio.get_event_loop().run_until_complete(coro) -+ -+ -+else: -+ -+ def run_async(coro): -+ return asyncio.run(coro) -+ -+ - def test_basic_local(): - ns = local.Local() - ns.foo = 0 -@@ -55,9 +67,11 @@ async def value_setter(idx): - await asyncio.sleep(0.02) - values.append(ns.foo) - -- loop = asyncio.get_event_loop() -- futures = [asyncio.ensure_future(value_setter(idx)) for idx in [1, 2, 3]] -- loop.run_until_complete(asyncio.gather(*futures)) -+ async def main(): -+ futures = [asyncio.ensure_future(value_setter(i)) for i in [1, 2, 3]] -+ await asyncio.gather(*futures) -+ -+ run_async(main()) - assert sorted(values) == [1, 2, 3] - - def delfoo(): -@@ -118,9 +132,11 @@ async def task(): - ls.push(1) - assert len(ls._local.stack) == 2 - -- loop = asyncio.get_event_loop() -- futures = [asyncio.ensure_future(task()) for _ in range(3)] -- loop.run_until_complete(asyncio.gather(*futures)) -+ async def main(): -+ futures = [asyncio.ensure_future(task()) for _ in range(3)] -+ await asyncio.gather(*futures) -+ -+ run_async(main()) - - - @pytest.mark.skipif( -@@ -571,7 +587,7 @@ async def get(): - async def main(): - return await p - -- out = asyncio.get_event_loop().run_until_complete(main()) -+ out = run_async(main()) - assert out == 1 - - -@@ -599,7 +615,7 @@ async def main(): - - return out - -- out = asyncio.get_event_loop().run_until_complete(main()) -+ out = run_async(main()) - assert out == [2, 1, 0] - - -@@ -623,4 +639,4 @@ async def main(): - assert p.value == 2 - return True - -- assert asyncio.get_event_loop().run_until_complete(main()) -+ assert run_async(main()) diff --git a/python-werkzeug.spec b/python-werkzeug.spec index 08fd6ea..369cfe0 100644 --- a/python-werkzeug.spec +++ b/python-werkzeug.spec @@ -2,8 +2,8 @@ %global modname werkzeug Name: python-%{modname} -Version: 2.0.3 -Release: 3%{?dist} +Version: 2.2.1 +Release: 1%{?dist} Summary: Comprehensive WSGI web application library License: BSD @@ -14,11 +14,6 @@ Source0: %{pypi_source} # Upstream: https://github.com/pallets/werkzeug/pull/2172 Patch0: preserve-any-existing-PYTHONPATH-in-tests.patch -# Werkzeug throws ResourceWarning with Python 3.11 -# Upstream is not concerned about it so this patch will ignore it until it is fixed -# Upstream report: https://github.com/pallets/werkzeug/issues/2421 -Patch1: 0001-Python-3.11-ignore-ResourceWarning.patch - BuildArch: noarch %global _description %{expand: @@ -56,6 +51,7 @@ BuildRequires: python3dist(requests-unixsocket) BuildRequires: python3dist(cryptography) BuildRequires: python3dist(greenlet) BuildRequires: python3dist(watchdog) +BuildRequires: python3dist(ephemeral-port-reserve) %description -n python3-%{modname} %{_description} @@ -87,7 +83,9 @@ popd %py3_install %check -%pytest +# deselect the test_exclude_patterns test case as it's failing +# when we set PYTHONPATH: https://github.com/pallets/werkzeug/issues/2404 +%pytest --deselect tests/test_serving.py::test_exclude_patterns %files -n python3-%{modname} %license LICENSE.rst @@ -99,6 +97,9 @@ popd %doc docs/_build/html examples %changelog +* Thu Jul 28 2022 Frantisek Zatloukal - 2.2.1-1 +- Update to 2.2.1 (fixes RHBZ#2069345) + * Fri Jul 22 2022 Fedora Release Engineering - 2.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index 800fe5b..09c0482 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Werkzeug-2.0.3.tar.gz) = 1b6f68458f6e21ecd4ce270c7931dfa4f5ccbd7a0b50e49f9392acab29e9abd39d41fc37a132e9cf892b8d87406cbf9fec020dc1051227faea8d15534a45f369 +SHA512 (Werkzeug-2.2.1.tar.gz) = b5e483b036c08a49cd594ef255069fe4941e0ce9dfe7b43e140687655cb3bfe03b645e471f2f847bfd4f699925e1e0383b468865ac4fe81be5ed6ccf17f9921f