From 357f15a52b1f49c310328522e599e3fcbc4c0338 Mon Sep 17 00:00:00 2001 From: FFrog Date: Tue, 22 Feb 2022 10:54:50 +0800 Subject: [PATCH] Fix the check problems --- Disable-tests-because-need-pytest-3.9.patch | 67 ++++++ python-werkzeug.spec | 215 +++++++------------- 2 files changed, 135 insertions(+), 147 deletions(-) create mode 100644 Disable-tests-because-need-pytest-3.9.patch diff --git a/Disable-tests-because-need-pytest-3.9.patch b/Disable-tests-because-need-pytest-3.9.patch new file mode 100644 index 0000000..bf8cec3 --- /dev/null +++ b/Disable-tests-because-need-pytest-3.9.patch @@ -0,0 +1,67 @@ +From 3a02d997ed5e2a69485b1a97e2f0a5de2e1e1b1b Mon Sep 17 00:00:00 2001 +From: hht8 +Date: Mon, 16 Aug 2021 10:01:13 +0800 +Subject: [PATCH] Disable tests because need pytest-3.9 + +--- + tests/test_datastructures.py | 16 ---------------- + tests/test_serving.py | 10 ---------- + 2 files changed, 26 deletions(-) + +diff --git a/tests/test_datastructures.py b/tests/test_datastructures.py +index 56f170b..26043bd 100644 +--- a/tests/test_datastructures.py ++++ b/tests/test_datastructures.py +@@ -1235,28 +1235,12 @@ class TestFileStorage(object): + for name in ("fileno", "writable", "readable", "seekable"): + assert hasattr(file_storage, name) + +- def test_save_to_pathlib_dst(self, tmp_path): +- src = tmp_path / "src.txt" +- src.write_text(u"test") +- storage = self.storage_class(src.open("rb")) +- dst = tmp_path / "dst.txt" +- storage.save(dst) +- assert dst.read_text() == "test" +- + def test_save_to_bytes_io(self): + storage = self.storage_class(io.BytesIO(b"one\ntwo")) + dst = io.BytesIO() + storage.save(dst) + assert dst.getvalue() == b"one\ntwo" + +- def test_save_to_file(self, tmp_path): +- path = tmp_path / "file.data" +- storage = self.storage_class(io.BytesIO(b"one\ntwo")) +- with path.open("wb") as dst: +- storage.save(dst) +- with path.open("rb") as src: +- assert src.read() == b"one\ntwo" +- + + @pytest.mark.parametrize("ranges", ([(0, 1), (-5, None)], [(5, None)])) + def test_range_to_header(ranges): +diff --git a/tests/test_serving.py b/tests/test_serving.py +index f605f76..c4ba602 100644 +--- a/tests/test_serving.py ++++ b/tests/test_serving.py +@@ -297,16 +297,6 @@ def test_reloader_reports_correct_file(tmpdir, dev_server): + raise RuntimeError("Change event not detected.") + + +-def test_windows_get_args_for_reloading(monkeypatch, tmp_path): +- argv = [str(tmp_path / "test.exe"), "run"] +- monkeypatch.setattr("sys.executable", str(tmp_path / "python.exe")) +- monkeypatch.setattr("sys.argv", argv) +- monkeypatch.setattr("__main__.__package__", None) +- monkeypatch.setattr("os.name", "nt") +- rv = _reloader._get_args_for_reloading() +- assert rv == argv +- +- + def test_monkeypatched_sleep(tmpdir): + # removing the staticmethod wrapper in the definition of + # ReloaderLoop._sleep works most of the time, since `sleep` is a c +-- +2.23.0 + diff --git a/python-werkzeug.spec b/python-werkzeug.spec index c76abbe..d8a96f8 100644 --- a/python-werkzeug.spec +++ b/python-werkzeug.spec @@ -1,168 +1,89 @@ -%global _empty_manifest_terminate_build 0 -Name: python-werkzeug -Version: 1.0.1 -Release: 1 -Summary: The comprehensive WSGI web application library. -License: BSD-3-Clause -URL: https://palletsprojects.com/p/werkzeug/ -Source0: https://github.com/pallets/werkzeug/archive/1.0.1.tar.gz -BuildArch: noarch +%global srcname Werkzeug +%global modname werkzeug -Requires: python3-pytest -Requires: python3-pytest-timeout -Requires: python3-coverage -Requires: python3-tox -Requires: python3-sphinx -Requires: python3-pallets-sphinx-themes -Requires: python3-sphinx-issues -Requires: python3-watchdog +Name: python-werkzeug +Summary: A comprehensive WSGI web application library +Version: 1.0.1 +Release: 2 +License: BSD +URL: https://github.com/pallets/werkzeug +Source0: https://github.com/pallets/werkzeug/archive/1.0.1.tar.gz +Patch0: Disable-tests-because-need-pytest-3.9.patch +BuildArch: noarch -%description -*werkzeug* German noun: "tool". Etymology: *werk* ("work"), *zeug* ("stuff") -Werkzeug is a comprehensive `WSGI`_ web application library. It began as -a simple collection of various utilities for WSGI applications and has -become one of the most advanced WSGI utility libraries. -It includes: -- An interactive debugger that allows inspecting stack traces and - source code in the browser with an interactive interpreter for any - frame in the stack. -- A full-featured request object with objects to interact with - headers, query args, form data, files, and cookies. -- A response object that can wrap other WSGI applications and handle - streaming data. -- A routing system for matching URLs to endpoints and generating URLs - for endpoints, with an extensible system for capturing variables - from URLs. -- HTTP utilities to handle entity tags, cache control, dates, user - agents, cookies, files, and more. -- A threaded WSGI server for use while developing applications - locally. -- A test client for simulating HTTP requests during testing without - requiring running a server. -Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up -to the developer to choose a template engine, database adapter, and even -how to handle requests. It can be used to build all sorts of end user -applications such as blogs, wikis, or bulletin boards. -`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while -providing more structure and patterns for defining powerful -applications. +%global _description\ +Werkzeug is a comprehensive WSGI web application library. It began as a\ +simple collection of various utilities for WSGI applications and has\ +become one of the most advanced WSGI utility libraries.\ +It includes:\ +* An interactive debugger that allows inspecting stack traces and source\ +code in the browser with an interactive interpreter for any frame in the stack.\ +* A full-featured request object with objects to interact with headers,\ +query args, form data, files, and cookies.\ +* A response object that can wrap other WSGI applications and handle\ +streaming data.\ +* A routing system for matching URLs to endpoints and generating URLs for\ +endpoints, with an extensible system for capturing variables from URLs.\ +* HTTP utilities to handle entity tags, cache control, dates, user agents,\ +cookies, files, and more.\ +* A threaded WSGI server for use while developing applications locally.\ +* A test client for simulating HTTP requests during testing without\ +requiring running a server.\ +Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up\ +to the developer to choose a template engine, database adapter, and even\ +how to handle requests. It can be used to build all sorts of end user\ +applications such as blogs, wikis, or bulletin boards.\ + +%description %_description %package -n python3-werkzeug -Summary: The comprehensive WSGI web application library. -Provides: python-werkzeug -BuildRequires: python3-devel -BuildRequires: python3-pytest -BuildRequires: python3-pytest-timeout -BuildRequires: python3-requests -BuildRequires: python3-setuptools -BuildRequires: python3-cryptography -BuildRequires: python3-greenlet -%description -n python3-werkzeug -*werkzeug* German noun: "tool". Etymology: *werk* ("work"), *zeug* ("stuff") -Werkzeug is a comprehensive `WSGI`_ web application library. It began as -a simple collection of various utilities for WSGI applications and has -become one of the most advanced WSGI utility libraries. -It includes: -- An interactive debugger that allows inspecting stack traces and - source code in the browser with an interactive interpreter for any - frame in the stack. -- A full-featured request object with objects to interact with - headers, query args, form data, files, and cookies. -- A response object that can wrap other WSGI applications and handle - streaming data. -- A routing system for matching URLs to endpoints and generating URLs - for endpoints, with an extensible system for capturing variables - from URLs. -- HTTP utilities to handle entity tags, cache control, dates, user - agents, cookies, files, and more. -- A threaded WSGI server for use while developing applications - locally. -- A test client for simulating HTTP requests during testing without - requiring running a server. -Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up -to the developer to choose a template engine, database adapter, and even -how to handle requests. It can be used to build all sorts of end user -applications such as blogs, wikis, or bulletin boards. -`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while -providing more structure and patterns for defining powerful -applications. +Summary: %summary +BuildRequires: python3-devel python3-setuptools git +BuildRequires: python3-pytest python3-hypothesis python3-requests python3-pyOpenSSL +BuildRequires: python3-greenlet python3-redis python3-pytest-timeout +%{?python_provide:%python_provide python3-werkzeug} + +%description -n python3-werkzeug %_description + +%package -n python3-werkzeug-doc +Summary: Documentation for python3-werkzeug +BuildRequires: python3-sphinx python3dist(pallets-sphinx-themes) +BuildRequires: python3dist(sphinx-issues) python3-sphinxcontrib-log-cabinet +Requires: python3-werkzeug = %{version}-%{release} +%{?python_provide:%python_provide python3-werkzeug-doc} -%package help -Summary: Development documents and examples for Werkzeug -Provides: python3-werkzeug-doc -%description help -*werkzeug* German noun: "tool". Etymology: *werk* ("work"), *zeug* ("stuff") -Werkzeug is a comprehensive `WSGI`_ web application library. It began as -a simple collection of various utilities for WSGI applications and has -become one of the most advanced WSGI utility libraries. -It includes: -- An interactive debugger that allows inspecting stack traces and - source code in the browser with an interactive interpreter for any - frame in the stack. -- A full-featured request object with objects to interact with - headers, query args, form data, files, and cookies. -- A response object that can wrap other WSGI applications and handle - streaming data. -- A routing system for matching URLs to endpoints and generating URLs - for endpoints, with an extensible system for capturing variables - from URLs. -- HTTP utilities to handle entity tags, cache control, dates, user - agents, cookies, files, and more. -- A threaded WSGI server for use while developing applications - locally. -- A test client for simulating HTTP requests during testing without - requiring running a server. -Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up -to the developer to choose a template engine, database adapter, and even -how to handle requests. It can be used to build all sorts of end user -applications such as blogs, wikis, or bulletin boards. -`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while -providing more structure and patterns for defining powerful -applications. +%description -n python3-werkzeug-doc +Documentation and examples for python3-werkzeug. %prep -%autosetup -n werkzeug-1.0.1 +%autosetup -n %{modname}-%{version} -p1 %build %py3_build +pushd docs +make PYTHONPATH=../src/ SPHINXBUILD=sphinx-build html +rm -v _build/html/.buildinfo +popd %install %py3_install -install -d -m755 %{buildroot}/%{_pkgdocdir} -if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi -if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi -if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi -if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi -pushd %{buildroot} -if [ -d usr/lib ]; then - find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/lib64 ]; then - find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/bin ]; then - find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/sbin ]; then - find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst -fi -touch doclist.lst -if [ -d usr/share/man ]; then - find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst -fi -popd -mv %{buildroot}/filelist.lst . -mv %{buildroot}/doclist.lst . %check -PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-3 +#Some tests requires the compilation environment language variable to be utf8. +export LANG=en_US.utf8 +PYTHONPATH=./src/ py.test-3 -%files -n python3-werkzeug -f filelist.lst -%dir %{python3_sitelib}/* +%files -n python3-werkzeug +%license LICENSE.rst +%doc CHANGES.rst README.rst +%{python3_sitelib}/* -%files help -f doclist.lst -%{_docdir}/* +%files -n python3-werkzeug-doc +%doc docs/_build/html examples %changelog +* Thur Jan 27 2022 lijiawei - 1.0.1-2 +- Fix the check problems + * Thu Feb 04 2021 Python_Bot - Package Spec generated -- Gitee