#1 Update to 0.14.0
Closed 2 years ago by churchyard. Opened 2 years ago by lbalhar.
rpms/ lbalhar/python-uvicorn rawhide  into  rawhide

@@ -1,56 +0,0 @@ 

- From 737d25423ca6c865424598dd77c760b4c807b034 Mon Sep 17 00:00:00 2001

- From: euri10 <benoit.barthelet@gmail.com>

- 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

- 

file modified
+7 -5
@@ -19,15 +19,13 @@ 

  

  

  Name:           python-%{pkgname}

- Version:        0.13.4

- Release:        2%{?dist}

+ Version:        0.14.0

+ 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

  

  
@@ -41,7 +39,7 @@ 

  %if %{with tests}

  BuildRequires:  %{py3_dist pytest pytest-mock requests trustme httpx pytest-asyncio}

  # from minimal requirements

- BuildRequires:  %{py3_dist click h11}

+ BuildRequires:  %{py3_dist asgiref click h11}

  # from extra requirements

  BuildRequires:  %{py3_dist websockets wsproto httptools uvloop watchgod python-dotenv pyyaml}

  %endif
@@ -82,6 +80,10 @@ 

  

  

  %changelog

+ * Mon Jun 28 2021 Lumír Balhar <lbalhar@redhat.com> - 0.14.0-1

+ - Update to 0.14.0

+ Resolves: rhbz#1966531

+ 

  * Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.13.4-2

  - Rebuilt for Python 3.10

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (uvicorn-0.13.4.tar.gz) = 5332494e0b43b4e87f9d6742be679527b1ec2bc4d2e061768594d44b1fd1d6961a2bd1fa23469fca6c530ef36d6123e453306c2bb664cb27b0cd6145b9a70fd7

+ SHA512 (uvicorn-0.14.0.tar.gz) = f41a7f01ac6893ceaf4d1f06a4bccd7355e319eee11d6aa290b0d316fb356eb807c926941157ec64f1fc6b7c4601930cfbe271075d6c4cf684bd7e175617390f

This version is compatible with click 8 we are gonna update in: https://src.fedoraproject.org/rpms/python-click/pull-request/10

Unfortunately, this cannot be built and tested because python-wsproto still does not build with Python 3.10.

I believe this line needs a hyphen at the beginning of it to be a valid changelog entry. Or combine it with the previous line.

The hyphen is just a convention. This is a free form text-field for RPM. This hyphen-less way of writing it is quite common for my RHEL colleagues, albeit I have no idea where it originated. Maybe it was required for some checks in the past. Many existing Fedora packages use this form (sudo, systemd, dracut, Pythons).

This pull request should also delete the 0001-Up-wsproto-to-1.0.0.patch file, which is included upstream now.

This new version also brings in a build requirement on asgiref.

rebased onto 3d9d34a

2 years ago

Patch removed, asigref added. I'm not using the hyphen in the changelog because the second line is related to the first one and does not represent an independent record. But it's just a point of view and I can of course change it if you want.

Wsproto is available in rawhide now but it seems that uvicorn itself is not yet compatible with Python 3.10. Upstream PR: https://github.com/encode/uvicorn/pull/1070

This is also going to need websockets 9.1 and httptools 0.2. I've taken care of the former. The latter is going to need llhttp packaged up.

Updating to 0.15.0:

  • also hangs
  • some tests fail with TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary and similar from site-packages/websockets/legacy/protocol.py -- fixed in https://github.com/aaugustin/websockets/pull/936 released as 10.0 and stops the hanging
  • requires a weird version of httptools
  - nothing provides (python3.10dist(httptools) >= 0.2 with python3.10dist(httptools) < 0.3) needed by python3-uvicorn+standard-0.15.0-1.fc36.noarch

I..e the version in https://bugzilla.redhat.com/show_bug.cgi?id=2002817 is too new.

Long story short: This upgrade is not needed for Python 3.10 rebuild, fixing websockets is needed.

Upgrade to 0.15 is however needed for other reasons. @thrnciar and I are working on this. We will update:

  • websockets
  • httptools
  • uvicorn

And adapt falcon to build.

Pull-Request has been closed by churchyard

2 years ago