Updating link to change in openSUSE:Factory/python-fastapi revision 10

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=a91dbb8656ed41e525162f2ba9c988a0
This commit is contained in:
OBS User buildservice-autocommit 2023-01-05 16:11:42 +00:00 committed by Git OBS Bridge
parent 3752782d32
commit ae7792c2b8
3 changed files with 52 additions and 65 deletions

View File

@ -1,21 +0,0 @@
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"

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Jan 4 18:18:58 UTC 2023 - Ben Greiner <code@bnavigator.de>
- 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 <david.anes@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-fastapi
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,24 +16,8 @@
#
#
# 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-%{**}}
# Keep extra test requirements out of Ring1
%bcond_with ringdisabled
Name: python-fastapi
Version: 0.88.0
Release: 0
@ -42,34 +26,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
Patch0: python-fastapi-disable-broken-tests.patch
BuildRequires: %{python_module flit}
BuildRequires: %{python_module hatchling}
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.0.0
Requires: python-starlette >= 0.21.0
Requires: python-pydantic >= 1.8.2
Requires: python-starlette >= 0.22.0
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module Flask >= 1.1.2}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module PyYAML >= 5.3.1}
BuildRequires: %{python_module SQLAlchemy >= 1.3.18}
BuildRequires: %{python_module aiosqlite}
BuildRequires: %{python_module anyio >= 3.2.1}
BuildRequires: %{python_module databases}
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 email-validator >= 1.1.1}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module httpx >= 0.14.0}
BuildRequires: %{python_module orjson}
BuildRequires: %{python_module orjson >= 3.2.1}
BuildRequires: %{python_module passlib}
BuildRequires: %{python_module peewee >= 3.13.0}
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}
BuildRequires: %{python_module python-jose >= 3.3}
BuildRequires: %{python_module ujson >= 5.2}
%endif
# /SECTION
%python_subpackages
@ -77,11 +61,7 @@ BuildRequires: %{python_module trio}
Python FastAPI framework.
%prep
%setup -q -n fastapi-%{version}
%autopatch -p1
# Requires orjson
rm tests/test_default_response_class.py
%autosetup -p1 -n fastapi-%{version}
%build
%pyproject_wheel
@ -91,12 +71,27 @@ rm tests/test_default_response_class.py
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# These two tests require orjson
%pytest -rs -W ignore::DeprecationWarning -k 'not (test_get_custom_response and (test_tutorial001 or test_tutorial001b))' tests
# 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
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/*fastapi*/
%{python_sitelib}/fastapi
%{python_sitelib}/fastapi-%{version}.dist-info
%changelog