- new
[packages/python3-aiohttp.git] / python3-aiohttp.spec
CommitLineData
de491045
JB
1#
2# Conditional build:
3%bcond_without doc # API documentation
4%bcond_without tests # unit tests
5
6%define module template
7Summary: Async http client/server framework
8Summary(pl.UTF-8): Szkielet asynchronicznego klienta/serwera http
9Name: python3-aiohttp
10Version: 3.7.3
11Release: 1
12License: Apache v2.0
13Group: Libraries/Python
14#Source0Download: https://pypi.org/simple/aiohttp/
15Source0: 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
18Patch0: %{name}-brotli.patch
19URL: https://pypi.org/project/aiohttp/
20BuildRequires: python3-devel >= 1:3.6
21BuildRequires: python3-setuptools
22%if %{with tests}
23BuildRequires: python3-async_timeout >= 3.0
24BuildRequires: python3-attrs >= 17.3.0
25BuildRequires: python3-brotli
26BuildRequires: python3-chardet >= 2.0
27BuildRequires: python3-gunicorn
28%if "%{py3_ver}" < "3.7"
29BuildRequires: python3-idna-ssl
30%endif
31BuildRequires: python3-multidict >= 4.5
32BuildRequires: python3-pytest >= 3.8.2
33BuildRequires: python3-pytest-cov
34BuildRequires: python3-pytest-mock
35BuildRequires: python3-re_assert
36BuildRequires: python3-typing_extensions >= 3.6.5
37BuildRequires: python3-yarl >= 1.0
38%endif
39BuildRequires: rpm-pythonprov
40BuildRequires: rpmbuild(macros) >= 1.714
41# if using noarchpackage, replace with:
42#BuildRequires: rpmbuild(macros) >= 1.752
43BuildRequires: sed >= 4.0
44%if %{with doc}
45BuildRequires: python3-aiohttp_theme
46BuildRequires: python3-sphinxcontrib-asyncio
47BuildRequires: python3-sphinxcontrib-blockdiag
48BuildRequires: sphinx-pdg-3
49%endif
50# replace with other requires if defined in setup.py
51Requires: python3-modules >= 1:3.6
52BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54%description
55Async http client/server framework.
56
57%description -l pl.UTF-8
58Szkielet asynchronicznego klienta/serwera http.
59
60%package apidocs
61Summary: aiohttp API documentation
62Summary(pl.UTF-8): Dokumentacja API aiohttp
63Group: Documentation
64%{?noarchpackage}
65
66%description apidocs
67API documentation for aiohttp.
68
69%description apidocs -l pl.UTF-8
70Dokumentacja API aiohttp.
71
72%prep
73%setup -q -n aiohttp-%{version}
74%patch0 -p1
75
76%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py examples/legacy/*.py
77
78# adjust for python 3.7+
79%{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
80
81# until we have pytest >= 6:
82%{__sed} -i -e '/assert_outcomes/ s/errors=/error=/' tests/test_pytest_plugin.py
83
84%build
85%py3_build
86
87%if %{with tests}
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?)
90PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
91PYTEST_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)'
93%endif
94
95%if %{with doc}
96%{__make} -C docs html \
97 SPHINXBUILD=sphinx-build-3
98%endif
99
100%install
101rm -rf $RPM_BUILD_ROOT
102
103%py3_install
104
105%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
106%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{c,h,pxd,pxi,pyx}
107
108install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
109cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110
111%clean
112rm -rf $RPM_BUILD_ROOT
113
114%files
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}
125
126%if %{with doc}
127%files apidocs
128%defattr(644,root,root,755)
129%doc docs/_build/html/*
130%endif
This page took 0.053004 seconds and 4 git commands to generate.