]> git.pld-linux.org Git - packages/python-httplib2.git/blob - python-httplib2.spec
- added mock patch (prefer unittest.mock from stdlib on python3)
[packages/python-httplib2.git] / python-httplib2.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # Python 2.x module
4 %bcond_without  python3 # Python 3.x module
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7
8 Summary:        A comprehensive HTTP client library
9 Summary(pl.UTF-8):      Obszerna biblioteka klienta HTTP
10 Name:           python-httplib2
11 Version:        0.17.0
12 Release:        1
13 License:        MIT
14 Group:          Development/Languages/Python
15 #Source0Download: https://github.com/httplib2/httplib2/releases
16 # TODO:         https://github.com/httplib2/httplib2/archive/v%{version}/httplib2-%{version}.tar.gz
17 Source0:        https://github.com/httplib2/httplib2/archive/v%{version}.tar.gz
18 # Source0-md5:  fbd0b80a32a4cbb1c3c459294e3a1065
19 Patch0:         %{name}.certfile.patch
20 Patch1:         %{name}-0.9-proxy-http.patch
21 Patch2:         %{name}-mock.patch
22 URL:            https://github.com/httplib2/httplib2
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-future >= 0.16.0
28 BuildRequires:  python-mock >= 2.0.0
29 BuildRequires:  python-pytest >= 3.2.1
30 BuildRequires:  python-pytest-cov >= 2.5.1
31 BuildRequires:  python-pytest-timeout >= 1.2.0
32 BuildRequires:  python-six >= 1.10.0
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-modules >= 1:3.4
37 BuildRequires:  python3-setuptools
38 %if %{with tests}
39 BuildRequires:  python3-pytest >= 3.2.1
40 BuildRequires:  python3-pytest-cov >= 2.5.1
41 BuildRequires:  python3-pytest-timeout >= 1.2.0
42 BuildRequires:  python3-six >= 1.10.0
43 %endif
44 %endif
45 BuildRequires:  rpm-pythonprov
46 BuildRequires:  rpmbuild(macros) >= 1.710
47 %if %{with doc}
48 BuildRequires:  sphinx-pdg
49 %endif
50 Requires:       ca-certificates
51 BuildArch:      noarch
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %description
55 A comprehensive HTTP client library, httplib2.py supports many
56 features left out of other HTTP libraries. Supports:
57 - HTTP and HTTPS
58 - Keep-Alive
59 - Authentication
60 - Caching
61 - All Methods
62 - Redirects
63 - Compression
64 - Lost update support
65 - Unit Tested
66
67 %description -l pl.UTF-8
68 httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele
69 cech pomijanych przez inne biblioteki. Obsługuje:
70 - HTTP i HTTPS
71 - Keep-Alive
72 - uwierzytelnianie
73 - buforowanie
74 - wszystkie metody
75 - przekierowania
76 - kompresję
77 - Lost update
78 - podlega testom jednostkowym.
79
80 %package -n python3-httplib2
81 Summary:        A comprehensive HTTP client library
82 Summary(pl.UTF-8):      Obszerna biblioteka klienta HTTP
83 Group:          Development/Languages/Python
84 Requires:       ca-certificates
85
86 %description -n python3-httplib2
87 A comprehensive HTTP client library, httplib2.py supports many
88 features left out of other HTTP libraries. Supports:
89 - HTTP and HTTPS
90 - Keep-Alive
91 - Authentication
92 - Caching
93 - All Methods
94 - Redirects
95 - Compression
96 - Lost update support
97 - Unit Tested
98
99 %description -n python3-httplib2 -l pl.UTF-8
100 httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele
101 cech pomijanych przez inne biblioteki. Obsługuje:
102 - HTTP i HTTPS
103 - Keep-Alive
104 - uwierzytelnianie
105 - buforowanie
106 - wszystkie metody
107 - przekierowania
108 - kompresję
109 - Lost update
110 - podlega testom jednostkowym.
111
112 %prep
113 %setup -q -n httplib2-%{version}
114 %patch0 -p1
115 %patch1 -p1
116 %patch2 -p1
117
118 %build
119 %if %{with python2}
120 %py_build
121
122 %if %{with tests}
123 PYTHONPATH=$(pwd)/build-2/lib \
124 %{__python} -m pytest tests -k 'not test_certs_file_from_builtin and not test_certs_file_from_environment and not test_with_certifi_removed_from_modules and not test_noproxy_star'
125 %endif
126 %endif
127
128 %if %{with python3}
129 %py3_build
130
131 %if %{with tests}
132 # in python3 implementation system socks module is preferred over httplib2.socks, and the first is incompatible with test_socks5_auth
133 PYTHONPATH=$(pwd)/build-3/lib \
134 %{__python3} -m pytest tests -k 'not test_certs_file_from_builtin and not test_certs_file_from_environment and not test_with_certifi_removed_from_modules and not test_noproxy_star and not test_server_not_found_error_is_raised_for_invalid_hostname and not test_socks5_auth'
135 %endif
136 %endif
137
138 %if %{with doc}
139 %{__make} -C doc html
140 %endif
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144
145 %if %{with python2}
146 %py_install
147
148 %py_postclean
149 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/httplib2/cacerts.txt
150 %endif
151
152 %if %{with python3}
153 %py3_install
154
155 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/httplib2/cacerts.txt
156 %endif
157
158 %clean
159 rm -rf $RPM_BUILD_ROOT
160
161 %if %{with python2}
162 %files
163 %defattr(644,root,root,755)
164 %doc CHANGELOG LICENSE README.md
165 %{py_sitescriptdir}/httplib2
166 %{py_sitescriptdir}/httplib2-%{version}-py*.egg-info
167 %endif
168
169 %if %{with python3}
170 %files -n python3-httplib2
171 %defattr(644,root,root,755)
172 %doc CHANGELOG LICENSE README.md python3/README
173 %{py3_sitescriptdir}/httplib2
174 %{py3_sitescriptdir}/httplib2-%{version}-py*.egg-info
175 %endif
This page took 0.091578 seconds and 3 git commands to generate.