]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without doc # API documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | %define module template | |
7 | Summary: Async http client/server framework | |
8 | Summary(pl.UTF-8): Szkielet asynchronicznego klienta/serwera http | |
9 | Name: python3-aiohttp | |
10 | Version: 3.8.4 | |
11 | Release: 1 | |
12 | License: Apache v2.0 | |
13 | Group: Libraries/Python | |
14 | Source0: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz | |
15 | # Source0-md5: 8208bc4b519ac4520720577f93561855 | |
16 | Patch0: disable-towncrier.patch | |
17 | URL: https://pypi.org/project/aiohttp/ | |
18 | BuildRequires: python3-devel >= 1:3.6 | |
19 | BuildRequires: python3-setuptools | |
20 | %if %{with tests} | |
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 | |
27 | %endif | |
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 | |
38 | %endif | |
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 | |
47 | %endif | |
48 | BuildRequires: python3-yarl >= 1.0 | |
49 | BuildRequires: python3-yarl < 2 | |
50 | %endif | |
51 | BuildRequires: rpm-build >= 4.6 | |
52 | BuildRequires: rpm-pythonprov | |
53 | BuildRequires: rpmbuild(macros) >= 1.749 | |
54 | BuildRequires: sed >= 4.0 | |
55 | %if %{with doc} | |
56 | BuildRequires: python3-aiohttp_theme | |
57 | BuildRequires: python3-sphinxcontrib-asyncio | |
58 | BuildRequires: python3-sphinxcontrib-blockdiag | |
59 | BuildRequires: sphinx-pdg-3 | |
60 | %endif | |
61 | Requires: python3-modules >= 1:3.6 | |
62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
63 | ||
64 | %description | |
65 | Async http client/server framework. | |
66 | ||
67 | %description -l pl.UTF-8 | |
68 | Szkielet asynchronicznego klienta/serwera http. | |
69 | ||
70 | %package apidocs | |
71 | Summary: aiohttp API documentation | |
72 | Summary(pl.UTF-8): Dokumentacja API aiohttp | |
73 | Group: Documentation | |
74 | BuildArch: noarch | |
75 | ||
76 | %description apidocs | |
77 | API documentation for aiohttp. | |
78 | ||
79 | %description apidocs -l pl.UTF-8 | |
80 | Dokumentacja API aiohttp. | |
81 | ||
82 | %prep | |
83 | %setup -q -n aiohttp-%{version} | |
84 | %patch0 -p1 | |
85 | ||
86 | %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py | |
87 | ||
88 | # adjust for python 3.7+ | |
89 | %{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py | |
90 | ||
91 | %build | |
92 | %py3_build | |
93 | ||
94 | %if %{with tests} | |
95 | # test_data_stream_exc_chain uses network | |
96 | # test_mark_formdata_as_processed requires network | |
97 | # test_client_session_timeout_zero fails on builders | |
98 | # test_requote_redirect_url_default uses network | |
99 | # test_unsupported_upgrade is marked as xfail, but succeeds | |
100 | %{__mv} tests/test_proxy_functional.py{,.disabled} # needs proxy_py binary | |
101 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
102 | PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \ | |
103 | %{__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)' | |
104 | %endif | |
105 | ||
106 | %if %{with doc} | |
107 | %{__make} -C docs html \ | |
108 | SPHINXBUILD=sphinx-build-3 \ | |
109 | SPHINXOPTS="-n" | |
110 | %endif | |
111 | ||
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %py3_install | |
116 | ||
117 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash | |
118 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{pxd,pxi,pyx} | |
119 | ||
120 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
121 | cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
122 | ||
123 | %clean | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %files | |
127 | %defattr(644,root,root,755) | |
128 | %doc CHANGES.rst CONTRIBUTORS.txt README.rst | |
129 | %dir %{py3_sitedir}/aiohttp | |
130 | %attr(755,root,root) %{py3_sitedir}/aiohttp/*.so | |
131 | %{py3_sitedir}/aiohttp/*.py | |
132 | %{py3_sitedir}/aiohttp/*.pyi | |
133 | %{py3_sitedir}/aiohttp/py.typed | |
134 | %{py3_sitedir}/aiohttp/__pycache__ | |
135 | %{py3_sitedir}/aiohttp-%{version}-py*.egg-info | |
136 | %{_examplesdir}/%{name}-%{version} | |
137 | ||
138 | %if %{with doc} | |
139 | %files apidocs | |
140 | %defattr(644,root,root,755) | |
141 | %doc docs/_build/html/* | |
142 | %endif |