forked from pool/python-aiohttp
Accepting request 939980 from home:bnavigator:branches:devel:languages:python
update (for python310) OBS-URL: https://build.opensuse.org/request/show/939980 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiohttp?expand=0&rev=73
This commit is contained in:
@@ -18,66 +18,62 @@
|
||||
|
||||
%{?!python_module:%define python_module() python3-%{**}}
|
||||
%define skip_python2 1
|
||||
# requires some unavailable modules
|
||||
%bcond_with docs
|
||||
Name: python-aiohttp
|
||||
Version: 3.7.4
|
||||
Version: 3.8.1
|
||||
Release: 0
|
||||
Summary: Asynchronous HTTP client/server framework
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/aio-libs/aiohttp
|
||||
Source: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
|
||||
Patch0: unbundle-http-parser.patch
|
||||
# PATCH-FIX-UPSTREAM stdlib-typing_extensions.patch gh#aio-libs/aiohttp#5374 mcepl@suse.com
|
||||
# Fix typing_extensions imports.
|
||||
Patch1: stdlib-typing_extensions.patch
|
||||
# PATCH-FIX-UPSTREAM remove_deprecated_loop_argument.patch gh#aio-libs/aiohttp#5991 mcepl@suse.com
|
||||
# remove deprecated loop argument
|
||||
Patch3: remove_deprecated_loop_argument.patch
|
||||
# PATCH-FIX-UPSTREAM backport_fix_for_setting_cookies.patch gh#aio-libs/aiohttp#5233 mcepl@suse.com
|
||||
# backport of fixes from 3.8 branch
|
||||
Patch4: backport_fix_for_setting_cookies.patch
|
||||
BuildRequires: %{python_module Cython}
|
||||
BuildRequires: %{python_module async_timeout >= 3.0}
|
||||
BuildRequires: %{python_module aiosignal >= 1.1.2}
|
||||
BuildRequires: %{python_module async_timeout >= 4.0}
|
||||
BuildRequires: %{python_module asynctest = 0.13.0 if %python-base < 3.8}
|
||||
BuildRequires: %{python_module attrs >= 17.3.0}
|
||||
BuildRequires: %{python_module chardet >= 2.0}
|
||||
BuildRequires: %{python_module devel >= 3.5.3}
|
||||
BuildRequires: %{python_module freezegun}
|
||||
BuildRequires: %{python_module idna_ssl >= 1.0}
|
||||
BuildRequires: %{python_module charset-normalizer >= 2.0}
|
||||
BuildRequires: %{python_module devel >= 3.6}
|
||||
BuildRequires: %{python_module frozenlist >= 1.1.1}
|
||||
BuildRequires: %{python_module idna_ssl >= 1.0 if %python-base < 3.7}
|
||||
BuildRequires: %{python_module multidict >= 4.5}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module typing_extensions >= 3.6.5 if %python-base < 3.8}
|
||||
BuildRequires: %{python_module typing_extensions >= 3.7.4 if %python-base < 3.8}
|
||||
BuildRequires: %{python_module yarl >= 1.0}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: http-parser-devel
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python >= 3.6
|
||||
Requires: python-async_timeout >= 3.0
|
||||
Requires: python-aiosignal >= 1.1.2
|
||||
Requires: python-async_timeout >= 4.0
|
||||
Requires: python-attrs >= 17.3.0
|
||||
Requires: python-chardet >= 2.0
|
||||
Requires: python-gunicorn
|
||||
Requires: python-charset-normalizer >= 2.0
|
||||
Requires: python-frozenlist >= 1.1.1
|
||||
Requires: python-multidict >= 4.5
|
||||
Requires: python-yarl >= 1.0
|
||||
Requires: (python3-typing_extensions >= 3.6.5 if python3-base < 3.8)
|
||||
Requires: (python-asynctest = 0.13.0 if python-base < 3.8)
|
||||
Requires: (python-idna_ssl >= 1.0 if python-base < 3.7)
|
||||
Requires: (python-typing_extensions >= 3.7.4 if python-base < 3.8)
|
||||
Recommends: python-aiodns
|
||||
Recommends: python-brotlipy
|
||||
Recommends: python-cChardet
|
||||
Suggests: %{name}-doc
|
||||
%if 0%{?suse_version} < 1550 || "%{python_flavor}" == "python36"
|
||||
Requires: python-idna_ssl >= 1.0
|
||||
%endif
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module aiodns}
|
||||
BuildRequires: %{python_module async_generator}
|
||||
BuildRequires: %{python_module brotlipy}
|
||||
BuildRequires: %{python_module freezegun}
|
||||
BuildRequires: %{python_module gunicorn}
|
||||
BuildRequires: %{python_module pluggy}
|
||||
BuildRequires: %{python_module proxy.py}
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module pytest-timeout}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module re-assert}
|
||||
BuildRequires: %{python_module trustme}
|
||||
|
||||
# /SECTION
|
||||
# SECTION docs
|
||||
%if %{with docs}
|
||||
BuildRequires: %{python_module MarkupSafe}
|
||||
BuildRequires: python3-Pygments >= 2.1
|
||||
BuildRequires: python3-Sphinx
|
||||
@@ -85,6 +81,8 @@ BuildRequires: python3-aiohttp-theme
|
||||
BuildRequires: python3-sphinxcontrib-asyncio
|
||||
BuildRequires: python3-sphinxcontrib-blockdiag
|
||||
BuildRequires: python3-sphinxcontrib-newsfeed
|
||||
BuildRequires: python3-sphinxcontrib-towncrier
|
||||
%endif
|
||||
# /SECTION
|
||||
%python_subpackages
|
||||
|
||||
@@ -104,20 +102,18 @@ HTML documentation on the API and examples for %{name}.
|
||||
%prep
|
||||
%autosetup -p1 -n aiohttp-%{version}
|
||||
|
||||
# Prevent building with vendor version
|
||||
rm vendor/http-parser/*.c
|
||||
|
||||
# Allow use with chardet v4
|
||||
# https://github.com/aio-libs/aiohttp/pull/5333
|
||||
sed -i 's/chardet>=2.0,<4.0/chardet>=2.0/' setup.py
|
||||
# don't check coverage
|
||||
sed -i '/--cov/d' setup.cfg
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
%python_build
|
||||
%if %{with docs}
|
||||
pushd docs
|
||||
%make_build html
|
||||
rm _build/html/.buildinfo
|
||||
popd
|
||||
%endif
|
||||
|
||||
%install
|
||||
%python_install
|
||||
@@ -127,16 +123,16 @@ rm -r %{buildroot}%{$python_sitearch}/aiohttp/.hash
|
||||
}
|
||||
|
||||
%check
|
||||
# ignore setup.cfg
|
||||
touch pytest.ini
|
||||
%define skiptest_allflavors test_aiohttp_request_coroutine or test_mark_formdata_as_processed or test_aiohttp_plugin_async
|
||||
# we need it to be defined for all flavors for expansion inside pytest_arch to work. %%{?...} would expand too early.
|
||||
%{lua: for p in string.gmatch(rpm.expand("%pythons"), "%S+") do rpm.define("skiptest_" .. p .. "_only %{nil}") end}
|
||||
donttest="test_aiohttp_request_coroutine or test_mark_formdata_as_processed or test_aiohttp_plugin_async"
|
||||
python36_donttest=" or test_read_boundary_with_incomplete_chunk"
|
||||
# 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"
|
||||
%if 0%{?python3_version_nodots} == 36
|
||||
%define skiptest_python3_only or test_read_boundary_with_incomplete_chunk
|
||||
donttest+="$python36_donttest"
|
||||
%endif
|
||||
%define skiptest_python36_only or test_read_boundary_with_incomplete_chunk
|
||||
%pytest_arch --ignore ./aiohttp -rs -k 'not (%{skiptest_allflavors} %{skiptest_$python_only})'
|
||||
%pytest_arch --ignore ./aiohttp -rsEf -k "not ($donttest ${$python_donttest})"
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE.txt
|
||||
@@ -144,7 +140,9 @@ touch pytest.ini
|
||||
%{python_sitearch}/aiohttp
|
||||
%{python_sitearch}/aiohttp-%{version}*-info
|
||||
|
||||
%if %{with docs}
|
||||
%files -n %{name}-doc
|
||||
%doc docs/_build/html
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user