]> git.pld-linux.org Git - packages/python-httplib2.git/blame - python-httplib2.spec
- added mock patch (prefer unittest.mock from stdlib on python3)
[packages/python-httplib2.git] / python-httplib2.spec
CommitLineData
dd8b4942
JR
1#
2# Conditional build:
ebcdddb2 3%bcond_without python2 # Python 2.x module
dd8b4942 4%bcond_without python3 # Python 3.x module
ebcdddb2
JB
5%bcond_without doc # Sphinx documentation
6%bcond_without tests # unit tests
dd8b4942 7
2f9adc1a 8Summary: A comprehensive HTTP client library
190dfc00 9Summary(pl.UTF-8): Obszerna biblioteka klienta HTTP
2f9adc1a 10Name: python-httplib2
8625bb39
AM
11Version: 0.17.0
12Release: 1
2f9adc1a
ER
13License: MIT
14Group: Development/Languages/Python
ebcdddb2
JB
15#Source0Download: https://github.com/httplib2/httplib2/releases
16# TODO: https://github.com/httplib2/httplib2/archive/v%{version}/httplib2-%{version}.tar.gz
5007a437 17Source0: https://github.com/httplib2/httplib2/archive/v%{version}.tar.gz
8625bb39 18# Source0-md5: fbd0b80a32a4cbb1c3c459294e3a1065
5007a437 19Patch0: %{name}.certfile.patch
b9a87db1 20Patch1: %{name}-0.9-proxy-http.patch
ebcdddb2 21Patch2: %{name}-mock.patch
5007a437 22URL: https://github.com/httplib2/httplib2
ebcdddb2
JB
23%if %{with python2}
24BuildRequires: python-modules >= 1:2.7
25BuildRequires: python-setuptools
26%if %{with tests}
27BuildRequires: python-future >= 0.16.0
28BuildRequires: python-mock >= 2.0.0
29BuildRequires: python-pytest >= 3.2.1
30BuildRequires: python-pytest-cov >= 2.5.1
31BuildRequires: python-pytest-timeout >= 1.2.0
32BuildRequires: python-six >= 1.10.0
33%endif
34%endif
dd8b4942 35%if %{with python3}
ebcdddb2
JB
36BuildRequires: python3-modules >= 1:3.4
37BuildRequires: python3-setuptools
38%if %{with tests}
39BuildRequires: python3-pytest >= 3.2.1
40BuildRequires: python3-pytest-cov >= 2.5.1
41BuildRequires: python3-pytest-timeout >= 1.2.0
42BuildRequires: python3-six >= 1.10.0
43%endif
dd8b4942 44%endif
a725a8a2 45BuildRequires: rpm-pythonprov
ebcdddb2
JB
46BuildRequires: rpmbuild(macros) >= 1.710
47%if %{with doc}
48BuildRequires: sphinx-pdg
49%endif
5007a437 50Requires: ca-certificates
2f9adc1a
ER
51BuildArch: noarch
52BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54%description
55A comprehensive HTTP client library, httplib2.py supports many
190dfc00 56features left out of other HTTP libraries. Supports:
2f9adc1a
ER
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
190dfc00
JB
67%description -l pl.UTF-8
68httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele
69cech 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
dd8b4942
JR
80%package -n python3-httplib2
81Summary: A comprehensive HTTP client library
82Summary(pl.UTF-8): Obszerna biblioteka klienta HTTP
83Group: Development/Languages/Python
ebcdddb2 84Requires: ca-certificates
dd8b4942
JR
85
86%description -n python3-httplib2
87A comprehensive HTTP client library, httplib2.py supports many
88features 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
100httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele
101cech 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
2f9adc1a
ER
112%prep
113%setup -q -n httplib2-%{version}
5007a437
AM
114%patch0 -p1
115%patch1 -p1
ebcdddb2 116%patch2 -p1
2f9adc1a 117
af4b3757 118%build
ebcdddb2 119%if %{with python2}
af4b3757
JK
120%py_build
121
ebcdddb2
JB
122%if %{with tests}
123PYTHONPATH=$(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
dd8b4942 128%if %{with python3}
af4b3757 129%py3_build
ebcdddb2
JB
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
133PYTHONPATH=$(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
dd8b4942
JR
140%endif
141
2f9adc1a
ER
142%install
143rm -rf $RPM_BUILD_ROOT
ebcdddb2
JB
144
145%if %{with python2}
af4b3757 146%py_install
ebcdddb2
JB
147
148%py_postclean
149%{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/httplib2/cacerts.txt
150%endif
dd8b4942
JR
151
152%if %{with python3}
af4b3757 153%py3_install
2f9adc1a 154
ebcdddb2
JB
155%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/httplib2/cacerts.txt
156%endif
2f9adc1a
ER
157
158%clean
159rm -rf $RPM_BUILD_ROOT
160
ebcdddb2 161%if %{with python2}
2f9adc1a
ER
162%files
163%defattr(644,root,root,755)
ebcdddb2 164%doc CHANGELOG LICENSE README.md
dd8b4942
JR
165%{py_sitescriptdir}/httplib2
166%{py_sitescriptdir}/httplib2-%{version}-py*.egg-info
ebcdddb2 167%endif
dd8b4942 168
5007a437 169%if %{with python3}
dd8b4942
JR
170%files -n python3-httplib2
171%defattr(644,root,root,755)
ebcdddb2 172%doc CHANGELOG LICENSE README.md python3/README
dd8b4942
JR
173%{py3_sitescriptdir}/httplib2
174%{py3_sitescriptdir}/httplib2-%{version}-py*.egg-info
5007a437 175%endif
This page took 0.10879 seconds and 4 git commands to generate.