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
This commit is contained in:
parent
58ff790b34
commit
3752782d32
21
python-fastapi-disable-broken-tests.patch
Normal file
21
python-fastapi-disable-broken-tests.patch
Normal file
@ -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"
|
@ -1,16 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
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>
|
Mon Nov 14 09:12:12 UTC 2022 - David Anes <david.anes@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-fastapi
|
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# 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
|
Name: python-fastapi
|
||||||
Version: 0.88.0
|
Version: 0.88.0
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -26,34 +42,34 @@ License: MIT
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/tiangolo/fastapi
|
URL: https://github.com/tiangolo/fastapi
|
||||||
Source: https://files.pythonhosted.org/packages/source/f/fastapi/fastapi-%{version}.tar.gz
|
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 pip}
|
||||||
BuildRequires: %{python_module pydantic >= 1.8.2}
|
|
||||||
BuildRequires: %{python_module starlette >= 0.22.0}
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-pydantic >= 1.8.2
|
Requires: python-pydantic >= 1.0.0
|
||||||
Requires: python-starlette >= 0.22.0
|
Requires: python-starlette >= 0.21.0
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module pytest}
|
|
||||||
BuildRequires: %{python_module Flask >= 1.1.2}
|
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 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 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 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 passlib}
|
||||||
BuildRequires: %{python_module peewee >= 3.13.0}
|
BuildRequires: %{python_module peewee >= 3.13.0}
|
||||||
BuildRequires: %{python_module python-jose >= 3.3}
|
BuildRequires: %{python_module pydantic >= 1.0.0}
|
||||||
BuildRequires: %{python_module ujson >= 5.2}
|
BuildRequires: %{python_module pytest >= 5.4.3}
|
||||||
%endif
|
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
|
# /SECTION
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@ -61,7 +77,11 @@ BuildRequires: %{python_module ujson >= 5.2}
|
|||||||
Python FastAPI framework.
|
Python FastAPI framework.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n fastapi-%{version}
|
%setup -q -n fastapi-%{version}
|
||||||
|
%autopatch -p1
|
||||||
|
|
||||||
|
# Requires orjson
|
||||||
|
rm tests/test_default_response_class.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
@ -71,27 +91,12 @@ Python FastAPI framework.
|
|||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# more warnings as expected
|
# These two tests require orjson
|
||||||
donttest="test_warn_duplicate_operation_id"
|
%pytest -rs -W ignore::DeprecationWarning -k 'not (test_get_custom_response and (test_tutorial001 or test_tutorial001b))' tests
|
||||||
%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}
|
%files %{python_files}
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python_sitelib}/fastapi
|
%{python_sitelib}/*fastapi*/
|
||||||
%{python_sitelib}/fastapi-%{version}.dist-info
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user