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-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 # if using noarchpackage, replace with:
42 #BuildRequires: rpmbuild(macros) >= 1.752
43 BuildRequires: sed >= 4.0
45 BuildRequires: python3-aiohttp_theme
46 BuildRequires: python3-sphinxcontrib-asyncio
47 BuildRequires: python3-sphinxcontrib-blockdiag
48 BuildRequires: sphinx-pdg-3
50 # replace with other requires if defined in setup.py
51 Requires: python3-modules >= 1:3.6
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 Async http client/server framework.
57 %description -l pl.UTF-8
58 Szkielet asynchronicznego klienta/serwera http.
61 Summary: aiohttp API documentation
62 Summary(pl.UTF-8): Dokumentacja API aiohttp
67 API documentation for aiohttp.
69 %description apidocs -l pl.UTF-8
70 Dokumentacja API aiohttp.
73 %setup -q -n aiohttp-%{version}
76 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py examples/legacy/*.py
78 # adjust for python 3.7+
79 %{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
81 # until we have pytest >= 6:
82 %{__sed} -i -e '/assert_outcomes/ s/errors=/error=/' tests/test_pytest_plugin.py
88 # test_data_stream_exc_chain uses network, fails
89 # test_async_iterable_payload_default_content_type, test_async_iterable_payload_explicit_content_type fail with TypeError (need update?)
90 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
91 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
92 %{__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)'
96 %{__make} -C docs html \
97 SPHINXBUILD=sphinx-build-3
101 rm -rf $RPM_BUILD_ROOT
105 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
106 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{c,h,pxd,pxi,pyx}
108 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
109 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
112 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
117 %dir %{py3_sitedir}/aiohttp
118 %attr(755,root,root) %{py3_sitedir}/aiohttp/*.so
119 %{py3_sitedir}/aiohttp/*.py
120 %{py3_sitedir}/aiohttp/*.pyi
121 %{py3_sitedir}/aiohttp/py.typed
122 %{py3_sitedir}/aiohttp/__pycache__
123 %{py3_sitedir}/aiohttp-%{version}-py*.egg-info
124 %{_examplesdir}/%{name}-%{version}
128 %defattr(644,root,root,755)
129 %doc docs/_build/html/*