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: 642653db642be1508e50fcdeafe0f928
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-aiodns >= 1.1
22 BuildRequires: python3-aiosignal >= 1.1.2
23 BuildRequires: python3-async_timeout >= 4.0
24 BuildRequires: python3-async_timeout < 5
25 %if "%{ver_lt '%{py3_ver}' '3.8'}" == "1"
26 BuildRequires: python3-asynctest = 0.13.0
28 BuildRequires: python3-attrs >= 17.3.0
29 BuildRequires: python3-brotli
30 BuildRequires: python3-charset_normalizer >= 2.0
31 BuildRequires: python3-charset_normalizer < 3
32 BuildRequires: python3-cchardet
33 BuildRequires: python3-freezegun
34 BuildRequires: python3-frozenlist >= 1.1.1
35 BuildRequires: python3-gunicorn
36 %if "%{py3_ver}" == "3.6"
37 BuildRequires: python3-idna-ssl >= 1.0
39 BuildRequires: python3-multidict >= 4.5
40 BuildRequires: python3-multidict < 7
41 BuildRequires: python3-pytest >= 3.8.2
42 BuildRequires: python3-pytest-cov
43 BuildRequires: python3-pytest-mock
44 BuildRequires: python3-re_assert
45 %if "%{ver_lt '%{py3_ver}' '3.8'}" == "1"
46 BuildRequires: python3-typing_extensions >= 3.6.5
48 BuildRequires: python3-yarl >= 1.0
49 BuildRequires: python3-yarl < 2
51 BuildRequires: rpm-pythonprov
52 BuildRequires: rpmbuild(macros) >= 1.749
53 BuildRequires: sed >= 4.0
55 BuildRequires: python3-aiohttp_theme
56 BuildRequires: python3-sphinxcontrib-asyncio
57 BuildRequires: python3-sphinxcontrib-blockdiag
58 BuildRequires: sphinx-pdg-3
60 Requires: python3-modules >= 1:3.6
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 Async http client/server framework.
66 %description -l pl.UTF-8
67 Szkielet asynchronicznego klienta/serwera http.
70 Summary: aiohttp API documentation
71 Summary(pl.UTF-8): Dokumentacja API aiohttp
76 API documentation for aiohttp.
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API aiohttp.
82 %setup -q -n aiohttp-%{version}
85 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py
87 # adjust for python 3.7+
88 %{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
94 # test_data_stream_exc_chain uses network
95 # test_mark_formdata_as_processed requires network
96 # test_client_session_timeout_zero fails on builders
97 # test_requote_redirect_url_default uses network
98 # test_unsupported_upgrade is marked as xfail, but succeeds
99 %{__mv} tests/test_proxy_functional.py{,.disabled} # needs proxy_py binary
100 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
101 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
102 %{__python3} -m pytest tests -k 'not (test_data_stream_exc_chain or test_mark_formdata_as_processed or test_client_session_timeout_zero or test_requote_redirect_url_default or test_c_parser_loaded or test_unsupported_upgrade)'
106 %{__make} -C docs html \
107 SPHINXBUILD=sphinx-build-3 \
112 rm -rf $RPM_BUILD_ROOT
116 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
117 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{pxd,pxi,pyx}
119 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
123 rm -rf $RPM_BUILD_ROOT
126 %defattr(644,root,root,755)
127 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
128 %dir %{py3_sitedir}/aiohttp
129 %attr(755,root,root) %{py3_sitedir}/aiohttp/*.so
130 %{py3_sitedir}/aiohttp/*.py
131 %{py3_sitedir}/aiohttp/*.pyi
132 %{py3_sitedir}/aiohttp/py.typed
133 %{py3_sitedir}/aiohttp/__pycache__
134 %{py3_sitedir}/aiohttp-%{version}-py*.egg-info
135 %{_examplesdir}/%{name}-%{version}
139 %defattr(644,root,root,755)
140 %doc docs/_build/html/*