]> git.pld-linux.org Git - packages/python3-aiohttp.git/blob - python3-aiohttp.spec
- updated to 3.8.3
[packages/python3-aiohttp.git] / python3-aiohttp.spec
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.3
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:  642653db642be1508e50fcdeafe0f928
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-pythonprov
52 BuildRequires:  rpmbuild(macros) >= 1.749
53 BuildRequires:  sed >= 4.0
54 %if %{with doc}
55 BuildRequires:  python3-aiohttp_theme
56 BuildRequires:  python3-sphinxcontrib-asyncio
57 BuildRequires:  python3-sphinxcontrib-blockdiag
58 BuildRequires:  sphinx-pdg-3
59 %endif
60 Requires:       python3-modules >= 1:3.6
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 %description
64 Async http client/server framework.
65
66 %description -l pl.UTF-8
67 Szkielet asynchronicznego klienta/serwera http.
68
69 %package apidocs
70 Summary:        aiohttp API documentation
71 Summary(pl.UTF-8):      Dokumentacja API aiohttp
72 Group:          Documentation
73 BuildArch:      noarch
74
75 %description apidocs
76 API documentation for aiohttp.
77
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API aiohttp.
80
81 %prep
82 %setup -q -n aiohttp-%{version}
83 %patch0 -p1
84
85 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' examples/*.py
86
87 # adjust for python 3.7+
88 %{__sed} -i -e '/^from async_generator/d; /^ *@async_generator/d; s/await yield_/yield/' tests/*.py
89
90 %build
91 %py3_build
92
93 %if %{with tests}
94 # test_data_stream_exc_chain uses network
95 # test_mark_formdata_as_processed requires network
96 # test_client_session_timeout_zero fails on builders
97 # test_requote_redirect_url_default uses network
98 # test_unsupported_upgrade is marked as xfail, but succeeds
99 %{__mv} tests/test_proxy_functional.py{,.disabled} # needs proxy_py binary
100 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
101 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
102 %{__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)'
103 %endif
104
105 %if %{with doc}
106 %{__make} -C docs html \
107         SPHINXBUILD=sphinx-build-3 \
108         SPHINXOPTS="-n"
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 %py3_install
115
116 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/.hash
117 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/aiohttp/*.{pxd,pxi,pyx}
118
119 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %files
126 %defattr(644,root,root,755)
127 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
128 %dir %{py3_sitedir}/aiohttp
129 %attr(755,root,root) %{py3_sitedir}/aiohttp/*.so
130 %{py3_sitedir}/aiohttp/*.py
131 %{py3_sitedir}/aiohttp/*.pyi
132 %{py3_sitedir}/aiohttp/py.typed
133 %{py3_sitedir}/aiohttp/__pycache__
134 %{py3_sitedir}/aiohttp-%{version}-py*.egg-info
135 %{_examplesdir}/%{name}-%{version}
136
137 %if %{with doc}
138 %files apidocs
139 %defattr(644,root,root,755)
140 %doc docs/_build/html/*
141 %endif
This page took 0.107105 seconds and 3 git commands to generate.