python-fastapi/python-fastapi.spec

137 lines
6.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-fastapi
#
- Update to 0.115.8 * Fix `OAuth2PasswordRequestForm` and `OAuth2PasswordRequestFormStrict` fixed `grant_type` "password" RegEx. * Simplify tests for body_multiple_params. * Move duplicated code portion to a static method in the `APIKeyBase` super class. * Simplify tests for request_files. * Change the word "unwrap" to "unpack" in `docs/en/docs/tutorial/extra-models.md`. * Update Request Body's `tutorial002` to deal with `tax=0` case. * Update FastAPI People - Experts. * Add Japanese translation for `docs/ja/docs/environment-variables.md`. * Add Russian translation for `docs/ru/docs/advanced/async-tests.md`. * Update Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. * Add Russian translation for `docs/ru/docs/tutorial/bigger-applications.md`. * Add support for Python 3.13. * Upgrade AnyIO max version for tests, new range: `>=3.2.1,<5.0.0`. * Update Sponsors badges. * Fix `notify_translations.py` empty env var handling for PR label events vs workflow_dispatch. * Refactor and move `scripts/notify_translations.py`, no need for a custom GitHub Action. * Update FastAPI People Experts script, refactor and optimize data fetching to handle rate limits. * Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. - from version 0.115.7 * Upgrade `python-multipart` to >=0.0.18. * Bump Starlette to allow up to 0.45.0: `>=0.40.0,<0.46.0`. * Upgrade `jinja2` to >=3.1.5. * Simplify tests for websockets. * Simplify tests for request_form_models. * Simplify tests for separate_openapi_schemas. * Simplify tests for security. * Simplify tests for schema_extra_example. * Simplify tests for request_model. * Simplify tests for request_forms_and_files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=88
2025-02-07 13:03:04 +00:00
# Copyright (c) 2025 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/
#
# Keep extra test requirements out of Ring1
%bcond_with ringdisabled
%{?sle15_python_module_pythons}
Name: python-fastapi
- Update to 0.115.8 * Fix `OAuth2PasswordRequestForm` and `OAuth2PasswordRequestFormStrict` fixed `grant_type` "password" RegEx. * Simplify tests for body_multiple_params. * Move duplicated code portion to a static method in the `APIKeyBase` super class. * Simplify tests for request_files. * Change the word "unwrap" to "unpack" in `docs/en/docs/tutorial/extra-models.md`. * Update Request Body's `tutorial002` to deal with `tax=0` case. * Update FastAPI People - Experts. * Add Japanese translation for `docs/ja/docs/environment-variables.md`. * Add Russian translation for `docs/ru/docs/advanced/async-tests.md`. * Update Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. * Add Russian translation for `docs/ru/docs/tutorial/bigger-applications.md`. * Add support for Python 3.13. * Upgrade AnyIO max version for tests, new range: `>=3.2.1,<5.0.0`. * Update Sponsors badges. * Fix `notify_translations.py` empty env var handling for PR label events vs workflow_dispatch. * Refactor and move `scripts/notify_translations.py`, no need for a custom GitHub Action. * Update FastAPI People Experts script, refactor and optimize data fetching to handle rate limits. * Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. - from version 0.115.7 * Upgrade `python-multipart` to >=0.0.18. * Bump Starlette to allow up to 0.45.0: `>=0.40.0,<0.46.0`. * Upgrade `jinja2` to >=3.1.5. * Simplify tests for websockets. * Simplify tests for request_form_models. * Simplify tests for separate_openapi_schemas. * Simplify tests for security. * Simplify tests for schema_extra_example. * Simplify tests for request_model. * Simplify tests for request_forms_and_files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=88
2025-02-07 13:03:04 +00:00
Version: 0.115.8
Release: 0
Summary: FastAPI framework
License: MIT
URL: https://github.com/tiangolo/fastapi
Source: https://files.pythonhosted.org/packages/source/f/fastapi/fastapi-%{version}.tar.gz
# PATCH-FIX-OPENSUSE Remove two unknown classifiers
Patch0: remove-classifiers.patch
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pydantic-settings >= 2.0.0}
- Update to 0.115.8 * Fix `OAuth2PasswordRequestForm` and `OAuth2PasswordRequestFormStrict` fixed `grant_type` "password" RegEx. * Simplify tests for body_multiple_params. * Move duplicated code portion to a static method in the `APIKeyBase` super class. * Simplify tests for request_files. * Change the word "unwrap" to "unpack" in `docs/en/docs/tutorial/extra-models.md`. * Update Request Body's `tutorial002` to deal with `tax=0` case. * Update FastAPI People - Experts. * Add Japanese translation for `docs/ja/docs/environment-variables.md`. * Add Russian translation for `docs/ru/docs/advanced/async-tests.md`. * Update Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. * Add Russian translation for `docs/ru/docs/tutorial/bigger-applications.md`. * Add support for Python 3.13. * Upgrade AnyIO max version for tests, new range: `>=3.2.1,<5.0.0`. * Update Sponsors badges. * Fix `notify_translations.py` empty env var handling for PR label events vs workflow_dispatch. * Refactor and move `scripts/notify_translations.py`, no need for a custom GitHub Action. * Update FastAPI People Experts script, refactor and optimize data fetching to handle rate limits. * Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. - from version 0.115.7 * Upgrade `python-multipart` to >=0.0.18. * Bump Starlette to allow up to 0.45.0: `>=0.40.0,<0.46.0`. * Upgrade `jinja2` to >=3.1.5. * Simplify tests for websockets. * Simplify tests for request_form_models. * Simplify tests for separate_openapi_schemas. * Simplify tests for security. * Simplify tests for schema_extra_example. * Simplify tests for request_model. * Simplify tests for request_forms_and_files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=88
2025-02-07 13:03:04 +00:00
BuildRequires: %{python_module starlette >= 0.40.0 with %python-starlette < 0.46.0}
BuildRequires: %{python_module typing_extensions >= 4.8.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pydantic >= 1.8.2
Requires: python-typing_extensions >= 4.8.0
- Update to 0.115.8 * Fix `OAuth2PasswordRequestForm` and `OAuth2PasswordRequestFormStrict` fixed `grant_type` "password" RegEx. * Simplify tests for body_multiple_params. * Move duplicated code portion to a static method in the `APIKeyBase` super class. * Simplify tests for request_files. * Change the word "unwrap" to "unpack" in `docs/en/docs/tutorial/extra-models.md`. * Update Request Body's `tutorial002` to deal with `tax=0` case. * Update FastAPI People - Experts. * Add Japanese translation for `docs/ja/docs/environment-variables.md`. * Add Russian translation for `docs/ru/docs/advanced/async-tests.md`. * Update Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. * Add Russian translation for `docs/ru/docs/tutorial/bigger-applications.md`. * Add support for Python 3.13. * Upgrade AnyIO max version for tests, new range: `>=3.2.1,<5.0.0`. * Update Sponsors badges. * Fix `notify_translations.py` empty env var handling for PR label events vs workflow_dispatch. * Refactor and move `scripts/notify_translations.py`, no need for a custom GitHub Action. * Update FastAPI People Experts script, refactor and optimize data fetching to handle rate limits. * Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. - from version 0.115.7 * Upgrade `python-multipart` to >=0.0.18. * Bump Starlette to allow up to 0.45.0: `>=0.40.0,<0.46.0`. * Upgrade `jinja2` to >=3.1.5. * Simplify tests for websockets. * Simplify tests for request_form_models. * Simplify tests for separate_openapi_schemas. * Simplify tests for security. * Simplify tests for schema_extra_example. * Simplify tests for request_model. * Simplify tests for request_forms_and_files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=88
2025-02-07 13:03:04 +00:00
Requires: (python-starlette >= 0.40.0 with python-starlette < 0.46.0)
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module pdm-backend}
BuildRequires: %{python_module Flask >= 1.1.2}
BuildRequires: %{python_module PyJWT}
BuildRequires: %{python_module PyYAML >= 5.3.1}
BuildRequires: %{python_module SQLAlchemy}
BuildRequires: %{python_module anyio >= 3.2.1}
BuildRequires: %{python_module coverage}
BuildRequires: %{python_module dirty-equals}
BuildRequires: %{python_module httpx >= 0.23.0}
BuildRequires: %{python_module pytest}
- Update to 0.115.8 * Fix `OAuth2PasswordRequestForm` and `OAuth2PasswordRequestFormStrict` fixed `grant_type` "password" RegEx. * Simplify tests for body_multiple_params. * Move duplicated code portion to a static method in the `APIKeyBase` super class. * Simplify tests for request_files. * Change the word "unwrap" to "unpack" in `docs/en/docs/tutorial/extra-models.md`. * Update Request Body's `tutorial002` to deal with `tax=0` case. * Update FastAPI People - Experts. * Add Japanese translation for `docs/ja/docs/environment-variables.md`. * Add Russian translation for `docs/ru/docs/advanced/async-tests.md`. * Update Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. * Add Russian translation for `docs/ru/docs/tutorial/bigger-applications.md`. * Add support for Python 3.13. * Upgrade AnyIO max version for tests, new range: `>=3.2.1,<5.0.0`. * Update Sponsors badges. * Fix `notify_translations.py` empty env var handling for PR label events vs workflow_dispatch. * Refactor and move `scripts/notify_translations.py`, no need for a custom GitHub Action. * Update FastAPI People Experts script, refactor and optimize data fetching to handle rate limits. * Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. - from version 0.115.7 * Upgrade `python-multipart` to >=0.0.18. * Bump Starlette to allow up to 0.45.0: `>=0.40.0,<0.46.0`. * Upgrade `jinja2` to >=3.1.5. * Simplify tests for websockets. * Simplify tests for request_form_models. * Simplify tests for separate_openapi_schemas. * Simplify tests for security. * Simplify tests for schema_extra_example. * Simplify tests for request_model. * Simplify tests for request_forms_and_files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=88
2025-02-07 13:03:04 +00:00
BuildRequires: %{python_module python-multipart >= 0.0.18}
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 inline-snapshot}
BuildRequires: %{python_module orjson >= 3.2.1}
BuildRequires: %{python_module passlib}
BuildRequires: %{python_module peewee >= 3.13.0}
BuildRequires: %{python_module python-jose >= 3.3}
BuildRequires: %{python_module sqlmodel}
BuildRequires: %{python_module ujson >= 5.6}
%endif
# /SECTION
%python_subpackages
%description
Python FastAPI framework.
%prep
%autosetup -p1 -n fastapi-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}/%{_bindir}/fastapi
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# more warnings as expected
donttest="test_warn_duplicate_operation_id"
# fails because of changed (cosmetic) body format in httpx 0.28 (technically not suppoerted yet upstream)
donttest+=" or test_exception_handler_body_access"
# python-fastapi-cli packages doesn't exists in openSUSE
donttest+=" or test_fastapi_cli"
donttest+=" or test_openapi"
%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_cookie_param_models/test_tutorial001.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_cookie_param_models/test_tutorial002.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_header_param_models/test_tutorial001.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_header_param_models/test_tutorial002.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_query_param_models/test_tutorial001.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_query_param_models/test_tutorial002.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_security/test_tutorial005_an.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_security/test_tutorial005_an_py39.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_security/test_tutorial005_an_py310.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_sql_databases/test_tutorial001.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_sql_databases/test_tutorial002.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_sql_databases_peewee"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_response_model/test_tutorial003_01.py"
ignorefiles="$ignorefiles --ignore tests/test_tutorial/test_response_model/test_tutorial003_01_py310.py"
donttest="$donttest or test_orjson_response_class"
donttest="$donttest or (test_tutorial001 and test_get_custom_response)"
%endif
%pytest -W ignore::DeprecationWarning -W ignore::PendingDeprecationWarning -W ignore::ResourceWarning $ignorefiles -k "not ($donttest)" tests
%post
%python_install_alternative fastapi
%postun
%python_uninstall_alternative fastapi
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/fastapi
%{python_sitelib}/fastapi-%{version}.dist-info
%python_alternative %{_bindir}/fastapi
%changelog