File python-aiohttp.spec of Package python-aiohttp

#
# spec file for package python-aiohttp
#
# Copyright (c) 2018 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 http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python3-%{**}}
%bcond_without test
%define skip_python2 1
Name:           python-aiohttp
Version:        3.0.1
Release:        0
Summary:        Asynchronous HTTP client/server framework
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            https://aiohttp.readthedocs.io/
Source:         https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
# PATCH-FIX-OPENSUSE alarrosa@suse.com -- Fix failing tests due to issue in pytest-timeout
Patch0:         remove-failing-tests-due-to-pytest-timeout-issues.patch
BuildRequires:  %{python_module devel >= 3.4.2}
BuildRequires:  %{python_module setuptools}
BuildRequires:  python-rpm-macros
# SECTION test requirements
%if %{with test}
BuildRequires:  %{python_module async_timeout >= 2.0.0}
BuildRequires:  %{python_module chardet}
BuildRequires:  %{python_module gunicorn}
BuildRequires:  %{python_module idna_ssl >= 1.0.0}
BuildRequires:  %{python_module multidict >= 3.3.0}
BuildRequires:  %{python_module pluggy}
BuildRequires:  %{python_module pytest-mock}
BuildRequires:  %{python_module pytest-timeout}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module yarl >= 0.13.0}
%endif
# /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-newsfeed
# /SECTION
BuildRequires:  fdupes
Requires:       python >= 3.4.2
Requires:       python-async_timeout >= 2.0.0
Requires:       python-chardet
Requires:       python-idna_ssl >= 1.0.0
Requires:       python-multidict >= 3.3.0
Requires:       python-yarl >= 0.13.0
Recommends:     python-cChardet
Recommends:     python-aiodns
Suggests:       %{name}-doc

%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

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

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

%if %{with test}
%check
rm tests/test_pytest_plugin.py
%python_exec setup.py test
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGES.rst CONTRIBUTORS.txt HISTORY.rst LICENSE.txt README.rst
%{python_sitearch}/*

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

%changelog
openSUSE Build Service is sponsored by