Remove tests stuff
[packages/centos7/python-setuptools.git] / python-setuptools.spec
1 %if 0%{?fedora}
2 %global with_python3 1
3 %global with_check 1
4
5 # This controls whether setuptools is build as a wheel or not,
6 # simplifying Python 3.4 bootstraping process
7 %if %{fedora} > 20
8 %global build_wheel 1
9 %endif
10
11 %else
12 %global with_check 0
13 # define some macros for RHEL 6
14 %global __python2 %__python
15 %global python2_sitelib %python_sitelib
16 %endif
17
18 # Override for MOS
19 %global with_python3 1
20
21 %global srcname setuptools
22 %if 0%{?build_wheel}
23 %global python2_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
24 %global python2_record %{python2_sitelib}/%{srcname}-%{version}.dist-info/RECORD
25 %if 0%{?with_python3}
26 %global python3_wheelname %python2_wheelname
27 %global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD
28 %endif
29 %endif
30
31 Name:           python-setuptools
32 Version:        17.1.1
33 Release:        3%{?dist}~mos1
34 Summary:        Easily build and distribute Python packages
35
36 Group:          Applications/System
37 License:        Python or ZPLv2.0
38 URL:            https://pypi.python.org/pypi/%{srcname}
39 Source0:        %{srcname}-%{version}.tar.gz
40 Source1:        psfl.txt
41 Source2:        zpl.txt
42
43 BuildArch:      noarch
44 BuildRequires:  python2-devel
45 %if 0%{?build_wheel}
46 BuildRequires:  python-pip
47 BuildRequires:  python-wheel
48 %endif
49 %if 0%{?with_check}
50 BuildRequires:  pytest python-mock
51 %endif # with_check
52
53 %if 0%{?with_python3}
54 BuildRequires:  python3-devel
55 %if 0%{?with_check}
56 BuildRequires:  python3-pytest
57 BuildRequires:  python3-mock
58 %endif # with_check
59 %if 0%{?build_wheel}
60 BuildRequires:  python3-pip
61 BuildRequires:  python3-wheel
62 %endif # build_wheel
63 %endif # with_python3
64
65 # We're now back to setuptools as the package.
66 # Keep the python-distribute name active for a few releases.  Eventually we'll
67 # want to get rid of the Provides and just keep the Obsoletes
68 Provides: python-distribute = %{version}-%{release}
69 Obsoletes: python-distribute < 0.6.36-2
70
71 %description
72 Setuptools is a collection of enhancements to the Python distutils that allow
73 you to more easily build and distribute Python packages, especially ones that
74 have dependencies on other packages.
75
76 This package also contains the runtime components of setuptools, necessary to
77 execute the software that requires pkg_resources.py.
78
79 %if 0%{?with_python3}
80 %package -n python3-setuptools
81 Summary:        Easily build and distribute Python 3 packages
82 Group:          Applications/System
83
84 # Note: Do not need to Require python3-backports-ssl_match_hostname because it
85 # has been present since python3-3.2.  We do not ship python3-3.0 or
86 # python3-3.1 anywhere
87
88 %description -n python3-setuptools
89 Setuptools is a collection of enhancements to the Python 3 distutils that allow
90 you to more easily build and distribute Python 3 packages, especially ones that
91 have dependencies on other packages.
92
93 This package also contains the runtime components of setuptools, necessary to
94 execute the software that requires pkg_resources.py.
95
96 %endif # with_python3
97
98 %prep
99 %setup -q -n %{srcname}-%{version}
100
101 # We can't remove .egg-info (but it doesn't matter, since it'll be rebuilt):
102 #  The problem is that to properly execute setuptools' setup.py,
103 #   it is needed for setuptools to be loaded as a Distribution
104 #   (with egg-info or .dist-info dir), it's not sufficient
105 #   to just have them on PYTHONPATH
106 #  Running "setup.py install" without having setuptools installed
107 #   as a distribution gives warnings such as
108 #    ... distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
109 #   and doesn't create "easy_install" and .egg-info directory
110 # Note: this is only a problem if bootstrapping wheel or building on RHEL,
111 #  otherwise setuptools are installed as dependency into buildroot
112
113 # Remove bundled exes
114 rm -f setuptools/*.exe
115 # These tests require internet connection
116 rm setuptools/tests/test_integration.py 
117
118 %if 0%{?with_python3}
119 rm -rf %{py3dir}
120 cp -a . %{py3dir}
121 %endif # with_python3
122
123 %build
124 %if 0%{?build_wheel}
125 %{__python} setup.py bdist_wheel
126 %else
127 %{__python} setup.py build
128 %endif
129
130 %if 0%{?with_python3}
131 pushd %{py3dir}
132 %if 0%{?build_wheel}
133 %{__python3} setup.py bdist_wheel
134 %else
135 %{__python3} setup.py build
136 %endif
137 popd
138 %endif # with_python3
139
140 %install
141 # Must do the python3 install first because the scripts in /usr/bin are
142 # overwritten with every setup.py install (and we want the python2 version
143 # to be the default for now).
144 %if 0%{?with_python3}
145 pushd %{py3dir}
146 %if 0%{?build_wheel}
147 pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
148
149 # TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have to
150 # (pip install wheel doesn't overwrite)
151 rm %{buildroot}%{_bindir}/easy_install
152
153 sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
154 %else
155 %{__python3} setup.py install --skip-build --root %{buildroot}
156 %endif
157
158 rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
159 %if 0%{?build_wheel}
160 sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
161 %endif
162
163 install -p -m 0644 %{SOURCE1} %{SOURCE2} %{py3dir}
164 find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
165 chmod +x %{buildroot}%{python3_sitelib}/setuptools/command/easy_install.py
166 popd
167 %endif # with_python3
168
169 %if 0%{?build_wheel}
170 pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
171 %else
172 %{__python2} setup.py install --skip-build --root %{buildroot}
173 %endif
174
175 rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests
176 %if 0%{?build_wheel}
177 sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}
178 %endif
179
180 install -p -m 0644 %{SOURCE1} %{SOURCE2} .
181 find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f
182 chmod +x %{buildroot}%{python2_sitelib}/setuptools/command/easy_install.py
183
184 %if 0%{?with_check}
185 %check
186 LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test
187
188 %if 0%{?with_python3}
189 pushd %{py3dir}
190 LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version}
191 popd
192 %endif # with_python3
193 %endif # with_check
194
195 %files
196 %doc *.txt docs
197 %{python2_sitelib}/*
198 %{_bindir}/easy_install
199 %{_bindir}/easy_install-2.*
200
201 %if 0%{?with_python3}
202 %files -n python3-setuptools
203 %doc psfl.txt zpl.txt docs
204 %{python3_sitelib}/*
205 %{_bindir}/easy_install-3.*
206 %endif # with_python3
207
208 %changelog
209 * Mon Sep 14 2015 Mikhail Ivanov <mivanov@mirantis.com> - 17.1.1-3~mos8.0.1
210 - Make source local
211 - Based on source and .spec from
212   https://kojipkgs.fedoraproject.org//packages/python-setuptools/17.1.1/3.fc22/src/python-setuptools-17.1.1-3.fc22.src.rpm
213 - Enable Python 3
214
215 * Sat Jun 20 2015 Kevin Fenzi <kevin@scrye.com> 17.1.1-3
216 - Drop no longer needed Requires/BuildRequires on python-backports-ssl_match_hostname
217 - Fixes bug #1231325
218
219 * Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 17.1.1-2
220 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
221
222 * Wed Jun 10 2015 Kevin Fenzi <kevin@scrye.com> 17.1.1-1
223 - Update to 17.1.1. Fixes bug 1229507
224
225 * Sun Jun 07 2015 Kevin Fenzi <kevin@scrye.com> 17.1-1
226 - Update to 17.1. Fixes bug 1229066
227
228 * Sat May 30 2015 Kevin Fenzi <kevin@scrye.com> 17.0-1
229 - Update to 17
230
231 * Mon May 18 2015 Kevin Fenzi <kevin@scrye.com> 16.0-1
232 - Update to 16
233
234 * Mon Apr 27 2015 Ralph Bean <rbean@redhat.com> - 15.2-1
235 - new version
236
237 * Sat Apr 04 2015 Ralph Bean <rbean@redhat.com> - 15.0-1
238 - new version
239
240 * Sun Mar 22 2015 Ralph Bean <rbean@redhat.com> - 14.3.1-1
241 - new version
242
243 * Sat Mar 21 2015 Ralph Bean <rbean@redhat.com> - 14.3.1-1
244 - new version
245
246 * Mon Mar 16 2015 Ralph Bean <rbean@redhat.com> - 14.3-1
247 - new version
248
249 * Sun Mar 15 2015 Ralph Bean <rbean@redhat.com> - 14.2-1
250 - new version
251
252 * Sun Mar 15 2015 Ralph Bean <rbean@redhat.com> - 14.1.1-1
253 - new version
254
255 * Fri Mar 06 2015 Ralph Bean <rbean@redhat.com> - 13.0.2-1
256 - new version
257
258 * Thu Mar 05 2015 Ralph Bean <rbean@redhat.com> - 12.4-1
259 - new version
260
261 * Fri Feb 27 2015 Ralph Bean <rbean@redhat.com> - 12.3-1
262 - new version
263
264 * Tue Jan 20 2015 Kevin Fenzi <kevin@scrye.com> 12.0.3-1
265 - Update to 12.0.3
266
267 * Fri Jan 09 2015 Slavek Kabrda <bkabrda@redhat.com> - 11.3.1-2
268 - Huge spec cleanup
269 - Make spec buildable on all Fedoras and RHEL 6 and 7
270 - Make tests actually run
271
272 * Wed Jan 07 2015 Kevin Fenzi <kevin@scrye.com> 11.3.1-1
273 - Update to 11.3.1. Fixes bugs: #1179393 and #1178817
274
275 * Sun Jan 04 2015 Kevin Fenzi <kevin@scrye.com> 11.0-1
276 - Update to 11.0. Fixes bug #1178421
277
278 * Fri Dec 26 2014 Kevin Fenzi <kevin@scrye.com> 8.2.1-1
279 - Update to 8.2.1. Fixes bug #1175229
280
281 * Thu Oct 23 2014 Ralph Bean <rbean@redhat.com> - 7.0-1
282 - Latest upstream.  Fixes bug #1154590.
283
284 * Mon Oct 13 2014 Ralph Bean <rbean@redhat.com> - 6.1-1
285 - Latest upstream.  Fixes bug #1152130.
286
287 * Sat Oct 11 2014 Ralph Bean <rbean@redhat.com> - 6.0.2-2
288 - Modernized python2 macros.
289 - Inlined locale environment variables in the %%check section.
290 - Remove bundled egg-info and .exes.
291
292 * Fri Oct 03 2014 Kevin Fenzi <kevin@scrye.com> 6.0.2-1
293 - Update to 6.0.2
294
295 * Sat Sep 27 2014 Kevin Fenzi <kevin@scrye.com> 6.0.1-1
296 - Update to 6.0.1. Fixes bug #1044444
297
298 * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-8
299 - Remove the python-setuptools-devel Virtual Provides as per this Fedora 21
300   Change: http://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel
301
302 * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-7
303 - And another bug in sdist
304
305 * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-6
306 - Fix a bug in the sdist command
307
308 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-5
309 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
310
311 * Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.0-4
312 - Rebuild as wheel for Python 3.4
313
314 * Thu Apr 24 2014 Tomas Radej <tradej@redhat.com> - 2.0-3
315 - Rebuilt for tag f21-python
316
317 * Wed Apr 23 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.0-2
318 - Add a switch to build setuptools as wheel
319
320 * Mon Dec  9 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-1
321 - Update to new upstream release with a few things removed from the API:
322   Changelog: https://pypi.python.org/pypi/setuptools#id139
323
324 * Mon Nov 18 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.4-1
325 - Update to 1.4 that gives easy_install pypi credential handling
326
327 * Thu Nov  7 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3.1-1
328 - Minor upstream update to reign in overzealous warnings
329
330 * Mon Nov  4 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3-1
331 - Upstream update that pulls in our security patches
332
333 * Mon Oct 28 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.7-1
334 - Update to newer upstream release that has our patch to the unittests
335 - Fix for http://bugs.python.org/issue17997#msg194950 which affects us since
336   setuptools copies that code. Changed to use
337   python-backports-ssl_match_hostname so that future issues can be fixed in
338   that package.
339
340 * Sat Oct 26 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.6-1
341 - Update to newer upstream release.  Some minor incompatibilities listed but
342   they should affect few, if any consumers.
343
344 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-2
345 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
346
347 * Tue Jul 23 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.9.6-1
348 - Upstream update -- just fixes python-2.4 compat
349
350 * Tue Jul 16 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.9.5-1
351 - Update to 0.9.5
352   - package_index can handle hashes other than md5
353   - Fix security vulnerability in SSL certificate validation
354   - https://bugzilla.redhat.com/show_bug.cgi?id=963260
355
356 * Fri Jul  5 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8-1
357 - Update to upstream 0.8  release.  Codebase now runs on anything from
358   python-2.4 to python-3.3 without having to be translated by 2to3.
359
360 * Wed Jul  3 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.7-1
361 - Update to 0.7.7 upstream release
362
363 * Mon Jun 10 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.2-2
364 - Update to the setuptools-0.7 branch that merges distribute and setuptools
365
366 * Thu Apr 11 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.36-1
367 - Update to upstream 0.6.36.  Many bugfixes
368
369 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.28-4
370 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
371
372 * Fri Aug 03 2012 David Malcolm <dmalcolm@redhat.com> - 0.6.28-3
373 - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
374
375 * Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 0.6.28-2
376 - remove rhel logic from with_python3 conditional
377
378 * Mon Jul 23 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.28-1
379 - New upstream release:
380   - python-3.3 fixes
381   - honor umask when setuptools is used to install other modules
382
383 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.27-3
384 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
385
386 * Mon Jun 11 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.27-2
387 - Fix easy_install.py having a python3 shebang in the python2 package
388
389 * Thu Jun  7 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.27-1
390 - Upstream bugfix
391
392 * Tue May 15 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.24-2
393 - Upstream bugfix
394
395 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.24-2
396 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
397
398 * Mon Oct 17 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.24-1
399 - Upstream bugfix
400 - Compile the win32 launcher binary using mingw
401
402 * Sun Aug 21 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.21-1
403 - Upstream bugfix release
404
405 * Thu Jul 14 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.19-1
406 - Upstream bugfix release
407
408 * Tue Feb 22 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.14-7
409 - Switch to patch that I got in to upstream
410
411 * Tue Feb 22 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.14-6
412 - Fix build on python-3.2
413
414 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-5
415 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
416
417 * Sun Aug 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.14-4
418 - rebuild with python3.2
419   http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
420
421 * Tue Aug 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.14-3
422 - Update description to mention this is distribute
423
424 * Thu Jul 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.14-2
425 - bump for building against python 2.7
426
427 * Thu Jul 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.14-1
428 - update to new version
429 - all patches are upsteam
430
431 * Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.13-7
432 - generalize path of easy_install-2.6 and -3.1 to -2.* and -3.*
433
434 * Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.13-6
435 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
436
437 * Sat Jul 3 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-5
438 - Upstream patch for compatibility problem with setuptools
439 - Minor spec cleanups
440 - Provide python-distribute for those who see an import distribute and need
441   to get the proper package.
442
443 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-4
444 - Fix race condition in unittests under the python-2.6.x on F-14.
445
446 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-3
447 - Fix few more buildroot macros
448
449 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-2
450 - Include data that's needed for running tests
451
452 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-1
453 - Update to upstream 0.6.13
454 - Minor specfile formatting fixes
455
456 * Thu Feb 04 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-3
457 - First build with python3 support enabled.
458   
459 * Fri Jan 29 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-2
460 - Really disable the python3 portion
461
462 * Fri Jan 29 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-1
463 - Update the python3 portions but disable for now.
464 - Update to 0.6.10
465 - Remove %%pre scriptlet as the file has a different name than the old
466   package's directory
467
468 * Tue Jan 26 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.9-4
469 - Fix install to make /usr/bin/easy_install the py2 version
470 - Don't need python3-tools since the library is now in the python3 package
471 - Few other changes to cleanup style
472
473 * Fri Jan 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.9-2
474 - add python3 subpackage
475
476 * Mon Dec 14 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.9-1
477 - New upstream bugfix release.
478
479 * Sun Dec 13 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.8-2
480 - Test rebuild
481
482 * Mon Nov 16 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.8-1
483 - Update to 0.6.8.
484 - Fix directory => file transition when updating from setuptools-0.6c9.
485
486 * Tue Nov 3 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.7-2
487 - Fix duplicate inclusion of files.
488 - Only Obsolete old versions of python-setuptools-devel
489
490 * Tue Nov 3 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.7-1
491 - Move easy_install back into the main package as the needed files have been
492   moved from python-devel to the main python package.
493 - Update to 0.6.7 bugfix.
494
495 * Fri Oct 16 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.6-1
496 - Upstream bugfix release.
497
498 * Mon Oct 12 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-1
499 - First build from the distribute codebase -- distribute-0.6.4.
500 - Remove svn patch as upstream has chosen to go with an easier change for now.
501
502 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6c9-5
503 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
504
505 * Tue Jul 14 2009 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c9-4
506 - Apply SVN-1.6 versioning patch (rhbz #511021)
507
508 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6c9-3
509 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild