14
0

Accepting request 1066222 from home:Simmphonie:branches:devel:languages:python

- Update to version 0.20.0:
  * Check if handshake is completed before sending frame on `wsproto` shutdown (#1737)
  * Add default headers to WebSockets implementations (#1606 & #1747) 28/10/22
  * Warn user when `reload` and `workers` flag are used together (#1731) 31/10/22
  * Use correct `WebSocket` error codes on `close` (#1753) 20/11/22
  * Send disconnect event on connection lost for `wsproto` (#996) 29/10/22
  * Add `SIGQUIT` handler to `UvicornWorker` (#1710) 01/11/22
  * Fix crash on exist with "--uds" if socket doesn't exist (#1725) 27/10/22
  * Annotate `CONFIG_KWARGS` in `UvicornWorker` class (#1746) 31/10/22
  * Remove conditional on `RemoteProtocolError.event_hint` on `wsproto` (#1486) 31/10/22
  * Remove unused `handle_no_connect` on `wsproto` implementation (#1759) 17/11/22
- version 0.19.0
  * Support Python 3.11 (#1652) 16/09/22
  * Bump minimal `httptools` version to `0.5.0` (#1645) 13/09/22
  * Ignore HTTP/2 upgrade and optionally ignore WebSocket upgrade (#1661) 19/10/22
  * Add `py.typed` to comply with PEP 561 (#1687) 07/10/22
  * Set `propagate` to `False` on "uvicorn" logger (#1288) 08/10/22
  * USR1 signal is now handled correctly on `UvicornWorker`. (#1565) 26/08/22
  * Use path with query string on `WebSockets` logs (#1385) 11/09/22
  * Fix behavior on which "Date" headers were not updated on the same connection (#1706) 19/10/22
  * Remove the `--debug` flag (#1640) 14/09/22
  * Remove the `DebugMiddleware` (#1697) 07/10/22
- version 0.18.3
  * Remove cyclic references on HTTP implementations. (#1604) 24/08/22
  * `reload_delay` default changed from `None` to `0.25` on `uvicorn.run()` and `Config`.
    `None` is not an acceptable value anymore. (#1545) 02/07/22
- remove

OBS-URL: https://build.opensuse.org/request/show/1066222
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-uvicorn?expand=0&rev=14
This commit is contained in:
2023-02-16 18:05:55 +00:00
committed by Git OBS Bridge
parent 4c0b433ea3
commit 194d66b601
7 changed files with 44 additions and 104 deletions

View File

@@ -3,7 +3,7 @@
<service name="obs_scm" mode="disabled"> <service name="obs_scm" mode="disabled">
<param name="url">https://github.com/encode/uvicorn.git</param> <param name="url">https://github.com/encode/uvicorn.git</param>
<param name="scm">git</param> <param name="scm">git</param>
<param name="revision">0.17.0</param> <param name="revision">0.20.0</param>
<param name="versionformat">@PARENT_TAG@</param> <param name="versionformat">@PARENT_TAG@</param>
<param name="changesgenerate">enable</param> <param name="changesgenerate">enable</param>
</service> </service>

View File

@@ -1,4 +1,4 @@
<servicedata> <servicedata>
<service name="tar_scm"> <service name="tar_scm">
<param name="url">https://github.com/encode/uvicorn.git</param> <param name="url">https://github.com/encode/uvicorn.git</param>
<param name="changesrevision">59eeae66e926a7c6c1b6fd1a6d8fbe31719ab1c3</param></service></servicedata> <param name="changesrevision">448be75222093041561d136f9f2f5577d6e361ee</param></service></servicedata>

View File

@@ -1,4 +1,34 @@
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Feb 16 15:27:53 UTC 2023 - Torsten Gruner <simmphonie@opensuse.org>
- Update to version 0.20.0:
* Check if handshake is completed before sending frame on `wsproto` shutdown (#1737)
* Add default headers to WebSockets implementations (#1606 & #1747) 28/10/22
* Warn user when `reload` and `workers` flag are used together (#1731) 31/10/22
* Use correct `WebSocket` error codes on `close` (#1753) 20/11/22
* Send disconnect event on connection lost for `wsproto` (#996) 29/10/22
* Add `SIGQUIT` handler to `UvicornWorker` (#1710) 01/11/22
* Fix crash on exist with "--uds" if socket doesn't exist (#1725) 27/10/22
* Annotate `CONFIG_KWARGS` in `UvicornWorker` class (#1746) 31/10/22
* Remove conditional on `RemoteProtocolError.event_hint` on `wsproto` (#1486) 31/10/22
* Remove unused `handle_no_connect` on `wsproto` implementation (#1759) 17/11/22
- version 0.19.0
* Support Python 3.11 (#1652) 16/09/22
* Bump minimal `httptools` version to `0.5.0` (#1645) 13/09/22
* Ignore HTTP/2 upgrade and optionally ignore WebSocket upgrade (#1661) 19/10/22
* Add `py.typed` to comply with PEP 561 (#1687) 07/10/22
* Set `propagate` to `False` on "uvicorn" logger (#1288) 08/10/22
* USR1 signal is now handled correctly on `UvicornWorker`. (#1565) 26/08/22
* Use path with query string on `WebSockets` logs (#1385) 11/09/22
* Fix behavior on which "Date" headers were not updated on the same connection (#1706) 19/10/22
* Remove the `--debug` flag (#1640) 14/09/22
* Remove the `DebugMiddleware` (#1697) 07/10/22
- version 0.18.3
* Remove cyclic references on HTTP implementations. (#1604) 24/08/22
* `reload_delay` default changed from `None` to `0.25` on `uvicorn.run()` and `Config`.
`None` is not an acceptable value anymore. (#1545) 02/07/22
- remove
-------------------------------------------------------------------
Fri Aug 5 09:51:32 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org> Fri Aug 5 09:51:32 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
- Fix URL to 1537.patch: add ".patch" to the gh Pr to reference the - Fix URL to 1537.patch: add ".patch" to the gh Pr to reference the

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-uvicorn # spec file for package python-uvicorn
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -17,16 +17,17 @@
Name: python-uvicorn Name: python-uvicorn
Version: 0.18.2 Version: 0.20.0
Release: 0 Release: 0
Summary: An Asynchronous Server Gateway Interface server Summary: An Asynchronous Server Gateway Interface server
License: BSD-3-Clause License: BSD-3-Clause
URL: https://github.com/encode/uvicorn URL: https://github.com/encode/uvicorn
Source: https://github.com/encode/uvicorn/archive/%{version}.tar.gz#/uvicorn-%{version}.tar.gz Source: https://github.com/encode/uvicorn/archive/%{version}.tar.gz#/uvicorn-%{version}.tar.gz
# PATCH-FIX-UPSTREAM uvicorn-pr1537-no-watchgod-tests.patch gh#encode/uvicorn#1537
Patch1: https://github.com/encode/uvicorn/pull/1537.patch#/uvicorn-pr1537-no-watchgod-tests.patch
BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-click >= 7.0 Requires: python-click >= 7.0
@@ -39,7 +40,7 @@ Recommends: python-httptools >= 0.4.0
Recommends: python-websockets >= 8.0 Recommends: python-websockets >= 8.0
Suggests: python-uvloop >= 0.14.0 Suggests: python-uvloop >= 0.14.0
Suggests: python-watchfiles >= 0.13 Suggests: python-watchfiles >= 0.13
Suggests: python-wsproto >= 0.15.0 Suggests: python-wsproto >= 1.2.0
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun):update-alternatives Requires(postun):update-alternatives
BuildArch: noarch BuildArch: noarch
@@ -59,7 +60,7 @@ BuildRequires: %{python_module trustme}
BuildRequires: %{python_module typing_extensions if %python-base < 3.8} BuildRequires: %{python_module typing_extensions if %python-base < 3.8}
BuildRequires: %{python_module uvloop >= 0.14.0} BuildRequires: %{python_module uvloop >= 0.14.0}
BuildRequires: %{python_module websockets >= 8.0} BuildRequires: %{python_module websockets >= 8.0}
BuildRequires: %{python_module wsproto >= 0.15.0} BuildRequires: %{python_module wsproto >= 1.2.0}
# We don't want watchfiles in Ring1 # We don't want watchfiles in Ring1
#BuildRequires: #{python_module watchfiles >= 0.13} #BuildRequires: #{python_module watchfiles >= 0.13}
# /SECTION # /SECTION
@@ -74,10 +75,10 @@ It supports HTTP/1.1 and WebSockets only.
rm setup.cfg rm setup.cfg
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/uvicorn %python_clone -a %{buildroot}%{_bindir}/uvicorn
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}

View File

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

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

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

View File

@@ -1,91 +0,0 @@
From 5bd9a221116458b0922baeadc0a51ff02ac0b56b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Fri, 24 Jun 2022 07:43:33 +0200
Subject: [PATCH] Handle missing watchfiles and watchgod gracefully in tests
Skip the tests relying on watchfiles and watchgod reloaders when
the required dependencies are not available rather than causing
an ImportError. Since these packages are optional and watchfiles
does not support all the platforms that uvicorn used to work on so far,
it is useful to be able to run at least part of the test suite there.
---
tests/supervisors/test_reload.py | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/tests/supervisors/test_reload.py b/tests/supervisors/test_reload.py
index 04bfb41cf..6010d703b 100644
--- a/tests/supervisors/test_reload.py
+++ b/tests/supervisors/test_reload.py
@@ -2,7 +2,7 @@
import signal
from pathlib import Path
from time import sleep
-from typing import Type
+from typing import Optional, Type
import pytest
@@ -10,8 +10,16 @@
from uvicorn.config import Config
from uvicorn.supervisors.basereload import BaseReload, _display_path
from uvicorn.supervisors.statreload import StatReload
-from uvicorn.supervisors.watchfilesreload import WatchFilesReload
-from uvicorn.supervisors.watchgodreload import WatchGodReload
+
+try:
+ from uvicorn.supervisors.watchfilesreload import WatchFilesReload
+except ImportError: # pragma: no cover
+ WatchFilesReload = None
+
+try:
+ from uvicorn.supervisors.watchgodreload import WatchGodReload
+except ImportError: # pragma: no cover
+ WatchGodReload = None
def run(sockets):
@@ -23,8 +31,10 @@ class TestBaseReload:
def setup(
self,
reload_directory_structure: Path,
- reloader_class: Type[BaseReload],
+ reloader_class: Optional[Type[BaseReload]],
):
+ if reloader_class is None: # pragma: no cover
+ pytest.skip("Needed dependency not installed")
self.reload_path = reload_directory_structure
self.reloader_class = reloader_class
@@ -43,7 +53,7 @@ def _setup_reloader(self, config: Config) -> BaseReload:
def _reload_tester(self, touch_soon, reloader: BaseReload, *files: Path) -> bool:
reloader.restart()
- if isinstance(reloader, WatchFilesReload):
+ if WatchFilesReload is not None and isinstance(reloader, WatchFilesReload):
touch_soon(*files)
else:
assert not next(reloader)
@@ -240,6 +250,7 @@ def test_override_defaults(self, touch_soon) -> None:
reloader.shutdown()
+ @pytest.mark.skipif(WatchFilesReload is None, reason="watchfiles not available")
@pytest.mark.parametrize("reloader_class", [WatchFilesReload])
def test_watchfiles_no_changes(self) -> None:
sub_dir = self.reload_path / "app" / "sub"
@@ -296,6 +307,7 @@ def test_should_detect_new_reload_dirs(
reloader.shutdown()
+@pytest.mark.skipif(WatchFilesReload is None, reason="watchfiles not available")
def test_should_watch_one_dir_cwd(mocker, reload_directory_structure):
mock_watch = mocker.patch("uvicorn.supervisors.watchfilesreload.watch")
app_dir = reload_directory_structure / "app"
@@ -312,6 +324,7 @@ def test_should_watch_one_dir_cwd(mocker, reload_directory_structure):
assert mock_watch.call_args[0] == (Path.cwd(),)
+@pytest.mark.skipif(WatchFilesReload is None, reason="watchfiles not available")
def test_should_watch_separate_dirs_outside_cwd(mocker, reload_directory_structure):
mock_watch = mocker.patch("uvicorn.supervisors.watchfilesreload.watch")
app_dir = reload_directory_structure / "app"