Add Patch that fixes a test suite failure on Python 3

in absence of the Python 2 version of pip.
This commit is contained in:
Tomas Orsava 2017-08-09 15:03:58 +02:00
parent 5b97b5b966
commit 54eaa03a4d
2 changed files with 72 additions and 3 deletions

View File

@ -0,0 +1,58 @@
From 62effe4db3d51c42531bf3f333bf82a3928358bf Mon Sep 17 00:00:00 2001
From: Tomas Orsava <torsava@redhat.com>
Date: Wed, 9 Aug 2017 14:46:01 +0200
Subject: [PATCH] Run test on a version specific pip
pip3 for Python 3, pip2 for Python 2, because the other might not be installed
---
setuptools/tests/test_develop.py | 2 +-
setuptools/tests/test_namespaces.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py
index ad7cfa0..c1b6e22 100644
--- a/setuptools/tests/test_develop.py
+++ b/setuptools/tests/test_develop.py
@@ -167,7 +167,7 @@ class TestNamespaces:
target = tmpdir / 'packages'
# use pip to install to the target directory
install_cmd = [
- 'pip',
+ 'pip%s' % sys.version_info.major,
'install',
str(pkg_A),
'-t', str(target),
diff --git a/setuptools/tests/test_namespaces.py b/setuptools/tests/test_namespaces.py
index 721cad1..a71fd69 100644
--- a/setuptools/tests/test_namespaces.py
+++ b/setuptools/tests/test_namespaces.py
@@ -30,7 +30,7 @@ class TestNamespaces:
targets = site_packages, path_packages
# use pip to install to the target directory
install_cmd = [
- 'pip',
+ 'pip%s' % sys.version_info.major,
'install',
str(pkg_A),
'-t', str(site_packages),
@@ -38,7 +38,7 @@ class TestNamespaces:
subprocess.check_call(install_cmd)
namespaces.make_site_dir(site_packages)
install_cmd = [
- 'pip',
+ 'pip%s' % sys.version_info.major,
'install',
str(pkg_B),
'-t', str(path_packages),
@@ -88,7 +88,7 @@ class TestNamespaces:
target = tmpdir / 'packages'
# use pip to install to the target directory
install_cmd = [
- 'pip',
+ 'pip%s' % sys.version_info.major,
'install',
str(pkg_A),
'-t', str(target),
--
2.13.3

View File

@ -28,7 +28,7 @@
Name: python-setuptools
Version: 36.2.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Easily build and distribute Python packages
Group: Applications/System
@ -36,6 +36,10 @@ License: MIT
URL: https://pypi.python.org/pypi/%{srcname}
Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.zip
# Run test on a version specific pip: pip3 for Python 3, pip2 for Python 2,
# because the other might not be installed
Patch0: 0001-Run-test-on-a-version-specific-pip.patch
BuildArch: noarch
%if %{with python2}
@ -114,6 +118,8 @@ execute the software that requires pkg_resources.py.
%prep
%setup -q -n %{srcname}-%{version}
%patch0 -p1
# We can't remove .egg-info (but it doesn't matter, since it'll be rebuilt):
# The problem is that to properly execute setuptools' setup.py,
# it is needed for setuptools to be loaded as a Distribution
@ -220,8 +226,8 @@ LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version}
%if %{with python3}
%files -n python3-setuptools
%license LICENSE CHANGES.rst README.rst
%doc docs/*
%license LICENSE
%doc docs/* CHANGES.rst README.rst
%{python3_sitelib}/easy_install.py
%{python3_sitelib}/pkg_resources/
%{python3_sitelib}/setuptools*/
@ -230,6 +236,11 @@ LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version}
%endif # with python3
%changelog
* Wed Aug 09 2017 Tomas Orsava <torsava@redhat.com> - 36.2.0-5
- Add Patch 0 that fixes a test suite failure on Python 3 in absence of
the Python 2 version of pip
- Move docs to their proper place
* Wed Aug 09 2017 Tomas Orsava <torsava@redhat.com> - 36.2.0-4
- Switch macros to bcond's and make Python 2 optional to facilitate building
the Python 2 and Python 3 modules.