]> git.pld-linux.org Git - packages/python3-requests.git/blob - python-requests.spec
ef97b737466b871f1744071eed47592ddf2b20d7
[packages/python3-requests.git] / python-requests.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # test target [Pipfile file missing as of 2.19.1]
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         urllib3_ver     1.21.1
8 %define         module          requests
9 %define         egg_name        requests
10 Summary:        HTTP library for Python 2
11 Summary(pl.UTF-8):      Biblioteka HTTP dla Pythona 2
12 Name:           python-%{module}
13 Version:        2.26.0
14 Release:        1
15 License:        Apache v2.0
16 Group:          Development/Languages/Python
17 #Source0Download: https://pypi.org/simple/requests/
18 Source0:        https://files.pythonhosted.org/packages/source/r/requests/%{module}-%{version}.tar.gz
19 # Source0-md5:  8c745949ad3e9ae83d9927fed213db8a
20 Patch0:         system-cert.patch
21 URL:            http://python-requests.org/
22 BuildRequires:  rpm-pythonprov
23 BuildRequires:  rpmbuild(macros) >= 1.713
24 %if %{with python2}
25 BuildRequires:  python-modules >= 1:2.7
26 BuildRequires:  python-setuptools
27 %if %{with tests}
28 BuildRequires:  python-PySocks >= 1.5.8
29 BuildRequires:  python-certifi >= 2017.4.17
30 BuildRequires:  python-chardet >= 3.0.2
31 BuildRequires:  python-chardet < 4
32 # idna 3 not supported for python2
33 BuildRequires:  python-idna >= 2.5
34 BuildRequires:  python-idna < 3
35 BuildRequires:  python-pytest >= 3
36 BuildRequires:  python-pytest-cov
37 BuildRequires:  python-pytest-httpbin >= 0.0.7
38 BuildRequires:  python-pytest-mock
39 BuildRequires:  python-pytest-xdist
40 BuildRequires:  python-urllib3 >= %{urllib3_ver}
41 BuildRequires:  python-urllib3 < 1.26
42 %endif
43 %endif
44 %if %{with python3}
45 BuildRequires:  python3-modules >= 1:3.6
46 BuildRequires:  python3-setuptools
47 %if %{with tests}
48 BuildRequires:  python3-PySocks >= 1.5.8
49 BuildRequires:  python3-certifi >= 2017.4.17
50 BuildRequires:  python3-chardet >= 3.0.2
51 BuildRequires:  python3-chardet < 4
52 BuildRequires:  python3-idna >= 2.5
53 BuildRequires:  python3-idna
54 BuildRequires:  python3-pytest >= 3
55 BuildRequires:  python3-pytest-cov
56 BuildRequires:  python3-pytest-httpbin >= 0.0.7
57 BuildRequires:  python3-pytest-mock
58 BuildRequires:  python3-pytest-xdist
59 BuildRequires:  python3-urllib3 >= %{urllib3_ver}
60 BuildRequires:  python3-urllib3 < 1.26
61 %endif
62 %endif
63 Suggests:       ca-certificates
64 # for python2 only to get SNI working. python3 doesn't need this
65 Requires:       python-cryptography >= 1.3.4
66 Requires:       python-pyOpenSSL >= 0.14
67 Requires:       python-urllib3 >= 1.22-2
68 BuildArch:      noarch
69 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70
71 %description
72 Requests is a HTTP library, written in Python, for human beings.
73
74 Most existing Python modules for sending HTTP requests are extremely
75 verbose and cumbersome. Python's builtin urllib2 module provides most
76 of the HTTP capabilities you should need, but the API is thoroughly
77 broken. It requires an enormous amount of work (even method overrides)
78 to perform the simplest of tasks. Things shouldn't be this way. Not in
79 Python.
80
81 This package contains Python 2.x module.
82
83 %description -l pl.UTF-8
84 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
85
86 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
87 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
88 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
89 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
90 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
91
92 Ten pakiet zawiera moduł dla Pythona 2.x.
93
94 %package -n python3-requests
95 Summary:        HTTP library for Python 3
96 Summary(pl.UTF-8):      Biblioteka HTTP dla Pythona 3
97 Group:          Development/Languages/Python
98 Requires:       python3-modules >= 1:3.6
99 # for https
100 Requires:       python3-cryptography >= 1.3.4
101 Requires:       python3-pyOpenSSL >= 0.14
102 Requires:       python3-urllib3 >= 1.22-2
103 Suggests:       ca-certificates
104
105 %description -n python3-requests
106 Requests is a HTTP library, written in Python, for human beings.
107
108 Most existing Python modules for sending HTTP requests are extremely
109 verbose and cumbersome. Python's builtin urllib2 module provides most
110 of the HTTP capabilities you should need, but the api is thoroughly
111 broken. It requires an enormous amount of work (even method overrides)
112 to perform the simplest of tasks. Things shouldn't be this way. Not in
113 Python.
114
115 This package contains Python 3.x module.
116
117 %description -n python3-requests -l pl.UTF-8
118 Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
119
120 Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
121 zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
122 zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
123 wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
124 najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
125
126 Ten pakiet zawiera moduł dla Pythona 3.x.
127
128 %prep
129 %setup -q -n %{module}-%{version}
130 %patch0 -p1
131
132 %build
133 %if %{with python2}
134 %py_build %{?with_tests:test}
135 %endif
136
137 %if %{with python3}
138 %py3_build %{?with_tests:test}
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with python2}
145 %py_install
146 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
147 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
148 %py_postclean
149 %endif
150
151 %if %{with python3}
152 %py3_install
153 %endif
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %if %{with python2}
159 %files
160 %defattr(644,root,root,755)
161 %doc HISTORY.md README.md
162 %{py_sitescriptdir}/%{module}
163 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
164 %endif
165
166 %if %{with python3}
167 %files -n python3-requests
168 %defattr(644,root,root,755)
169 %doc HISTORY.md README.md
170 %{py3_sitescriptdir}/%{module}
171 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
172 %endif
This page took 0.042043 seconds and 2 git commands to generate.