Accepting request 970992 from devel:languages:python
- Update to 2.1.1: - ResponseCacheControl.s_maxage converts its value to an int, like max_age. - Drop support for Python 3.6. - Using gevent or eventlet requires greenlet>=1.0 or PyPy>=7.3.7. werkzeug.locals and contextvars will not work correctly with older versions. - Remove previously deprecated code. - Remove the non-standard shutdown function from the WSGI environ when running the development server. See the docs for alternatives. - Request and response mixins have all been merged into the Request and Response classes. - The user agent parser and the useragents module is removed. The user_agent module provides an interface that can be subclassed to add a parser, such as ua-parser. By default it only stores the whole string. - The test client returns TestResponse instances and can no longer be treated as a tuple. All data is available as properties on the response. - Remove locals.get_ident and related thread-local code from locals, it no longer makes sense when moving to a contextvars-based implementation. - Remove the python -m werkzeug.serving CLI. - The has_key method on some mapping datastructures; use key in data instead. - Request.disable_data_descriptor is removed, pass shallow=True instead. - Remove the no_etag parameter from Response.freeze(). - Remove the HTTPException.wrap class method. - Remove the cookie_date function. Use http_date instead. - Remove the pbkdf2_hex, pbkdf2_bin, and safe_str_cmp functions. Use equivalents in hashlib and hmac modules instead. - Remove the Href class. - Remove the HTMLBuilder class. - Remove the invalidate_cached_property function. Use del obj.attr instead. - Remove bind_arguments and validate_arguments. Use Signature.bind() and inspect.signature() instead. - Remove detect_utf_encoding, it’s built-in to json.loads. - Remove format_string, use string.Template instead. - Remove escape and unescape. Use MarkupSafe instead. - The multiple parameter of parse_options_header is deprecated. - Rely on PEP 538 and PEP 540 to handle decoding file names with the correct filesystem encoding. The filesystem module is removed. - Default values passed to Headers are validated the same way values added later are. - Setting CacheControl int properties, such as max_age, will convert the value to an int. - Always use socket.fromfd when restarting the dev server. - When passing a dict of URL values to Map.build, list values do not filter out None or collapse to a single value. Passing a MultiDict does collapse single items. This undoes a previous change that made it difficult to pass a list, or None values in a list, to custom URL converters. - run_simple shows instructions for dealing with “address already in use” errors, including extra instructions for macOS. - Extend list of characters considered always safe in URLs based on RFC 3986. - Optimize the stat reloader to avoid watching unnecessary files in more cases. The watchdog reloader is still recommended for performance and accuracy. - The development server uses Transfer-Encoding: chunked for streaming responses when it is configured for HTTP/1.1. - The development server uses HTTP/1.1, which enables keep-alive connections and chunked streaming responses, when threaded or processes is enabled. - cached_property works for classes with __slots__ if a corresponding _cache_{name} slot is added. - Refactor the debugger traceback formatter to use Python’s built-in traceback module as much as possible. - The TestResponse.text property is a shortcut for r.get_data(as_text=True), for convenient testing against text instead of bytes. - safe_join ensures that the path remains relative if the trusted directory is the empty string. - Percent-encoded newlines (%0a), which are decoded by WSGI servers, are considered when routing instead of terminating the match early. - The test client doesn’t set duplicate headers for CONTENT_LENGTH and CONTENT_TYPE. - append_slash_redirect handles PATH_INFO with internal slashes. - The default status code for append_slash_redirect is 308 instead of 301. This preserves the request body, and matches a previous change to strict_slashes in routing. - Fix ValueError: I/O operation on closed file. with the test client when following more than one redirect. - Response.autocorrect_location_header is disabled by default. The Location header URL will remain relative, and exclude the scheme and domain, by default. - Request.get_json() will raise a 400 BadRequest error if the Content-Type header is not application/json. This makes a very common source of confusion more visible. - Add no-network-testing.patch to mark all tests requiring network access (so they can be skipped by pytest test runner, gh#pallets/werkzeug#2393). OBS-URL: https://build.opensuse.org/request/show/970992 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Werkzeug?expand=0&rev=35
This commit is contained in:
commit
7a5f3e30ca
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:b863f8ff057c522164b6067c9e28b041161b4be5ba4d0daceeaa50a163822d3c
|
|
||||||
size 895551
|
|
3
Werkzeug-2.1.1.tar.gz
Normal file
3
Werkzeug-2.1.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:f8e89a20aeabbe8a893c24a461d3ee5dad2123b05cc6abd73ceed01d39c3ae74
|
||||||
|
size 833848
|
53
no-network-testing.patch
Normal file
53
no-network-testing.patch
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
---
|
||||||
|
pytest.ini | 3 +++
|
||||||
|
tests/test_serving.py | 5 +++++
|
||||||
|
2 files changed, 8 insertions(+)
|
||||||
|
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/pytest.ini
|
||||||
|
@@ -0,0 +1,3 @@
|
||||||
|
+[pytest]
|
||||||
|
+markers =
|
||||||
|
+ network: tests requiring network connection
|
||||||
|
--- a/tests/test_serving.py
|
||||||
|
+++ b/tests/test_serving.py
|
||||||
|
@@ -118,6 +118,7 @@ def test_windows_get_args_for_reloading(
|
||||||
|
assert rv == argv
|
||||||
|
|
||||||
|
|
||||||
|
+@pytest.mark.network
|
||||||
|
@pytest.mark.parametrize("find", [_find_stat_paths, _find_watchdog_paths])
|
||||||
|
def test_exclude_patterns(find):
|
||||||
|
# Imported paths under sys.prefix will be included by default.
|
||||||
|
@@ -157,6 +158,7 @@ def test_port_is_int():
|
||||||
|
run_simple("127.0.0.1", "5000", None)
|
||||||
|
|
||||||
|
|
||||||
|
+@pytest.mark.network
|
||||||
|
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
|
||||||
|
@pytest.mark.parametrize("send_length", [False, True])
|
||||||
|
def test_chunked_request(monkeypatch, dev_server, send_length):
|
||||||
|
@@ -241,6 +243,7 @@ def test_multiline_header_folding(standa
|
||||||
|
assert data["HTTP_XYZ"] == "first\tsecond\tthird"
|
||||||
|
|
||||||
|
|
||||||
|
+@pytest.mark.network
|
||||||
|
@pytest.mark.parametrize("endpoint", ["", "crash"])
|
||||||
|
def test_streaming_close_response(dev_server, endpoint):
|
||||||
|
"""When using HTTP/1.0, chunked encoding is not supported. Fall
|
||||||
|
@@ -252,6 +255,7 @@ def test_streaming_close_response(dev_se
|
||||||
|
assert r.data == "".join(str(x) + "\n" for x in range(5)).encode()
|
||||||
|
|
||||||
|
|
||||||
|
+@pytest.mark.network
|
||||||
|
def test_streaming_chunked_response(dev_server):
|
||||||
|
"""When using HTTP/1.1, use Transfer-Encoding: chunked for streamed
|
||||||
|
responses, since it can distinguish the end of the response without
|
||||||
|
@@ -264,6 +268,7 @@ def test_streaming_chunked_response(dev_
|
||||||
|
assert r.data == "".join(str(x) + "\n" for x in range(5)).encode()
|
||||||
|
|
||||||
|
|
||||||
|
+@pytest.mark.network
|
||||||
|
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
|
||||||
|
def test_streaming_chunked_truncation(dev_server):
|
||||||
|
"""When using HTTP/1.1, chunked encoding allows the client to detect
|
@ -1,3 +1,108 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Apr 19 18:54:06 UTC 2022 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Update to 2.1.1:
|
||||||
|
- ResponseCacheControl.s_maxage converts its value to an int,
|
||||||
|
like max_age.
|
||||||
|
- Drop support for Python 3.6.
|
||||||
|
- Using gevent or eventlet requires greenlet>=1.0 or
|
||||||
|
PyPy>=7.3.7. werkzeug.locals and contextvars will not work
|
||||||
|
correctly with older versions.
|
||||||
|
- Remove previously deprecated code.
|
||||||
|
- Remove the non-standard shutdown function from the WSGI
|
||||||
|
environ when running the development server. See the docs
|
||||||
|
for alternatives.
|
||||||
|
- Request and response mixins have all been merged into the
|
||||||
|
Request and Response classes.
|
||||||
|
- The user agent parser and the useragents module is
|
||||||
|
removed. The user_agent module provides an interface that
|
||||||
|
can be subclassed to add a parser, such as ua-parser. By
|
||||||
|
default it only stores the whole string.
|
||||||
|
- The test client returns TestResponse instances and can no
|
||||||
|
longer be treated as a tuple. All data is available as
|
||||||
|
properties on the response.
|
||||||
|
- Remove locals.get_ident and related thread-local code from
|
||||||
|
locals, it no longer makes sense when moving to
|
||||||
|
a contextvars-based implementation.
|
||||||
|
- Remove the python -m werkzeug.serving CLI.
|
||||||
|
- The has_key method on some mapping datastructures; use key
|
||||||
|
in data instead.
|
||||||
|
- Request.disable_data_descriptor is removed, pass
|
||||||
|
shallow=True instead.
|
||||||
|
- Remove the no_etag parameter from Response.freeze().
|
||||||
|
- Remove the HTTPException.wrap class method.
|
||||||
|
- Remove the cookie_date function. Use http_date instead.
|
||||||
|
- Remove the pbkdf2_hex, pbkdf2_bin, and safe_str_cmp
|
||||||
|
functions. Use equivalents in hashlib and hmac modules
|
||||||
|
instead.
|
||||||
|
- Remove the Href class.
|
||||||
|
- Remove the HTMLBuilder class.
|
||||||
|
- Remove the invalidate_cached_property function. Use del
|
||||||
|
obj.attr instead.
|
||||||
|
- Remove bind_arguments and validate_arguments. Use
|
||||||
|
Signature.bind() and inspect.signature() instead.
|
||||||
|
- Remove detect_utf_encoding, it’s built-in to json.loads.
|
||||||
|
- Remove format_string, use string.Template instead.
|
||||||
|
- Remove escape and unescape. Use MarkupSafe instead.
|
||||||
|
- The multiple parameter of parse_options_header is
|
||||||
|
deprecated.
|
||||||
|
- Rely on PEP 538 and PEP 540 to handle decoding file names
|
||||||
|
with the correct filesystem encoding. The filesystem module
|
||||||
|
is removed.
|
||||||
|
- Default values passed to Headers are validated the same way
|
||||||
|
values added later are.
|
||||||
|
- Setting CacheControl int properties, such as max_age, will
|
||||||
|
convert the value to an int.
|
||||||
|
- Always use socket.fromfd when restarting the dev server.
|
||||||
|
- When passing a dict of URL values to Map.build, list values
|
||||||
|
do not filter out None or collapse to a single value.
|
||||||
|
Passing a MultiDict does collapse single items. This undoes
|
||||||
|
a previous change that made it difficult to pass a list, or
|
||||||
|
None values in a list, to custom URL converters.
|
||||||
|
- run_simple shows instructions for dealing with “address
|
||||||
|
already in use” errors, including extra instructions for
|
||||||
|
macOS.
|
||||||
|
- Extend list of characters considered always safe in URLs
|
||||||
|
based on RFC 3986.
|
||||||
|
- Optimize the stat reloader to avoid watching unnecessary
|
||||||
|
files in more cases. The watchdog reloader is still
|
||||||
|
recommended for performance and accuracy.
|
||||||
|
- The development server uses Transfer-Encoding: chunked for
|
||||||
|
streaming responses when it is configured for HTTP/1.1.
|
||||||
|
- The development server uses HTTP/1.1, which enables
|
||||||
|
keep-alive connections and chunked streaming responses,
|
||||||
|
when threaded or processes is enabled.
|
||||||
|
- cached_property works for classes with __slots__ if
|
||||||
|
a corresponding _cache_{name} slot is added.
|
||||||
|
- Refactor the debugger traceback formatter to use Python’s
|
||||||
|
built-in traceback module as much as possible.
|
||||||
|
- The TestResponse.text property is a shortcut for
|
||||||
|
r.get_data(as_text=True), for convenient testing against
|
||||||
|
text instead of bytes.
|
||||||
|
- safe_join ensures that the path remains relative if the
|
||||||
|
trusted directory is the empty string.
|
||||||
|
- Percent-encoded newlines (%0a), which are decoded by WSGI
|
||||||
|
servers, are considered when routing instead of terminating
|
||||||
|
the match early.
|
||||||
|
- The test client doesn’t set duplicate headers for
|
||||||
|
CONTENT_LENGTH and CONTENT_TYPE.
|
||||||
|
- append_slash_redirect handles PATH_INFO with internal
|
||||||
|
slashes.
|
||||||
|
- The default status code for append_slash_redirect is 308
|
||||||
|
instead of 301. This preserves the request body, and
|
||||||
|
matches a previous change to strict_slashes in routing.
|
||||||
|
- Fix ValueError: I/O operation on closed file. with the test
|
||||||
|
client when following more than one redirect.
|
||||||
|
- Response.autocorrect_location_header is disabled by
|
||||||
|
default. The Location header URL will remain relative, and
|
||||||
|
exclude the scheme and domain, by default.
|
||||||
|
- Request.get_json() will raise a 400 BadRequest error if the
|
||||||
|
Content-Type header is not application/json. This makes
|
||||||
|
a very common source of confusion more visible.
|
||||||
|
- Add no-network-testing.patch to mark all tests requiring
|
||||||
|
network access (so they can be skipped by pytest test runner,
|
||||||
|
gh#pallets/werkzeug#2393).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Feb 15 08:39:23 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
Tue Feb 15 08:39:23 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -18,16 +18,20 @@
|
|||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
%define skip_python2 1
|
%define skip_python2 1
|
||||||
|
%define skip_python36 1
|
||||||
Name: python-Werkzeug
|
Name: python-Werkzeug
|
||||||
Version: 2.0.3
|
Version: 2.1.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: The Swiss Army knife of Python web development
|
Summary: The Swiss Army knife of Python web development
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://werkzeug.palletsprojects.com
|
URL: https://werkzeug.palletsprojects.com
|
||||||
Source: https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM no-network-testing.patch gh#pallets/werkzeug#2393 mcepl@suse.com
|
||||||
|
# mark tests which require network access
|
||||||
|
Patch0: no-network-testing.patch
|
||||||
BuildRequires: %{python_module cryptography}
|
BuildRequires: %{python_module cryptography}
|
||||||
BuildRequires: %{python_module dataclasses if %python-base < 3.7}
|
BuildRequires: %{python_module ephemeral-port-reserve}
|
||||||
BuildRequires: %{python_module hypothesis}
|
BuildRequires: %{python_module hypothesis}
|
||||||
BuildRequires: %{python_module pytest >= 6.2.4}
|
BuildRequires: %{python_module pytest >= 6.2.4}
|
||||||
BuildRequires: %{python_module pytest-timeout}
|
BuildRequires: %{python_module pytest-timeout}
|
||||||
@ -38,9 +42,6 @@ BuildRequires: %{python_module setuptools}
|
|||||||
BuildRequires: %{python_module sortedcontainers}
|
BuildRequires: %{python_module sortedcontainers}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
%if %python_version_nodots < 37
|
|
||||||
Requires: python-dataclasses
|
|
||||||
%endif
|
|
||||||
Recommends: python-termcolor
|
Recommends: python-termcolor
|
||||||
Recommends: python-watchdog
|
Recommends: python-watchdog
|
||||||
Obsoletes: python-Werkzeug-doc < %{version}
|
Obsoletes: python-Werkzeug-doc < %{version}
|
||||||
@ -67,7 +68,8 @@ on as many server environments as possible (such as blogs, wikis,
|
|||||||
bulletin boards, etc.).
|
bulletin boards, etc.).
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n Werkzeug-%{version}
|
%autosetup -p1 -n Werkzeug-%{version}
|
||||||
|
|
||||||
sed -i "1d" examples/manage-{i18nurls,simplewiki,shorty,couchy,cupoftee,webpylike,plnt,coolmagic}.py # Fix non-executable scripts
|
sed -i "1d" examples/manage-{i18nurls,simplewiki,shorty,couchy,cupoftee,webpylike,plnt,coolmagic}.py # Fix non-executable scripts
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -81,7 +83,7 @@ sed -i "1d" examples/manage-{i18nurls,simplewiki,shorty,couchy,cupoftee,webpylik
|
|||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
export PYTHONDONTWRITEBYTECODE=1
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
# workaround pytest 6.2 (like https://github.com/pallets/werkzeug/commit/16718f461d016b88b6457d3ef63816b7df1f0d1f, but shorter)
|
# workaround pytest 6.2 (like https://github.com/pallets/werkzeug/commit/16718f461d016b88b6457d3ef63816b7df1f0d1f, but shorter)
|
||||||
%pytest -k 'not test_reloader_sys_path and not test_chunked_encoding and not test_basic and not test_server and not test_ssl and not test_http_proxy and not test_500_error and not test_untrusted_host and not test_double_slash_path and not test_wrong_protocol and not test_content_type_and_length and not test_multiple_headers_concatenated and not test_multiline_header_folding'
|
%pytest -k 'not (network or test_reloader_sys_path or test_chunked_encoding or test_basic or test_server or test_ssl or test_http_proxy or test_500_error or test_untrusted_host or test_double_slash_path or test_wrong_protocol or test_content_type_and_length or test_multiple_headers_concatenated or test_multiline_header_folding)'
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE.rst
|
%license LICENSE.rst
|
||||||
|
Loading…
Reference in New Issue
Block a user