From 3752782d3250f4ff16e04d81113e885ae852e525b3acfdefb7fbec9fa21fd620 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 5 Jan 2023 16:11:42 +0000 Subject: [PATCH] Accepting request 1056201 from devel:languages:python baserev update by copy to link target OBS-URL: https://build.opensuse.org/request/show/1056201 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=21 --- python-fastapi-disable-broken-tests.patch | 21 ++++++ python-fastapi.changes | 13 ---- python-fastapi.spec | 83 ++++++++++++----------- 3 files changed, 65 insertions(+), 52 deletions(-) create mode 100644 python-fastapi-disable-broken-tests.patch diff --git a/python-fastapi-disable-broken-tests.patch b/python-fastapi-disable-broken-tests.patch new file mode 100644 index 0000000..00411b9 --- /dev/null +++ b/python-fastapi-disable-broken-tests.patch @@ -0,0 +1,21 @@ +Index: fastapi-0.88.0/tests/test_generate_unique_id_function.py +=================================================================== +--- fastapi-0.88.0.orig/tests/test_generate_unique_id_function.py ++++ fastapi-0.88.0/tests/test_generate_unique_id_function.py +@@ -6,6 +6,8 @@ from fastapi.routing import APIRoute + from fastapi.testclient import TestClient + from pydantic import BaseModel + ++import pytest ++ + + def custom_generate_unique_id(route: APIRoute): + return f"foo_{route.name}" +@@ -1604,6 +1606,7 @@ def test_callback_override_generate_uniq + } + + ++@pytest.mark.skip(reason="failing with current sqlalchemy version") + def test_warn_duplicate_operation_id(): + def broken_operation_id(route: APIRoute): + return "foo" diff --git a/python-fastapi.changes b/python-fastapi.changes index d29d5b9..00df7a3 100644 --- a/python-fastapi.changes +++ b/python-fastapi.changes @@ -1,16 +1,3 @@ -------------------------------------------------------------------- -Wed Jan 4 18:18:58 UTC 2023 - Ben Greiner - -- Remove flit from build requirements: The real used backend - is hatchling -- Clean up specfile - * remove duplicate copyright header - * remove catchall in files section -- Drop python-fastapi-disable-broken-tests.patch -- Prune the test suite when run in lettered staging projects: - python-mocket pulls this into Ring1. Let's make it as painless as - possible. - ------------------------------------------------------------------- Mon Nov 14 09:12:12 UTC 2022 - David Anes diff --git a/python-fastapi.spec b/python-fastapi.spec index e38feed..5a15670 100644 --- a/python-fastapi.spec +++ b/python-fastapi.spec @@ -1,7 +1,7 @@ # # spec file for package python-fastapi # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,8 +16,24 @@ # -# Keep extra test requirements out of Ring1 -%bcond_with ringdisabled +# +# spec file for package python-fastapi +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-fastapi Version: 0.88.0 Release: 0 @@ -26,34 +42,34 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/tiangolo/fastapi Source: https://files.pythonhosted.org/packages/source/f/fastapi/fastapi-%{version}.tar.gz -BuildRequires: %{python_module hatchling} +Patch0: python-fastapi-disable-broken-tests.patch +BuildRequires: %{python_module flit} BuildRequires: %{python_module pip} -BuildRequires: %{python_module pydantic >= 1.8.2} -BuildRequires: %{python_module starlette >= 0.22.0} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-pydantic >= 1.8.2 -Requires: python-starlette >= 0.22.0 +Requires: python-pydantic >= 1.0.0 +Requires: python-starlette >= 0.21.0 BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module pytest} BuildRequires: %{python_module Flask >= 1.1.2} -BuildRequires: %{python_module PyYAML >= 5.3.1} +BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module SQLAlchemy >= 1.3.18} -BuildRequires: %{python_module anyio >= 3.2.1} -BuildRequires: %{python_module httpx >= 0.23.0} -BuildRequires: %{python_module python-multipart >= 0.0.5} -BuildRequires: %{python_module trio} -%if !%{with ringdisabled} BuildRequires: %{python_module aiosqlite} -BuildRequires: %{python_module databases >= 0.3.2} +BuildRequires: %{python_module anyio >= 3.2.1} +BuildRequires: %{python_module databases} BuildRequires: %{python_module email-validator >= 1.1.1} -BuildRequires: %{python_module orjson >= 3.2.1} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module httpx >= 0.14.0} +BuildRequires: %{python_module orjson} BuildRequires: %{python_module passlib} BuildRequires: %{python_module peewee >= 3.13.0} -BuildRequires: %{python_module python-jose >= 3.3} -BuildRequires: %{python_module ujson >= 5.2} -%endif +BuildRequires: %{python_module pydantic >= 1.0.0} +BuildRequires: %{python_module pytest >= 5.4.3} +BuildRequires: %{python_module python-jose} +BuildRequires: %{python_module python-multipart >= 0.0.5} +BuildRequires: %{python_module requests >= 2.24.0} +BuildRequires: %{python_module starlette >= 0.22.0} +BuildRequires: %{python_module trio} # /SECTION %python_subpackages @@ -61,7 +77,11 @@ BuildRequires: %{python_module ujson >= 5.2} Python FastAPI framework. %prep -%autosetup -p1 -n fastapi-%{version} +%setup -q -n fastapi-%{version} +%autopatch -p1 + +# Requires orjson +rm tests/test_default_response_class.py %build %pyproject_wheel @@ -71,27 +91,12 @@ Python FastAPI framework. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# more warnings as expected -donttest="test_warn_duplicate_operation_id" -%if %{with ringdisabled} -ignorefiles="$ignorefiles --ignore tests/test_default_response_class.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_async_sql_databases/test_tutorial001.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_custom_response/test_tutorial009c.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_response_model/test_tutorial003.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_response_model/test_tutorial003_py310.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_security/test_tutorial005.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_security/test_tutorial005_py39.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_security/test_tutorial005_py310.py" -ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_sql_databases_peewee" -donttest="$donttest or test_orjson_response_class" -donttest="$donttest or (test_tutorial001 and test_get_custom_response)" -%endif -%pytest -W ignore::DeprecationWarning $ignorefiles -k "not ($donttest)" tests +# These two tests require orjson +%pytest -rs -W ignore::DeprecationWarning -k 'not (test_get_custom_response and (test_tutorial001 or test_tutorial001b))' tests %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/fastapi -%{python_sitelib}/fastapi-%{version}.dist-info +%{python_sitelib}/*fastapi*/ %changelog