File python-aiohttp.spec of Package python-aiohttp.36839

#
# spec file for package python-aiohttp
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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() python3-%{**}}
%define skip_python2 1
Name:           python-aiohttp
Version:        3.6.0
Release:        0
Summary:        Asynchronous HTTP client/server framework
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://github.com/aio-libs/aiohttp
Source:         https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
# PATCH-FIX-UPSTREAM glaubitz@suse.com -- Fix how pure-Python HTTP parser interprets `//`
# https://github.com/aio-libs/aiohttp/issues/5497
Patch0:         CVE-2021-21330.patch
Patch1:         CVE-2023-47641.patch
Patch2:         CVE-2023-49081.patch
# PATCH-FIX-UPSTREAM CVE-2024-52304.patch bsc#1233447, gh#aio-libs/aiohttp@259edc369075
Patch3:         CVE-2024-52304.patch
# PATCH-FIX-UPSTREAM CVE-2024-30251.patch bsc#1223726
# gh#aio-libs/aiohttp@cebe526b9c34#diff-5954cadbd6b57b1921fc64d0e6a8f81717127873d9ccec33184d2f971fe6834f
# gh#aio-libs/aiohttp@7eecdff163cc#diff-d582bf292efb8e19696d88c895b99e0937687cb909d9d00b5c2f1d948a5cbae5
# gh#aio-libs/aiohttp@f21c6f2ca512#diff-d582bf292efb8e19696d88c895b99e0937687cb909d9d00b5c2f1d948a5cbae5
Patch4:         CVE-2024-30251.patch
# PATCH-FIX-UPSTREAM CVE-2024-27306.patch bsc#1223098, gh#aio-libs/aiohttp#8319
Patch5:         CVE-2024-27306.patch
BuildRequires:  %{python_module Cython}
BuildRequires:  %{python_module async_timeout >= 3.0}
BuildRequires:  %{python_module attrs >= 17.3.0}
BuildRequires:  %{python_module chardet >= 2.0}
BuildRequires:  %{python_module devel >= 3.5.3}
BuildRequires:  %{python_module multidict >= 4.0}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python >= 3.5.3
Requires:       python-async_timeout >= 3.0
Requires:       python-attrs >= 17.3.0
Requires:       python-brotlipy
Requires:       python-chardet >= 2.0
Requires:       python-gunicorn
Requires:       python-multidict >= 4.0
Requires:       python-yarl >= 1.0
Recommends:     python-aiodns
Recommends:     python-cChardet
Suggests:       %{name}-doc
%if 0%{?suse_version} < 1550
BuildRequires:  %{python_module idna_ssl >= 1.0}
BuildRequires:  %{python_module typing_extensions >= 3.6.5}
Requires:       python-idna_ssl
Requires:       python-typing_extensions
%endif
# SECTION test requirements
BuildRequires:  %{python_module async_generator}
BuildRequires:  %{python_module brotlipy}
BuildRequires:  %{python_module gunicorn}
BuildRequires:  %{python_module pluggy}
BuildRequires:  %{python_module pytest-cov}
BuildRequires:  %{python_module pytest-mock}
BuildRequires:  %{python_module pytest-runner}
BuildRequires:  %{python_module pytest-timeout}
BuildRequires:  %{python_module pytest-xdist}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module trustme}
BuildRequires:  %{python_module yarl >= 1.0}
# /SECTION
# SECTION docs
BuildRequires:  %{python_module MarkupSafe}
BuildRequires:  python3-Pygments >= 2.1
BuildRequires:  python3-Sphinx
BuildRequires:  python3-aiohttp-theme
BuildRequires:  python3-sphinxcontrib-asyncio
BuildRequires:  python3-sphinxcontrib-blockdiag
BuildRequires:  python3-sphinxcontrib-newsfeed
# /SECTION
%python_subpackages

%package -n %{name}-doc
Summary:        Documentation files for %{name}
Group:          Documentation/HTML

%description
Asynchronous HTTP client/server framework for Python.

- Supports both the client and server side of HTTP protocol.
- Supports both client and server WebSockets out-of-the-box.
- Web-server has middleware and pluggable routing.

%description -n %{name}-doc
HTML documentation on the API and examples for %{name}.

%prep
%setup -q -n aiohttp-%{version}
%patch0 -p1
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

%build
export CFLAGS="%{optflags}"
%python_build
pushd docs
make %{?_smp_mflags} html
rm _build/html/.buildinfo
popd

%install
%python_install
%{python_expand %fdupes %{buildroot}%{$python_sitearch}
find %{buildroot}%{$python_sitearch} -name "*.c" -delete
}

%check
%python_exec setup.py test

%files %{python_files}
%license LICENSE.txt
%doc CHANGES.rst CONTRIBUTORS.txt HISTORY.rst README.rst
%{python_sitearch}/*

%files -n %{name}-doc
%doc docs/_build/html

%changelog
openSUSE Build Service is sponsored by