diff --git a/0001-preserve-any-existing-PYTHONPATH-in-tests.patch b/0001-preserve-any-existing-PYTHONPATH-in-tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..f70e6fcc9b724caa4d1575c4641ec8f2e61fa7b7 --- /dev/null +++ b/0001-preserve-any-existing-PYTHONPATH-in-tests.patch @@ -0,0 +1,34 @@ +From b88042cfb32866a00d39b678bb224eb55ecf53c1 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Tue, 22 Jun 2021 22:10:17 +0200 +Subject: [PATCH] Preserve any existing PYTHONPATH in tests + +--- + tests/conftest.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 4ad1ff23..7200d286 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -118,9 +118,15 @@ def dev_server(xprocess, request, tmp_path): + class Starter(ProcessStarter): + args = [sys.executable, run_path, name, json.dumps(kwargs)] + # Extend the existing env, otherwise Windows and CI fails. +- # Modules will be imported from tmp_path for the reloader. ++ # Modules will be imported from tmp_path for the reloader ++ # but any existing PYTHONPATH is preserved. + # Unbuffered output so the logs update immediately. +- env = {**os.environ, "PYTHONPATH": str(tmp_path), "PYTHONUNBUFFERED": "1"} ++ original_python_path = os.getenv("PYTHONPATH") ++ if original_python_path: ++ new_python_path = os.pathsep.join((original_python_path, str(tmp_path))) ++ else: ++ new_python_path = str(tmp_path) ++ env = {**os.environ, "PYTHONPATH": new_python_path, "PYTHONUNBUFFERED": "1"} + + @cached_property + def pattern(self): +-- +2.31.1 + diff --git a/Werkzeug-2.2.3.tar.gz b/Werkzeug-2.2.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b87ab26ca991e90f9e4269a5674b712dedd66608 Binary files /dev/null and b/Werkzeug-2.2.3.tar.gz differ diff --git a/python-werkzeug.spec b/python-werkzeug.spec new file mode 100644 index 0000000000000000000000000000000000000000..22a907e18db9c3b08100df5e83072947d4a07ace --- /dev/null +++ b/python-werkzeug.spec @@ -0,0 +1,101 @@ +%define anolis_release 1 + +%global srcname Werkzeug +%global modname werkzeug + +%bcond_with test + +Name: python-%{modname} +Version: 2.2.3 +Release: %{anolis_release}%{dist} + +Summary: Comprehensive WSGI web application library + +License: BSD +URL: https://werkzeug.palletsprojects.com +Source0: %{pypi_source} + +# Fixes PYTHONPATH handling in tests +# Upstream: https://github.com/pallets/werkzeug/pull/2172 +Patch0: 0001-preserve-any-existing-PYTHONPATH-in-tests.patch + +BuildArch: noarch + +BuildRequires: make +BuildRequires: python3-devel +BuildRequires: python3dist(setuptools) +# For tests +%if %{with test} +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-timeout) +BuildRequires: python3dist(pytest-xprocess) +BuildRequires: python3dist(requests) +BuildRequires: python3dist(requests-unixsocket) +BuildRequires: python3dist(cryptography) +BuildRequires: python3dist(greenlet) +BuildRequires: python3dist(watchdog) +BuildRequires: python3dist(ephemeral-port-reserve) +%endif + +%global _description %{expand: +Werkzeug +======== + +Werkzeug started as simple collection of various utilities for WSGI +applications and has become one of the most advanced WSGI utility +modules. It includes a powerful debugger, full featured request and +response objects, HTTP utilities to handle entity tags, cache control +headers, HTTP dates, cookie handling, file uploads, a powerful URL +routing system and a bunch of community contributed addon modules. + +Werkzeug is unicode aware and doesn't enforce a specific template +engine, database adapter or anything else. It doesn't even enforce +a specific way of handling requests and leaves all that up to the +developer. It's most useful for end user applications which should work +on as many server environments as possible (such as blogs, wikis, +bulletin boards, etc.).} + +%description %{_description} + +%package -n python3-%{modname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{modname}} + +%description -n python3-%{modname} %{_description} + +%package -n python3-%{modname}-doc +Summary: Documentation for python3-werkzeug +Requires: python3-%{modname} = %{EVR} +BuildArch: noarch + +%description -n python3-%{modname}-doc +Documentation and examples for python3-%{modname}. + +%prep +%autosetup -p1 -n %{srcname}-%{version} +find examples/ -type f -name '*.png' -executable -print -exec chmod -x "{}" + + +%build +%py3_build + +%install +%py3_install + +%check +# deselect the test_exclude_patterns test case as it's failing +# when we set PYTHONPATH: https://github.com/pallets/werkzeug/issues/2404 +%if %{with test} +%pytest --deselect tests/test_serving.py::test_exclude_patterns +%endif + +%files -n python3-%{modname} +%license LICENSE.rst +%{python3_sitelib}/%{srcname}-*.egg-info/ +%{python3_sitelib}/%{modname}/ + +%files -n python3-%{modname}-doc +%doc CHANGES.rst README.rst + +%changelog +* Wed Mar 29 2023 yuanhui - 2.2.3-1 +- Init package from upstream