3 %bcond_without doc # API documentation
4 %bcond_without tests # unit tests
6 %define module template
7 Summary: Async http client/server framework
8 Summary(pl.UTF-8): Szkielet asynchronicznego klienta/serwera http
13 Group: Libraries/Python
14 Source0: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
15 # Source0-md5: faf7726dc65a940272874c0f441e8ec6
16 Patch0: disable-towncrier.patch
17 URL: https://pypi.org/project/aiohttp/
18 BuildRequires: python3-devel >= 1:3.6
19 BuildRequires: python3-setuptools
21 BuildRequires: python3-aiosignal
22 BuildRequires: python3-async_timeout >= 4.0
23 BuildRequires: python3-attrs >= 17.3.0
24 BuildRequires: python3-brotli
25 BuildRequires: python3-chardet >= 2.0
26 BuildRequires: python3-freezegun
27 BuildRequires: python3-gunicorn
28 %if "%{py3_ver}" < "3.7"
29 BuildRequires: python3-idna-ssl
31 BuildRequires: python3-multidict >= 4.5
32 BuildRequires: python3-pytest >= 3.8.2
33 BuildRequires: python3-pytest-cov
34 BuildRequires: python3-pytest-mock
35 BuildRequires: python3-re_assert
36 BuildRequires: python3-typing_extensions >= 3.6.5
37 BuildRequires: python3-yarl >= 1.0
39 BuildRequires: rpm-pythonprov
40 BuildRequires: rpmbuild(macros) >= 1.714
41 BuildRequires: sed >= 4.0
43 BuildRequires: python3-aiohttp_theme
44 BuildRequires: python3-sphinxcontrib-asyncio
45 BuildRequires: python3-sphinxcontrib-blockdiag
46 BuildRequires: sphinx-pdg-3
48 Requires: python3-modules >= 1:3.6
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 Async http client/server framework.
54 %description -l pl.UTF-8
55 Szkielet asynchronicznego klienta/serwera http.
58 Summary: aiohttp API documentation
59 Summary(pl.UTF-8): Dokumentacja API aiohttp
64 API documentation for aiohttp.
66 %description apidocs -l pl.UTF-8
67 Dokumentacja API aiohttp.
70 %setup -q -n aiohttp-%{version}
73 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py
75 # adjust for python 3.7+
76 %{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
78 # until we have pytest >= 6:
79 %{__sed} -i -e '/assert_outcomes/ s/errors=/error=/' tests/test_pytest_plugin.py
85 # test_data_stream_exc_chain uses network, fails
86 # test_async_iterable_payload_default_content_type, test_async_iterable_payload_explicit_content_type fail with TypeError (need update?)
87 # test_mark_formdata_as_processed requires network
88 %{__mv} tests/test_proxy_functional.py{,.disabled} # needs proxy_py binary
89 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
90 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
91 %{__python3} -m pytest tests -k 'not (test_data_stream_exc_chain or test_async_iterable_payload_default_content_type or test_async_iterable_payload_explicit_content_type or test_mark_formdata_as_processed or test_c_parser_loaded or test_aiohttp_plugin_async_fixture)'
95 %{__make} -C docs html \
96 SPHINXBUILD=sphinx-build-3
100 rm -rf $RPM_BUILD_ROOT
104 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
105 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{c,h,pxd,pxi,pyx}
107 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
108 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 rm -rf $RPM_BUILD_ROOT
114 %defattr(644,root,root,755)
115 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
116 %dir %{py3_sitedir}/aiohttp
117 %attr(755,root,root) %{py3_sitedir}/aiohttp/*.so
118 %{py3_sitedir}/aiohttp/*.py
119 %{py3_sitedir}/aiohttp/*.pyi
120 %{py3_sitedir}/aiohttp/py.typed
121 %{py3_sitedir}/aiohttp/__pycache__
122 %{py3_sitedir}/aiohttp-%{version}-py*.egg-info
123 %{_examplesdir}/%{name}-%{version}
127 %defattr(644,root,root,755)
128 %doc docs/_build/html/*