2021-04-14 15:12:10 +02:00
|
|
|
#
|
2022-07-29 15:09:57 +02:00
|
|
|
# spec file
|
2021-04-14 15:12:10 +02:00
|
|
|
#
|
2023-01-05 14:59:21 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2021-04-14 15:12:10 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-07-29 15:09:57 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2023-01-05 14:59:21 +01:00
|
|
|
|
2021-04-14 15:12:10 +02:00
|
|
|
%define skip_python2 1
|
2022-07-29 15:09:57 +02:00
|
|
|
Name: python-starlette%{psuffix}
|
2023-03-14 15:23:38 +01:00
|
|
|
Version: 0.26.1
|
2021-04-14 15:12:10 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Lightweight ASGI framework/toolkit
|
|
|
|
License: BSD-3-Clause
|
|
|
|
URL: https://github.com/encode/starlette
|
|
|
|
Source: https://github.com/encode/starlette/archive/refs/tags/%{version}.tar.gz#/starlette-%{version}.tar.gz
|
2022-07-29 15:09:57 +02:00
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
2022-09-29 12:40:28 +02:00
|
|
|
BuildRequires: %{python_module hatchling}
|
|
|
|
BuildRequires: %{python_module pip}
|
2022-08-05 15:51:02 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: python-anyio >= 3.4.0
|
2023-01-05 14:59:21 +01:00
|
|
|
Requires: (python-typing_extensions >= 3.10.0 if python-base < 3.10)
|
2022-08-05 15:51:02 +02:00
|
|
|
BuildArch: noarch
|
2022-07-29 15:09:57 +02:00
|
|
|
%if %{with test}
|
2023-01-05 14:59:21 +01:00
|
|
|
BuildRequires: %{python_module anyio >= 3.4.0}
|
|
|
|
# typing_extensions, see below
|
|
|
|
# SECTION [full]
|
|
|
|
BuildRequires: %{python_module PyYAML}
|
|
|
|
BuildRequires: %{python_module Jinja2}
|
|
|
|
BuildRequires: %{python_module httpx >= 0.22}
|
|
|
|
BuildRequires: %{python_module itsdangerous}
|
|
|
|
BuildRequires: %{python_module python-multipart}
|
|
|
|
# /SECTION
|
|
|
|
# SECTION test
|
2022-12-13 13:07:14 +01:00
|
|
|
BuildRequires: %{python_module exceptiongroup}
|
2021-04-14 15:12:10 +02:00
|
|
|
BuildRequires: %{python_module pytest-asyncio}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2021-07-22 12:21:44 +02:00
|
|
|
BuildRequires: %{python_module trio}
|
2023-01-05 14:59:21 +01:00
|
|
|
# testing requires it for all flavors
|
|
|
|
BuildRequires: %{python_module typing_extensions}
|
2023-02-11 12:52:32 +01:00
|
|
|
BuildRequires: %{python_module importlib-metadata}
|
2023-01-05 14:59:21 +01:00
|
|
|
# /SECITON
|
2022-07-29 15:09:57 +02:00
|
|
|
%endif
|
2021-04-14 15:12:10 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
Starlette is a lightweight ASGI framework/toolkit, which is ideal for
|
|
|
|
building high performance asyncio services.
|
|
|
|
|
|
|
|
%prep
|
2021-12-12 00:54:17 +01:00
|
|
|
%autosetup -n starlette-%{version}
|
2021-04-14 15:12:10 +02:00
|
|
|
|
|
|
|
%build
|
2022-09-29 12:40:28 +02:00
|
|
|
%pyproject_wheel
|
2021-04-14 15:12:10 +02:00
|
|
|
|
|
|
|
%install
|
2022-07-29 15:09:57 +02:00
|
|
|
%if ! %{with test}
|
2022-09-29 12:40:28 +02:00
|
|
|
%pyproject_install
|
2021-04-14 15:12:10 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2022-07-29 15:09:57 +02:00
|
|
|
%endif
|
2021-04-14 15:12:10 +02:00
|
|
|
|
|
|
|
%check
|
2022-07-29 15:09:57 +02:00
|
|
|
%if %{with test}
|
2021-04-14 15:12:10 +02:00
|
|
|
# Remove unrecognized arguments: --strict-config --strict-markers
|
|
|
|
sed -i "s|--strict-config||" setup.cfg
|
|
|
|
sed -i "s|--strict-markers||" setup.cfg
|
2022-02-23 02:10:08 +01:00
|
|
|
sed -i "s| error$||" setup.cfg
|
2023-02-11 12:52:32 +01:00
|
|
|
|
|
|
|
# The following tests don't work in some archs because time_t cannot
|
|
|
|
# hold the values the test expect, as they go beyond the maximum
|
|
|
|
# value in i586 and armv7l. As we are using Buildarch: noarch, we
|
|
|
|
# cannot just use ifarch conditionals here...
|
|
|
|
ignored_tests="test_set_cookie"
|
|
|
|
ignored_tests="$ignored_tests or test_expires_on_set_cookie"
|
|
|
|
%pytest --asyncio-mode=strict -k "not ($ignored_tests)"
|
|
|
|
|
2022-07-29 15:09:57 +02:00
|
|
|
%endif
|
2021-04-14 15:12:10 +02:00
|
|
|
|
2022-07-29 15:09:57 +02:00
|
|
|
%if ! %{with test}
|
2021-04-14 15:12:10 +02:00
|
|
|
%files %{python_files}
|
|
|
|
%doc README.md
|
|
|
|
%license LICENSE.md
|
|
|
|
%{python_sitelib}/starlette
|
|
|
|
%{python_sitelib}/starlette-%{version}*-info
|
2022-07-29 15:09:57 +02:00
|
|
|
%endif
|
2021-04-14 15:12:10 +02:00
|
|
|
|
|
|
|
%changelog
|