From 6d87ca1bf957b5b312cd81f2ef8a8e2f9425b446 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Sep 11 2021 11:25:25 +0000 Subject: Import python-uvicorn-0.13.4-1.el9 in CloudSIG xena --- diff --git a/.python-uvicorn.metadata b/.python-uvicorn.metadata new file mode 100644 index 0000000..2a22e6f --- /dev/null +++ b/.python-uvicorn.metadata @@ -0,0 +1 @@ +d931eaa1373bbe3f5e82bcd069af2e4ce4127cb6 SOURCES/uvicorn-0.13.4.tar.gz diff --git a/SOURCES/0001-Up-wsproto-to-1.0.0.patch b/SOURCES/0001-Up-wsproto-to-1.0.0.patch new file mode 100644 index 0000000..3dae717 --- /dev/null +++ b/SOURCES/0001-Up-wsproto-to-1.0.0.patch @@ -0,0 +1,56 @@ +From 737d25423ca6c865424598dd77c760b4c807b034 Mon Sep 17 00:00:00 2001 +From: euri10 +Date: Sun, 13 Dec 2020 14:24:12 +0100 +Subject: [PATCH] Up wsproto to 1.0.0 + +--- + requirements.txt | 2 +- + tests/protocols/test_http.py | 1 + + tests/protocols/test_websocket.py | 6 +++++- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/requirements.txt b/requirements.txt +index a739e05..bcc6b7d 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,7 +1,7 @@ + -e .[standard] + + # Explicit optionals +-wsproto==0.15.* ++wsproto==1.0.* + + # Packaging + twine +diff --git a/tests/protocols/test_http.py b/tests/protocols/test_http.py +index f35a965..25110fc 100644 +--- a/tests/protocols/test_http.py ++++ b/tests/protocols/test_http.py +@@ -67,6 +67,7 @@ UPGRADE_REQUEST = b"\r\n".join( + b"Host: example.org", + b"Connection: upgrade", + b"Upgrade: websocket", ++ b"Sec-WebSocket-Version: 11", + b"", + b"", + ] +diff --git a/tests/protocols/test_websocket.py b/tests/protocols/test_websocket.py +index 24bc285..7c3fcc0 100644 +--- a/tests/protocols/test_websocket.py ++++ b/tests/protocols/test_websocket.py +@@ -51,7 +51,11 @@ async def test_invalid_upgrade(protocol_cls): + async with httpx.AsyncClient() as client: + response = await client.get( + "http://127.0.0.1:8000", +- headers={"upgrade": "websocket", "connection": "upgrade"}, ++ headers={ ++ "upgrade": "websocket", ++ "connection": "upgrade", ++ "sec-webSocket-version": "11", ++ }, + timeout=5, + ) + if response.status_code == 426: +-- +2.29.2 + diff --git a/SPECS/python-uvicorn.spec b/SPECS/python-uvicorn.spec new file mode 100644 index 0000000..03bbed7 --- /dev/null +++ b/SPECS/python-uvicorn.spec @@ -0,0 +1,103 @@ +# what it's called on pypi +%global srcname uvicorn +# what it's imported as +%global libname %{srcname} +# name of egg info directory +%global eggname %{srcname} +# package name fragment +%global pkgname %{srcname} + +%global common_description %{expand: +Uvicorn is a lightning-fast ASGI server implementation, using uvloop and +httptools. Until recently Python has lacked a minimal low-level +server/application interface for asyncio frameworks. The ASGI specification +fills this gap, and means we are now able to start building a common set of +tooling usable across all asyncio frameworks. Uvicorn currently supports +HTTP/1.1 and WebSockets. Support for HTTP/2 is planned.} + +%bcond_without tests + + +Name: python-%{pkgname} +Version: 0.13.4 +Release: 1%{?dist} +Summary: The lightning-fast ASGI server +License: BSD +URL: https://www.uvicorn.org +# PyPI tarball doesn't have tests +Source0: https://github.com/encode/uvicorn/archive/%{version}/%{srcname}-%{version}.tar.gz +# https://github.com/encode/uvicorn/pull/892 +Patch0: 0001-Up-wsproto-to-1.0.0.patch +BuildArch: noarch + + +%description %{common_description} + + +%package -n python3-%{pkgname} +Summary: %{summary} +BuildRequires: python3-devel +BuildRequires: %{py3_dist setuptools} +%if %{with tests} +BuildRequires: %{py3_dist pytest pytest-mock requests trustme httpx pytest-asyncio} +# from minimal requirements +BuildRequires: %{py3_dist click h11} +# from extra requirements +BuildRequires: %{py3_dist websockets wsproto httptools uvloop watchgod python-dotenv pyyaml} +%endif +%{?python_provide:%python_provide python3-%{pkgname}} + + +%description -n python3-%{pkgname} %{common_description} + + +%{?python_extras_subpkg:%python_extras_subpkg -n python3-%{pkgname} -i %{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info standard} + + +%prep +%autosetup -n %{srcname}-%{version} -p 1 +rm -rf %{eggname}.egg-info + + +%build +%py3_build + + +%install +%py3_install + + +%if %{with tests} +%check +%pytest --verbose +%endif + + +%files -n python3-%{pkgname} +%license LICENSE.md +%doc README.md +%{_bindir}/uvicorn +%{python3_sitelib}/%{libname} +%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info + + +%changelog +* Sat Mar 20 2021 Carl George - 0.13.4-1 +- Latest upstream +- Fixes: rhbz#1940231 + +* Fri Feb 05 2021 Carl George - 0.13.3-1 +- Latest upstream + +* Wed Jan 27 2021 Fedora Release Engineering - 0.12.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Nov 09 2020 Carl George - 0.12.2-1 +- Latest upstream +- Add uvicorn[standard] subpackage + +* Tue Aug 18 2020 Carl George - 0.11.8-1 +- Latest upstream + +* Thu Jun 04 2020 Carl George - 0.11.5-1 +- Initial package