From b300c5717ec5fb294071e26842f677c2202e9861 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Oct 08 2021 13:20:50 +0000 Subject: Update to 0.69.0 --- diff --git a/.gitignore b/.gitignore index c7d4087..3dba223 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /fastapi-0.68.0.tar.gz /fastapi-0.68.1.tar.gz /fastapi-0.68.2.tar.gz +/fastapi-0.69.0.tar.gz diff --git a/3594.patch b/3594.patch deleted file mode 100644 index 10f75e7..0000000 --- a/3594.patch +++ /dev/null @@ -1,79 +0,0 @@ -From e9f70125aa27988d1d80769707f9759164ebb541 Mon Sep 17 00:00:00 2001 -From: AlonMenczer -Date: Fri, 23 Jul 2021 15:02:28 +0300 -Subject: [PATCH 1/2] Update starlette version - ---- - pyproject.toml | 2 +- - tests/test_tutorial/test_websockets/test_tutorial002.py | 8 ++++++-- - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 45880cc313..48e93ca7b9 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -32,7 +32,7 @@ classifiers = [ - "Topic :: Internet :: WWW/HTTP", - ] - requires = [ -- "starlette ==0.14.2", -+ "starlette ==0.16.0", - "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0" - ] - description-file = "README.md" -diff --git a/tests/test_tutorial/test_websockets/test_tutorial002.py b/tests/test_tutorial/test_websockets/test_tutorial002.py -index 7c56eb2605..27ad6cd159 100644 ---- a/tests/test_tutorial/test_websockets/test_tutorial002.py -+++ b/tests/test_tutorial/test_websockets/test_tutorial002.py -@@ -72,9 +72,13 @@ def test_websocket_with_header_and_query(): - - def test_websocket_no_credentials(): - with pytest.raises(WebSocketDisconnect): -- client.websocket_connect("/items/foo/ws") -+ with client.websocket_connect("/items/foo/ws") as websocket: # noqa: F841 -+ pass - - - def test_websocket_invalid_data(): - with pytest.raises(WebSocketDisconnect): -- client.websocket_connect("/items/foo/ws?q=bar&token=some-token") -+ with client.websocket_connect( -+ "/items/foo/ws?q=bar&token=some-token" -+ ) as websocket: # noqa: F841 -+ pass - -From ed70ca625774b93e342f0198f0ea353a3bde2af4 Mon Sep 17 00:00:00 2001 -From: AlonMenczer -Date: Fri, 23 Jul 2021 15:13:50 +0300 -Subject: [PATCH 2/2] Use same test fix from PR #3372 - ---- - .../test_websockets/test_tutorial002.py | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - -diff --git a/tests/test_tutorial/test_websockets/test_tutorial002.py b/tests/test_tutorial/test_websockets/test_tutorial002.py -index 27ad6cd159..a8523c9c4f 100644 ---- a/tests/test_tutorial/test_websockets/test_tutorial002.py -+++ b/tests/test_tutorial/test_websockets/test_tutorial002.py -@@ -72,13 +72,15 @@ def test_websocket_with_header_and_query(): - - def test_websocket_no_credentials(): - with pytest.raises(WebSocketDisconnect): -- with client.websocket_connect("/items/foo/ws") as websocket: # noqa: F841 -- pass -+ with client.websocket_connect("/items/foo/ws"): -+ pytest.fail( -+ "did not raise WebSocketDisconnect on __enter__" -+ ) # pragma: no cover - - - def test_websocket_invalid_data(): - with pytest.raises(WebSocketDisconnect): -- with client.websocket_connect( -- "/items/foo/ws?q=bar&token=some-token" -- ) as websocket: # noqa: F841 -- pass -+ with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"): -+ pytest.fail( -+ "did not raise WebSocketDisconnect on __enter__" -+ ) # pragma: no cover diff --git a/python-fastapi.spec b/python-fastapi.spec index fdff64a..adafcbe 100644 --- a/python-fastapi.spec +++ b/python-fastapi.spec @@ -24,7 +24,7 @@ %global sum_zh FastAPI 框架 Name: python-fastapi -Version: 0.68.2 +Version: 0.69.0 Release: %autorelease Summary: %{sum_en} @@ -33,16 +33,12 @@ URL: https://github.com/tiangolo/fastapi Source0: %{url}/archive/%{version}/fastapi-%{version}.tar.gz BuildArch: noarch -# PR for later starlette support -# https://github.com/tiangolo/fastapi/pull/3594 -Patch0: https://github.com/tiangolo/fastapi/pull/3594.patch - # A tiny difference in the OpenAPI schema in one test is not easily explained. # Since we are using quite a few dependencies at different versions than those # pinned upstream, it’s also hard to make a useful upstream bug report. For # now, we just patch the expected schema downstream. The difference is # trivial—just an added default value. -Patch1: fastapi-0.67.0-openapi-schema.patch +Patch0: fastapi-0.67.0-openapi-schema.patch BuildRequires: python3-devel @@ -298,6 +294,12 @@ Summary(zh): %{sum_zh} %prep %autosetup -n fastapi-%{version} -p1 +%if 0%{?fedora} == 35 || 0%{?fedora} == 36 +# https://src.fedoraproject.org/rpms/python-anyio/pull-request/2 +# Workaround: replace anyio[trio] with anyio and a separate trio dependency +sed -r -i 's/^([[:blank:]]*)"(anyio)\[(trio)\]([^"]+)",$/\1"\2\4",\n\1"\3",/' \ + pyproject.toml +%endif # Comment out all dependencies on orjson (for ORJSONResponse); it cannot be # packaged in Fedora until it builds with the stable Rust toolchain instead of # the nightly one. Note that this removes it from the “all” extra metapackage. @@ -316,7 +318,7 @@ sed -r -i 's/("types-(u|or)json\b.*",)/# \1/' pyproject.toml # versions… # • flask, itsdangerous, jinja: https://github.com/tiangolo/fastapi/issues/3512 sed -r -i \ - 's/("(httpx\b|sqlalchemy\b|databases\[sqlite\]|pytest|'\ + 's/("(httpx\b|'\ 'flask|itsdangerous|jinja2)'\ '[^<"]*),[[:blank:]]*<[^"]*/\1/' \ pyproject.toml @@ -324,7 +326,8 @@ sed -r -i \ # versions. This could have unwanted consequences, but such is the nature of # packaging. # • ujson: https://bugzilla.redhat.com/show_bug.cgi?id=1862763 -sed -r -i 's/("(ujson))\b[^"]*/\1/' pyproject.toml +# • anyio: F35 has 3.2.0 instead of 3.2.1+ +sed -r -i 's/("(ujson%{?fc35:|anyio\b}))\b[^"]*/\1/' pyproject.toml # Remove bundled js-termynal 0.0.1; since we are not building documentation, we # do this very bluntly: diff --git a/sources b/sources index 8174d26..ad18317 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fastapi-0.68.2.tar.gz) = df0afb58b8726eccb5ba5c4d3292ccfea2e08956038a6a78a6392562a11ff40a757f1be22ffcac733072398fa0ff6f86a9f06d39330a498bd98dc8c6c2d52b82 +SHA512 (fastapi-0.69.0.tar.gz) = dd9cb4f7a97e254cefcedc87724a85b30c42540c30a96a24fa7b29a25daa05614b5ff5478f801bbb03a451a3aea95a8ec44ae6e42978add13b19d8b745f08291