2017-09-01 16:36:11 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-aiohttp
|
|
|
|
#
|
2023-03-16 08:32:31 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2017-09-01 16:36:11 +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.
|
|
|
|
|
2018-10-06 11:20:40 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-09-11 17:42:42 +02:00
|
|
|
#
|
2017-09-01 16:36:11 +02:00
|
|
|
|
|
|
|
|
2017-09-08 19:35:05 +02:00
|
|
|
%define skip_python2 1
|
2021-12-13 19:46:07 +01:00
|
|
|
# requires some unavailable modules
|
|
|
|
%bcond_with docs
|
2017-09-01 16:36:11 +02:00
|
|
|
Name: python-aiohttp
|
2022-09-24 13:09:08 +02:00
|
|
|
Version: 3.8.3
|
2017-09-01 16:36:11 +02:00
|
|
|
Release: 0
|
2017-09-11 17:42:42 +02:00
|
|
|
Summary: Asynchronous HTTP client/server framework
|
2017-09-01 16:36:11 +02:00
|
|
|
License: Apache-2.0
|
2018-08-31 13:50:47 +02:00
|
|
|
URL: https://github.com/aio-libs/aiohttp
|
2017-09-01 16:36:11 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
|
2022-11-08 08:22:30 +01:00
|
|
|
# PATCH-FIX-UPSTREAM aiohttp-pr7057-bump-charset-normalizer.patch gh#aio-libs/aiohttp#7057
|
|
|
|
Patch0: aiohttp-pr7057-bump-charset-normalizer.patch
|
2022-12-12 12:34:39 +01:00
|
|
|
# PATCH-FIX-OPENSUSE py3109-compat.patch
|
|
|
|
Patch1: py3109-compat.patch
|
2022-11-08 08:22:30 +01:00
|
|
|
# SECTION build requirements
|
2019-01-15 17:33:00 +01:00
|
|
|
BuildRequires: %{python_module Cython}
|
2022-11-08 08:22:30 +01:00
|
|
|
BuildRequires: %{python_module devel >= 3.6}
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: %{python_module wheel}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: http-parser-devel
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
# /SECTION
|
|
|
|
# SECTION install requirements
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: %{python_module aiosignal >= 1.1.2}
|
2022-11-08 08:22:30 +01:00
|
|
|
BuildRequires: %{python_module async_timeout >= 4.0 with %python-async_timeout < 5}
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: %{python_module asynctest = 0.13.0 if %python-base < 3.8}
|
2019-06-04 17:42:37 +02:00
|
|
|
BuildRequires: %{python_module attrs >= 17.3.0}
|
2022-11-08 08:22:30 +01:00
|
|
|
BuildRequires: %{python_module charset-normalizer >= 2.0 with %python-charset-normalizer < 4}
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: %{python_module frozenlist >= 1.1.1}
|
|
|
|
BuildRequires: %{python_module idna_ssl >= 1.0 if %python-base < 3.7}
|
2022-11-08 08:22:30 +01:00
|
|
|
BuildRequires: %{python_module multidict >= 4.5 with %python-multidict < 7}
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: %{python_module typing_extensions >= 3.7.4 if %python-base < 3.8}
|
2022-11-08 08:22:30 +01:00
|
|
|
BuildRequires: %{python_module yarl >= 1.0 with %python-yarl < 2}
|
|
|
|
# /SECTION
|
2021-12-13 19:46:07 +01:00
|
|
|
Requires: python-aiosignal >= 1.1.2
|
2018-08-31 13:50:47 +02:00
|
|
|
Requires: python-attrs >= 17.3.0
|
2021-12-13 19:46:07 +01:00
|
|
|
Requires: python-frozenlist >= 1.1.1
|
2022-11-08 08:22:30 +01:00
|
|
|
Requires: (python-async_timeout >= 4.0 with python-async_timeout < 5)
|
2021-12-13 19:46:07 +01:00
|
|
|
Requires: (python-asynctest = 0.13.0 if python-base < 3.8)
|
2022-11-08 08:22:30 +01:00
|
|
|
Requires: (python-charset-normalizer >= 2.0 with python-charset-normalizer < 4)
|
2021-12-13 19:46:07 +01:00
|
|
|
Requires: (python-idna_ssl >= 1.0 if python-base < 3.7)
|
2022-11-08 08:22:30 +01:00
|
|
|
Requires: (python-multidict >= 4.5 with python-multidict < 7)
|
2021-12-13 19:46:07 +01:00
|
|
|
Requires: (python-typing_extensions >= 3.7.4 if python-base < 3.8)
|
2022-11-08 08:22:30 +01:00
|
|
|
Requires: (python-yarl >= 1.0 with python-yarl < 2)
|
2018-04-14 08:45:33 +02:00
|
|
|
Recommends: python-aiodns
|
2020-12-04 16:14:54 +01:00
|
|
|
Recommends: python-brotlipy
|
2018-04-14 08:45:33 +02:00
|
|
|
Recommends: python-cChardet
|
|
|
|
Suggests: %{name}-doc
|
2017-09-08 19:35:05 +02:00
|
|
|
# SECTION test requirements
|
2020-10-29 11:37:40 +01:00
|
|
|
BuildRequires: %{python_module aiodns}
|
2018-08-31 12:50:36 +02:00
|
|
|
BuildRequires: %{python_module brotlipy}
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: %{python_module freezegun}
|
2017-09-01 16:36:11 +02:00
|
|
|
BuildRequires: %{python_module gunicorn}
|
2017-12-06 10:27:11 +01:00
|
|
|
BuildRequires: %{python_module pluggy}
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: %{python_module proxy.py}
|
2023-03-16 08:32:31 +01:00
|
|
|
BuildRequires: %{python_module pytest >= 6.2.0}
|
2017-09-11 17:42:42 +02:00
|
|
|
BuildRequires: %{python_module pytest-mock}
|
2017-09-08 19:35:05 +02:00
|
|
|
BuildRequires: %{python_module pytest-timeout}
|
2020-10-29 11:37:40 +01:00
|
|
|
BuildRequires: %{python_module re-assert}
|
2019-02-27 15:32:14 +01:00
|
|
|
BuildRequires: %{python_module trustme}
|
2017-09-08 19:35:05 +02:00
|
|
|
# /SECTION
|
|
|
|
# SECTION docs
|
2021-12-13 19:46:07 +01:00
|
|
|
%if %{with docs}
|
2022-03-28 17:10:57 +02:00
|
|
|
BuildRequires: python3-MarkupSafe
|
2018-02-17 20:07:09 +01:00
|
|
|
BuildRequires: python3-Pygments >= 2.1
|
2017-09-08 19:35:05 +02:00
|
|
|
BuildRequires: python3-Sphinx
|
2018-02-17 20:07:09 +01:00
|
|
|
BuildRequires: python3-aiohttp-theme
|
2017-09-08 19:35:05 +02:00
|
|
|
BuildRequires: python3-sphinxcontrib-asyncio
|
2018-03-23 17:04:53 +01:00
|
|
|
BuildRequires: python3-sphinxcontrib-blockdiag
|
2017-09-08 19:35:05 +02:00
|
|
|
BuildRequires: python3-sphinxcontrib-newsfeed
|
2021-12-13 19:46:07 +01:00
|
|
|
BuildRequires: python3-sphinxcontrib-towncrier
|
|
|
|
%endif
|
2017-09-08 19:35:05 +02:00
|
|
|
# /SECTION
|
2017-09-01 16:36:11 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
2017-09-08 19:35:05 +02:00
|
|
|
%package -n %{name}-doc
|
2018-04-14 08:45:33 +02:00
|
|
|
Summary: Documentation files for %{name}
|
2017-09-08 19:35:05 +02:00
|
|
|
|
2017-09-01 16:36:11 +02:00
|
|
|
%description
|
2017-09-11 17:42:42 +02:00
|
|
|
Asynchronous HTTP client/server framework for Python.
|
2017-09-08 19:35:05 +02:00
|
|
|
|
2017-09-11 17:42:42 +02:00
|
|
|
- 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.
|
2017-09-08 19:35:05 +02:00
|
|
|
|
|
|
|
%description -n %{name}-doc
|
2018-04-14 08:45:33 +02:00
|
|
|
HTML documentation on the API and examples for %{name}.
|
2017-09-01 16:36:11 +02:00
|
|
|
|
|
|
|
%prep
|
2021-05-14 00:26:12 +02:00
|
|
|
%autosetup -p1 -n aiohttp-%{version}
|
|
|
|
|
2021-12-13 19:46:07 +01:00
|
|
|
# don't check coverage
|
|
|
|
sed -i '/--cov/d' setup.cfg
|
2020-12-20 16:42:25 +01:00
|
|
|
|
2017-09-01 16:36:11 +02:00
|
|
|
%build
|
|
|
|
export CFLAGS="%{optflags}"
|
2022-11-08 08:22:30 +01:00
|
|
|
%pyproject_wheel
|
2021-12-13 19:46:07 +01:00
|
|
|
%if %{with docs}
|
2017-09-08 19:35:05 +02:00
|
|
|
pushd docs
|
2020-03-10 09:36:10 +01:00
|
|
|
%make_build html
|
2017-09-08 19:35:05 +02:00
|
|
|
rm _build/html/.buildinfo
|
|
|
|
popd
|
2021-12-13 19:46:07 +01:00
|
|
|
%endif
|
2017-09-01 16:36:11 +02:00
|
|
|
|
|
|
|
%install
|
2022-11-08 08:22:30 +01:00
|
|
|
%pyproject_install
|
2017-09-08 19:35:05 +02:00
|
|
|
%{python_expand %fdupes %{buildroot}%{$python_sitearch}
|
2020-12-04 16:14:54 +01:00
|
|
|
find %{buildroot}%{$python_sitearch} -name '*.[ch]' -delete
|
|
|
|
rm -r %{buildroot}%{$python_sitearch}/aiohttp/.hash
|
2017-09-08 19:35:05 +02:00
|
|
|
}
|
2017-09-01 16:36:11 +02:00
|
|
|
|
|
|
|
%check
|
2022-10-04 22:32:08 +02:00
|
|
|
donttest="test_aiohttp_request_coroutine or test_mark_formdata_as_processed or test_aiohttp_plugin_async or test_secure_https_proxy_absolute_path"
|
2021-12-13 19:46:07 +01:00
|
|
|
# no name resolution
|
|
|
|
donttest+=" or test_client_session_timeout_zero or test_requote_redirect_url_default"
|
|
|
|
# flaky
|
|
|
|
donttest+=" or test_https_proxy_unsupported_tls_in_tls"
|
2022-10-04 22:32:08 +02:00
|
|
|
# not running under pytest ?!
|
|
|
|
donttest+=" or test_no_warnings"
|
2022-12-26 23:03:27 +01:00
|
|
|
%{python_expand # Does not work on python <= 3.6
|
|
|
|
if [ %{$python_version_nodots} -eq 36 ]; then
|
|
|
|
#See https://github.com/openSUSE/python-rpm-macros#flavor-expansion for an explanation of this hack
|
|
|
|
$python_donttest=" or test_read_boundary_with_incomplete_chunk"
|
|
|
|
fi
|
|
|
|
}
|
2023-03-16 08:32:31 +01:00
|
|
|
|
|
|
|
# Disable DeprecationWarning to avoid error with the latest setuptools
|
|
|
|
# and pkg_resources deprecation
|
|
|
|
%pytest_arch tests -rsEf -k "not ($donttest ${$python_donttest})" -W ignore::DeprecationWarning
|
2017-09-01 16:36:11 +02:00
|
|
|
|
|
|
|
%files %{python_files}
|
2018-04-14 08:45:33 +02:00
|
|
|
%license LICENSE.txt
|
2020-03-10 09:36:10 +01:00
|
|
|
%doc CHANGES.rst CONTRIBUTORS.txt README.rst
|
2020-12-04 16:14:54 +01:00
|
|
|
%{python_sitearch}/aiohttp
|
|
|
|
%{python_sitearch}/aiohttp-%{version}*-info
|
2017-09-01 16:36:11 +02:00
|
|
|
|
2021-12-13 19:46:07 +01:00
|
|
|
%if %{with docs}
|
2017-09-08 19:35:05 +02:00
|
|
|
%files -n %{name}-doc
|
|
|
|
%doc docs/_build/html
|
2021-12-13 19:46:07 +01:00
|
|
|
%endif
|
2017-09-08 19:35:05 +02:00
|
|
|
|
2017-09-01 16:36:11 +02:00
|
|
|
%changelog
|