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 #Source0Download: https://pypi.org/simple/aiohttp/
15 Source0: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
16 # Source0-md5: a66039c12f33dd093a2c260f5c459632
17 # adjusted from https://github.com/aio-libs/aiohttp/commit/9afc44b052643213da15c9583ecbd643ca999601.patch
18 Patch0: %{name}-brotli.patch
19 URL: https://pypi.org/project/aiohttp/
20 BuildRequires: python3-devel >= 1:3.6
21 BuildRequires: python3-setuptools
23 BuildRequires: python3-async_timeout >= 3.0
24 BuildRequires: python3-attrs >= 17.3.0
25 BuildRequires: python3-brotli
26 BuildRequires: python3-chardet >= 2.0
27 BuildRequires: python3-freezegun
28 BuildRequires: python3-gunicorn
29 %if "%{py3_ver}" < "3.7"
30 BuildRequires: python3-idna-ssl
32 BuildRequires: python3-multidict >= 4.5
33 BuildRequires: python3-pytest >= 3.8.2
34 BuildRequires: python3-pytest-cov
35 BuildRequires: python3-pytest-mock
36 BuildRequires: python3-re_assert
37 BuildRequires: python3-typing_extensions >= 3.6.5
38 BuildRequires: python3-yarl >= 1.0
40 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.714
42 # if using noarchpackage, replace with:
43 #BuildRequires: rpmbuild(macros) >= 1.752
44 BuildRequires: sed >= 4.0
46 BuildRequires: python3-aiohttp_theme
47 BuildRequires: python3-sphinxcontrib-asyncio
48 BuildRequires: python3-sphinxcontrib-blockdiag
49 BuildRequires: sphinx-pdg-3
51 # replace with other requires if defined in setup.py
52 Requires: python3-modules >= 1:3.6
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Async http client/server framework.
58 %description -l pl.UTF-8
59 Szkielet asynchronicznego klienta/serwera http.
62 Summary: aiohttp API documentation
63 Summary(pl.UTF-8): Dokumentacja API aiohttp
68 API documentation for aiohttp.
70 %description apidocs -l pl.UTF-8
71 Dokumentacja API aiohttp.
74 %setup -q -n aiohttp-%{version}
77 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py examples/legacy/*.py
79 # adjust for python 3.7+
80 %{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
82 # until we have pytest >= 6:
83 %{__sed} -i -e '/assert_outcomes/ s/errors=/error=/' tests/test_pytest_plugin.py
89 # test_data_stream_exc_chain uses network, fails
90 # test_async_iterable_payload_default_content_type, test_async_iterable_payload_explicit_content_type fail with TypeError (need update?)
91 # test_mark_formdata_as_processed requires network
92 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
93 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
94 %{__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)'
98 %{__make} -C docs html \
99 SPHINXBUILD=sphinx-build-3
103 rm -rf $RPM_BUILD_ROOT
107 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
108 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{c,h,pxd,pxi,pyx}
110 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
114 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
118 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
119 %dir %{py3_sitedir}/aiohttp
120 %attr(755,root,root) %{py3_sitedir}/aiohttp/*.so
121 %{py3_sitedir}/aiohttp/*.py
122 %{py3_sitedir}/aiohttp/*.pyi
123 %{py3_sitedir}/aiohttp/py.typed
124 %{py3_sitedir}/aiohttp/__pycache__
125 %{py3_sitedir}/aiohttp-%{version}-py*.egg-info
126 %{_examplesdir}/%{name}-%{version}
130 %defattr(644,root,root,755)
131 %doc docs/_build/html/*