15
0

8 Commits

Author SHA256 Message Date
58fa1f71bf Accepting request 1306745 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1306745
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-uvicorn?expand=0&rev=22
2025-09-25 16:44:09 +00:00
50289d2a3f - Update to 0.36.0
* Don't include cwd() when non-empty --reload-dirs is passed
  * Apply get_client_addr formatting to WebSocket logging
  * Add WebSocketsSansIOProtocol
  * Refine help message for option --proxy-headers
  * Support custom IOLOOPs
  * Allow to provide importable string in --http, --ws and --loop
- support-websockets-14+.patch was almost fixed upstream, apply the rest
- Add upstream patch py314.patch to fix build with Python 3.14

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-uvicorn?expand=0&rev=44
2025-09-23 13:22:51 +00:00
85c30531ce Accepting request 1301305 from devel:languages:python
- Convert to libalternatives on SLE-16-based and newer systems

OBS-URL: https://build.opensuse.org/request/show/1301305
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-uvicorn?expand=0&rev=21
2025-08-26 12:56:24 +00:00
0da638293e - Convert to libalternatives on SLE-16-based and newer systems
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-uvicorn?expand=0&rev=42
2025-08-25 14:28:23 +00:00
d46af83575 Accepting request 1273799 from devel:languages:python
- Update to 0.34.2:
  * Added
    + Add content-length to 500 response in wsproto implementation
  * Fixed
    + Flush stdout buffer on Windows to trigger reload
    + Drop ASGI spec version to 2.3 on HTTP scope
    + Enable httptools lenient data on httptools >= 0.6.3
  * Deprecated
    + Deprecate ServerState in the main module
  * Removed
    + Drop support for Python 3.8
    + Remove WatchGod support for --reload
- Add patch support-websockets-14+.patch:
  * Ignore multiple classes of DeprecationWarnings.

OBS-URL: https://build.opensuse.org/request/show/1273799
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-uvicorn?expand=0&rev=20
2025-05-02 12:55:37 +00:00
e5aaa0840c - Update to 0.34.2:
* Added
    + Add content-length to 500 response in wsproto implementation
  * Fixed
    + Flush stdout buffer on Windows to trigger reload
    + Drop ASGI spec version to 2.3 on HTTP scope
    + Enable httptools lenient data on httptools >= 0.6.3
  * Deprecated
    + Deprecate ServerState in the main module
  * Removed
    + Drop support for Python 3.8
    + Remove WatchGod support for --reload
- Add patch support-websockets-14+.patch:
  * Ignore multiple classes of DeprecationWarnings.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-uvicorn?expand=0&rev=40
2025-05-01 06:29:24 +00:00
5b19213f31 Accepting request 1219531 from devel:languages:python
- update to 0.32.0:
  * Officially support Python 3.13
  * Warn when `max_request_limit` is exceeded
  * Support WebSockets 0.13.1
  * Restore support for `[*]` in trusted hosts
  * Add `PathLike[str]` type hint for `ssl_keyfile`
  * Improve `ProxyHeadersMiddleware` (#2468) and (#2231):
  * Fix the host for requests from clients running on the proxy
    server itself.
  * Fallback to host that was already set for empty x-forwarded-
    for headers.
  * Also allow to specify IP Networks as trusted hosts. This
    greatly simplifies deployments
  * on docker swarm/kubernetes, where the reverse proxy might
    have a dynamic IP.
  * This includes support for IPv6 Address/Networks.
  * Don't warn when upgrade is not WebSocket and depedencies are
    installed
  * Don't close connection before receiving body on H11
  * Close connection when `h11` sets client state to `MUST_CLOSE`
  * Suppress `KeyboardInterrupt` from CLI and programmatic usage
  * `ClientDisconnect` inherits from `OSError` instead of
    `IOError`
  * Add `reason` support to `websocket.disconnect` event
  * Iterate subprocesses in-place on the process manager
  * Allow horizontal tabs `	` in response header values
  * New multiprocess manager
  * Allow `ConfigParser` or a `io.IO[Any]` on `log_config`
  * Suppress side-effects of signal propagation
  * Send `content-length` header on 5xx

OBS-URL: https://build.opensuse.org/request/show/1219531
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-uvicorn?expand=0&rev=19
2024-10-30 16:33:31 +00:00
d54bdd799e - update to 0.32.0:
* Officially support Python 3.13
  * Warn when `max_request_limit` is exceeded
  * Support WebSockets 0.13.1
  * Restore support for `[*]` in trusted hosts
  * Add `PathLike[str]` type hint for `ssl_keyfile`
  * Improve `ProxyHeadersMiddleware` (#2468) and (#2231):
  * Fix the host for requests from clients running on the proxy
    server itself.
  * Fallback to host that was already set for empty x-forwarded-
    for headers.
  * Also allow to specify IP Networks as trusted hosts. This
    greatly simplifies deployments
  * on docker swarm/kubernetes, where the reverse proxy might
    have a dynamic IP.
  * This includes support for IPv6 Address/Networks.
  * Don't warn when upgrade is not WebSocket and depedencies are
    installed
  * Don't close connection before receiving body on H11
  * Close connection when `h11` sets client state to `MUST_CLOSE`
  * Suppress `KeyboardInterrupt` from CLI and programmatic usage
  * `ClientDisconnect` inherits from `OSError` instead of
    `IOError`
  * Add `reason` support to `websocket.disconnect` event
  * Iterate subprocesses in-place on the process manager
  * Allow horizontal tabs `	` in response header values
  * New multiprocess manager
  * Allow `ConfigParser` or a `io.IO[Any]` on `log_config`
  * Suppress side-effects of signal propagation
  * Send `content-length` header on 5xx

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-uvicorn?expand=0&rev=38
2024-10-30 10:42:20 +00:00
8 changed files with 271 additions and 162 deletions

View File

@@ -1,133 +0,0 @@
From 62e52f30f75b42290e32adb85dd1319b9c5a0072 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <dcermak@suse.com>
Date: Mon, 25 Mar 2024 21:48:07 +0100
Subject: [PATCH] Stop using deprecated app shortcut in httpx.AsyncClient
This keyword parameter has been deprecated with httpx 0.27
---
tests/middleware/test_message_logger.py | 8 ++++----
tests/middleware/test_proxy_headers.py | 6 +++---
tests/middleware/test_wsgi.py | 23 ++++++++---------------
3 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/tests/middleware/test_message_logger.py b/tests/middleware/test_message_logger.py
index 3f5c3af..d066e99 100644
--- a/tests/middleware/test_message_logger.py
+++ b/tests/middleware/test_message_logger.py
@@ -17,8 +17,8 @@ async def test_message_logger(caplog):
caplog.set_level(TRACE_LOG_LEVEL, logger="uvicorn.asgi")
caplog.set_level(TRACE_LOG_LEVEL)
- app = MessageLoggerMiddleware(app)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
+ transport = httpx.ASGITransport(MessageLoggerMiddleware(app))
+ async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client:
response = await client.get("/")
assert response.status_code == 200
messages = [record.msg % record.args for record in caplog.records]
@@ -37,8 +37,8 @@ async def test_message_logger_exc(caplog):
with caplog_for_logger(caplog, "uvicorn.asgi"):
caplog.set_level(TRACE_LOG_LEVEL, logger="uvicorn.asgi")
caplog.set_level(TRACE_LOG_LEVEL)
- app = MessageLoggerMiddleware(app)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
+ transport = httpx.ASGITransport(MessageLoggerMiddleware(app))
+ async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client:
with pytest.raises(RuntimeError):
await client.get("/")
messages = [record.msg % record.args for record in caplog.records]
diff --git a/tests/middleware/test_proxy_headers.py b/tests/middleware/test_proxy_headers.py
index 6d7fc8c..e50defa 100644
--- a/tests/middleware/test_proxy_headers.py
+++ b/tests/middleware/test_proxy_headers.py
@@ -49,7 +49,7 @@ async def app(
)
async def test_proxy_headers_trusted_hosts(trusted_hosts: list[str] | str, response_text: str) -> None:
app_with_middleware = ProxyHeadersMiddleware(app, trusted_hosts=trusted_hosts)
- async with httpx.AsyncClient(app=app_with_middleware, base_url="http://testserver") as client:
+ async with httpx.AsyncClient(transport=httpx.ASGITransport(app=app_with_middleware), base_url="http://testserver") as client:
headers = {"X-Forwarded-Proto": "https", "X-Forwarded-For": "1.2.3.4"}
response = await client.get("/", headers=headers)
@@ -79,7 +79,7 @@ async def test_proxy_headers_trusted_hosts(trusted_hosts: list[str] | str, respo
)
async def test_proxy_headers_multiple_proxies(trusted_hosts: list[str] | str, response_text: str) -> None:
app_with_middleware = ProxyHeadersMiddleware(app, trusted_hosts=trusted_hosts)
- async with httpx.AsyncClient(app=app_with_middleware, base_url="http://testserver") as client:
+ async with httpx.AsyncClient(transport=httpx.ASGITransport(app=app_with_middleware), base_url="http://testserver") as client:
headers = {
"X-Forwarded-Proto": "https",
"X-Forwarded-For": "1.2.3.4, 10.0.2.1, 192.168.0.2",
@@ -93,7 +93,7 @@ async def test_proxy_headers_multiple_proxies(trusted_hosts: list[str] | str, re
@pytest.mark.anyio
async def test_proxy_headers_invalid_x_forwarded_for() -> None:
app_with_middleware = ProxyHeadersMiddleware(app, trusted_hosts="*")
- async with httpx.AsyncClient(app=app_with_middleware, base_url="http://testserver") as client:
+ async with httpx.AsyncClient(transport=httpx.ASGITransport(app=app_with_middleware), base_url="http://testserver") as client:
headers = httpx.Headers(
{
"X-Forwarded-Proto": "https",
diff --git a/tests/middleware/test_wsgi.py b/tests/middleware/test_wsgi.py
index adc8e24..478dd84 100644
--- a/tests/middleware/test_wsgi.py
+++ b/tests/middleware/test_wsgi.py
@@ -59,8 +59,8 @@ def wsgi_middleware(request: pytest.FixtureRequest) -> Callable:
@pytest.mark.anyio
async def test_wsgi_get(wsgi_middleware: Callable) -> None:
- app = wsgi_middleware(hello_world)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
+ transport = httpx.ASGITransport(wsgi_middleware(hello_world))
+ async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client:
response = await client.get("/")
assert response.status_code == 200
assert response.text == "Hello World!\n"
@@ -68,8 +68,8 @@ async def test_wsgi_get(wsgi_middleware: Callable) -> None:
@pytest.mark.anyio
async def test_wsgi_post(wsgi_middleware: Callable) -> None:
- app = wsgi_middleware(echo_body)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
+ transport = httpx.ASGITransport(wsgi_middleware(echo_body))
+ async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client:
response = await client.post("/", json={"example": 123})
assert response.status_code == 200
assert response.text == '{"example": 123}'
@@ -81,8 +81,8 @@ async def test_wsgi_put_more_body(wsgi_middleware: Callable) -> None:
for _ in range(1024):
yield b"123456789abcdef\n" * 64
- app = wsgi_middleware(echo_body)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
+ transport = httpx.ASGITransport(wsgi_middleware(echo_body))
+ async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client:
response = await client.put("/", content=generate_body())
assert response.status_code == 200
assert response.text == "123456789abcdef\n" * 64 * 1024
@@ -92,21 +92,14 @@ async def test_wsgi_put_more_body(wsgi_middleware: Callable) -> None:
async def test_wsgi_exception(wsgi_middleware: Callable) -> None:
# Note that we're testing the WSGI app directly here.
# The HTTP protocol implementations would catch this error and return 500.
- app = wsgi_middleware(raise_exception)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
+ transport = httpx.ASGITransport(wsgi_middleware(raise_exception))
+ async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client:
with pytest.raises(RuntimeError):
await client.get("/")
@pytest.mark.anyio
async def test_wsgi_exc_info(wsgi_middleware: Callable) -> None:
- # Note that we're testing the WSGI app directly here.
- # The HTTP protocol implementations would catch this error and return 500.
- app = wsgi_middleware(return_exc_info)
- async with httpx.AsyncClient(app=app, base_url="http://testserver") as client:
- with pytest.raises(RuntimeError):
- response = await client.get("/")
-
app = wsgi_middleware(return_exc_info)
transport = httpx.ASGITransport(
app=app,
--
2.44.0

View File

@@ -1,13 +0,0 @@
Index: uvicorn-0.22.0/tests/protocols/test_websocket.py
===================================================================
--- uvicorn-0.22.0.orig/tests/protocols/test_websocket.py
+++ uvicorn-0.22.0/tests/protocols/test_websocket.py
@@ -584,7 +584,7 @@ async def test_asgi_return_value(
async with run_server(config):
with pytest.raises(websockets.exceptions.ConnectionClosed) as exc_info:
await connect(f"ws://127.0.0.1:{unused_tcp_port}")
- assert exc_info.value.code == 1006
+ assert exc_info.value.code in {1000, 1006}
@pytest.mark.anyio

156
py314.patch Normal file
View File

@@ -0,0 +1,156 @@
From 208a37a4de8f2fd6697dc3eaf076bac7442f5628 Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Sat, 14 Oct 2023 11:48:19 +0100
Subject: [PATCH 01/19] use asyncio.run(..., loop_factory) to avoid
asyncio.set_event_loop_policy
---
tests/test_auto_detection.py | 11 ++---
uvicorn/_compat.py | 86 ++++++++++++++++++++++++++++++++++++
uvicorn/config.py | 17 +++----
uvicorn/loops/asyncio.py | 13 ++++--
uvicorn/loops/auto.py | 18 +++++---
uvicorn/loops/uvloop.py | 9 +++-
uvicorn/main.py | 4 +-
uvicorn/server.py | 4 +-
uvicorn/workers.py | 6 +--
9 files changed, 138 insertions(+), 30 deletions(-)
create mode 100644 uvicorn/_compat.py
Index: uvicorn-0.36.0/tests/test_auto_detection.py
===================================================================
--- uvicorn-0.36.0.orig/tests/test_auto_detection.py
+++ uvicorn-0.36.0/tests/test_auto_detection.py
@@ -1,6 +1,7 @@
import asyncio
import contextlib
import importlib
+import sys
import pytest
@@ -12,9 +13,14 @@ from uvicorn.server import ServerState
try:
importlib.import_module("uvloop")
- expected_loop = "uvloop" # pragma: py-win32
except ImportError: # pragma: py-not-win32
expected_loop = "asyncio"
+except AttributeError: # pragma: py-lt-314 # pragma: py-win32
+ if sys.version_info < (3, 14): # pragma: no cover
+ raise
+ expected_loop = "asyncio"
+else: # pragma: py-win32 # pragma: py-gte-314
+ expected_loop = "uvloop"
try:
importlib.import_module("httptools")
Index: uvicorn-0.36.0/uvicorn/_compat.py
===================================================================
--- uvicorn-0.36.0.orig/uvicorn/_compat.py
+++ uvicorn-0.36.0/uvicorn/_compat.py
@@ -5,6 +5,13 @@ import sys
from collections.abc import Callable, Coroutine
from typing import Any, TypeVar
+__all__ = ["asyncio_run", "iscoroutinefunction"]
+
+if sys.version_info >= (3, 14):
+ from inspect import iscoroutinefunction
+else:
+ from asyncio import iscoroutinefunction
+
_T = TypeVar("_T")
if sys.version_info >= (3, 12):
Index: uvicorn-0.36.0/uvicorn/config.py
===================================================================
--- uvicorn-0.36.0.orig/uvicorn/config.py
+++ uvicorn-0.36.0/uvicorn/config.py
@@ -16,6 +16,7 @@ from typing import IO, Any, Callable, Li
import click
+from uvicorn._compat import iscoroutinefunction
from uvicorn._types import ASGIApplication
from uvicorn.importer import ImportFromStringError, import_from_string
from uvicorn.logging import TRACE_LOG_LEVEL
Index: uvicorn-0.36.0/uvicorn/loops/auto.py
===================================================================
--- uvicorn-0.36.0.orig/uvicorn/loops/auto.py
+++ uvicorn-0.36.0/uvicorn/loops/auto.py
@@ -1,17 +1,23 @@
from __future__ import annotations
import asyncio
+import sys
from collections.abc import Callable
-def auto_loop_factory(use_subprocess: bool = False) -> Callable[[], asyncio.AbstractEventLoop]:
+def auto_loop_factory(use_subprocess: bool = False) -> Callable[[], asyncio.AbstractEventLoop]: # pragma: no cover
try:
import uvloop # noqa
except ImportError: # pragma: no cover
- from uvicorn.loops.asyncio import asyncio_loop_factory as loop_factory
-
- return loop_factory(use_subprocess=use_subprocess)
+ pass
+ except AttributeError: # pragma: no cover
+ if sys.version_info < (3, 14):
+ raise
else: # pragma: no cover
from uvicorn.loops.uvloop import uvloop_loop_factory
return uvloop_loop_factory(use_subprocess=use_subprocess)
+
+ from uvicorn.loops.asyncio import asyncio_loop_factory as loop_factory
+
+ return loop_factory(use_subprocess=use_subprocess)
Index: uvicorn-0.36.0/pyproject.toml
===================================================================
--- uvicorn-0.36.0.orig/pyproject.toml
+++ uvicorn-0.36.0/pyproject.toml
@@ -25,6 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
@@ -160,6 +161,7 @@ exclude_lines = [
"tests/supervisors/test_multiprocess.py",
]
"sys_platform != 'win32'" = ["uvicorn/loops/asyncio.py"]
+"sys_version_info >= (3, 14)" = ["uvicorn/loops/uvloop.py"]
[tool.coverage.coverage_conditional_plugin.rules]
py-win32 = "sys_platform == 'win32'"
@@ -173,3 +175,5 @@ py-gte-310 = "sys_version_info >= (3, 10
py-lt-310 = "sys_version_info < (3, 10)"
py-gte-311 = "sys_version_info >= (3, 11)"
py-lt-311 = "sys_version_info < (3, 11)"
+py-gte-314 = "sys_version_info >= (3, 14)"
+py-lt-314 = "sys_version_info < (3, 14)"
Index: uvicorn-0.36.0/tests/test_compat.py
===================================================================
--- uvicorn-0.36.0.orig/tests/test_compat.py
+++ uvicorn-0.36.0/tests/test_compat.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import asyncio
+import sys
from asyncio import AbstractEventLoop
import pytest
@@ -23,7 +24,7 @@ def test_asyncio_run__custom_loop_factor
def test_asyncio_run__passing_a_non_awaitable_callback_should_throw_error() -> None:
- with pytest.raises(ValueError):
+ with pytest.raises(TypeError if sys.version_info >= (3, 14) else ValueError):
asyncio_run(
lambda: None, # type: ignore
loop_factory=CustomLoop,

View File

@@ -1,3 +1,77 @@
-------------------------------------------------------------------
Mon Sep 22 13:01:16 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 0.36.0
* Don't include cwd() when non-empty --reload-dirs is passed
* Apply get_client_addr formatting to WebSocket logging
* Add WebSocketsSansIOProtocol
* Refine help message for option --proxy-headers
* Support custom IOLOOPs
* Allow to provide importable string in --http, --ws and --loop
- support-websockets-14+.patch was almost fixed upstream, apply the rest
- Add upstream patch py314.patch to fix build with Python 3.14
-------------------------------------------------------------------
Mon Aug 25 14:27:42 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems
-------------------------------------------------------------------
Thu May 1 06:28:46 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.34.2:
* Added
+ Add content-length to 500 response in wsproto implementation
* Fixed
+ Flush stdout buffer on Windows to trigger reload
+ Drop ASGI spec version to 2.3 on HTTP scope
+ Enable httptools lenient data on httptools >= 0.6.3
* Deprecated
+ Deprecate ServerState in the main module
* Removed
+ Drop support for Python 3.8
+ Remove WatchGod support for --reload
- Add patch support-websockets-14+.patch:
* Ignore multiple classes of DeprecationWarnings.
-------------------------------------------------------------------
Wed Oct 30 10:37:07 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 0.32.0:
* Officially support Python 3.13
* Warn when `max_request_limit` is exceeded
* Support WebSockets 0.13.1
* Restore support for `[*]` in trusted hosts
* Add `PathLike[str]` type hint for `ssl_keyfile`
* Improve `ProxyHeadersMiddleware` (#2468) and (#2231):
* Fix the host for requests from clients running on the proxy
server itself.
* Fallback to host that was already set for empty x-forwarded-
for headers.
* Also allow to specify IP Networks as trusted hosts. This
greatly simplifies deployments
* on docker swarm/kubernetes, where the reverse proxy might
have a dynamic IP.
* This includes support for IPv6 Address/Networks.
* Don't warn when upgrade is not WebSocket and depedencies are
installed
* Don't close connection before receiving body on H11
* Close connection when `h11` sets client state to `MUST_CLOSE`
* Suppress `KeyboardInterrupt` from CLI and programmatic usage
* `ClientDisconnect` inherits from `OSError` instead of
`IOError`
* Add `reason` support to `websocket.disconnect` event
* Iterate subprocesses in-place on the process manager
* Allow horizontal tabs ` ` in response header values
* New multiprocess manager
* Allow `ConfigParser` or a `io.IO[Any]` on `log_config`
* Suppress side-effects of signal propagation
* Send `content-length` header on 5xx
* Deprecate the `uvicorn.workers` module
- drop fix-websocket-tests.patch,
0001-Stop-using-deprecated-app-shortcut-in-httpx.AsyncCli.patch:
upstream
-------------------------------------------------------------------
Mon Mar 25 20:19:46 UTC 2024 - Dan Čermák <dcermak@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-uvicorn
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,35 +16,43 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-uvicorn
Version: 0.29.0
Version: 0.36.0
Release: 0
Summary: An Asynchronous Server Gateway Interface server
License: BSD-3-Clause
URL: https://github.com/encode/uvicorn
Source: https://github.com/encode/uvicorn/archive/%{version}.tar.gz#/uvicorn-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix-websocket-tests.patch -- gh#encode/uvicorn#1929
Patch0: fix-websocket-tests.patch
# https://github.com/encode/uvicorn/pull/2288
Patch1: 0001-Stop-using-deprecated-app-shortcut-in-httpx.AsyncCli.patch
# PATCH-FIX-OPENSUSE Ignore the large amount of DeprecationWarnings that websockets 14 gave us
Patch0: support-websockets-14+.patch
# PATCH-FIX-UPSTREAM small part of https://github.com/Kludex/uvicorn/pull/2548 test on 3.14
Patch1: py314.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing-extensions >= 4 if %python-base < 3.11}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-click >= 7.0
Requires: python-h11 >= 0.8.0
Requires: (python-typing-extensions >= 4 if python-base < 3.11)
Recommends: python-PyYAML >= 5.1
Recommends: python-httptools >= 0.4.0
Recommends: python-websockets >= 8.0
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%endif
# SECTION test requirements
BuildRequires: %{python_module PyYAML >= 5.1}
BuildRequires: %{python_module click >= 7.0}
@@ -53,15 +61,16 @@ BuildRequires: %{python_module httptools >= 0.4.0}
BuildRequires: %{python_module httpx >= 0.27}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-dotenv}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module trustme}
BuildRequires: %{python_module websockets >= 10.4}
BuildRequires: %{python_module wsproto >= 1.2.0}
%if 0%{?suse_version} > 1500
BuildRequires: %{python_module uvloop >= 0.14.0}
%endif
BuildRequires: %{python_module websockets >= 10.4}
BuildRequires: %{python_module wsproto >= 1.2.0}
# We don't want watchfiles in Ring1
#BuildRequires: #{python_module watchfiles >= 0.13}
# /SECTION
@@ -88,6 +97,9 @@ It supports HTTP/1.1 and WebSockets only.
%postun
%python_uninstall_alternative uvicorn
%pre
%python_libalternatives_reset_alternative uvicorn
%check
# Required for reporting bugs
%python_exec -m uvicorn --version
@@ -97,13 +109,14 @@ ignore="--ignore tests/middleware/test_wsgi.py"
%if "%{_arch}" == "s390x"
ignore+=" --ignore tests/protocols/test_websocket.py"
%endif
%pytest $ignore
# no longer raises an exception with Websockets 14+
%pytest $ignore -k 'not test_send_binary_data_to_server_bigger_than_default_on_websockets'
%files %{python_files}
%doc README.md
%license LICENSE.md
%python_alternative %{_bindir}/uvicorn
%{python_sitelib}/uvicorn
%{python_sitelib}/uvicorn-%{version}*-info
%{python_sitelib}/uvicorn-%{version}.dist-info
%changelog

View File

@@ -0,0 +1,12 @@
Index: uvicorn-0.36.0/pyproject.toml
===================================================================
--- uvicorn-0.36.0.orig/pyproject.toml
+++ uvicorn-0.36.0/pyproject.toml
@@ -130,6 +130,7 @@ filterwarnings = [
"ignore: websockets.legacy is deprecated.*:DeprecationWarning",
"ignore: websockets.server.WebSocketServerProtocol is deprecated.*:DeprecationWarning",
"ignore: websockets.client.connect is deprecated.*:DeprecationWarning",
+ "ignore: websockets.exceptions.InvalidStatusCode is deprecated:DeprecationWarning",
]
[tool.coverage.run]

Binary file not shown.

3
uvicorn-0.36.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dcff1c0826862d125b5b5bf45fe1d03241346e631802d29454792c6c5107ca8d
size 815375