- tests BR: python3-freezegun
[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
8c252e87 27BuildRequires: python3-freezegun
de491045
JB
28BuildRequires: python3-gunicorn
29%if "%{py3_ver}" < "3.7"
30BuildRequires: python3-idna-ssl
31%endif
32BuildRequires: python3-multidict >= 4.5
33BuildRequires: python3-pytest >= 3.8.2
34BuildRequires: python3-pytest-cov
35BuildRequires: python3-pytest-mock
36BuildRequires: python3-re_assert
37BuildRequires: python3-typing_extensions >= 3.6.5
38BuildRequires: python3-yarl >= 1.0
39%endif
40BuildRequires: rpm-pythonprov
41BuildRequires: rpmbuild(macros) >= 1.714
42# if using noarchpackage, replace with:
43#BuildRequires: rpmbuild(macros) >= 1.752
44BuildRequires: sed >= 4.0
45%if %{with doc}
46BuildRequires: python3-aiohttp_theme
47BuildRequires: python3-sphinxcontrib-asyncio
48BuildRequires: python3-sphinxcontrib-blockdiag
49BuildRequires: sphinx-pdg-3
50%endif
51# replace with other requires if defined in setup.py
52Requires: python3-modules >= 1:3.6
53BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55%description
56Async http client/server framework.
57
58%description -l pl.UTF-8
59Szkielet asynchronicznego klienta/serwera http.
60
61%package apidocs
62Summary: aiohttp API documentation
63Summary(pl.UTF-8): Dokumentacja API aiohttp
64Group: Documentation
65%{?noarchpackage}
66
67%description apidocs
68API documentation for aiohttp.
69
70%description apidocs -l pl.UTF-8
71Dokumentacja API aiohttp.
72
73%prep
74%setup -q -n aiohttp-%{version}
75%patch0 -p1
76
77%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py examples/legacy/*.py
78
79# adjust for python 3.7+
80%{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
81
82# until we have pytest >= 6:
83%{__sed} -i -e '/assert_outcomes/ s/errors=/error=/' tests/test_pytest_plugin.py
84
85%build
86%py3_build
87
88%if %{with tests}
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?)
91PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
92PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
93%{__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)'
94%endif
95
96%if %{with doc}
97%{__make} -C docs html \
98 SPHINXBUILD=sphinx-build-3
99%endif
100
101%install
102rm -rf $RPM_BUILD_ROOT
103
104%py3_install
105
106%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
107%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{c,h,pxd,pxi,pyx}
108
109install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111
112%clean
113rm -rf $RPM_BUILD_ROOT
114
115%files
116%defattr(644,root,root,755)
117%doc CHANGES.rst CONTRIBUTORS.txt README.rst
118%dir %{py3_sitedir}/aiohttp
119%attr(755,root,root) %{py3_sitedir}/aiohttp/*.so
120%{py3_sitedir}/aiohttp/*.py
121%{py3_sitedir}/aiohttp/*.pyi
122%{py3_sitedir}/aiohttp/py.typed
123%{py3_sitedir}/aiohttp/__pycache__
124%{py3_sitedir}/aiohttp-%{version}-py*.egg-info
125%{_examplesdir}/%{name}-%{version}
126
127%if %{with doc}
128%files apidocs
129%defattr(644,root,root,755)
130%doc docs/_build/html/*
131%endif
This page took 0.046925 seconds and 4 git commands to generate.