From ee40d9fffac9c13ecfe9a427872adeeaedc57778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 20 Sep 2017 14:03:27 +0200 Subject: Tests: Run `python -m pip` instead of plain `pip` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows to run the testsuite on systems where `/usr/bin/pip` is a specific Python version, but the tests are run on a different one. For example in Fedora RPM, when the Python 3 tests are invoked, they should use Python 3 pip, not Python 2 `/usr/bin/pip`. Unlike other approaches, like using `pip2`/`pip3` which is currently done in Fedora RPM (downstream patch), this way it Works Everywhereâ„¢ and the downstream patch can be dropped. See https://src.fedoraproject.org/rpms/python-setuptools/blob/54eaa03a4dc97f93a5e4c92c55e580a4ab55a058/f/0001-Run-test-on-a-version-specific-pip.patch --- setuptools/tests/test_develop.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setuptools/tests/test_develop.py') diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py index ad7cfa05..ec67c798 100644 --- a/setuptools/tests/test_develop.py +++ b/setuptools/tests/test_develop.py @@ -167,6 +167,8 @@ class TestNamespaces: target = tmpdir / 'packages' # use pip to install to the target directory install_cmd = [ + sys.executable, + '-m', 'pip', 'install', str(pkg_A), -- cgit v1.2.3 From 7ea8086d35b6e072c8deae6de54c55f0582161e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 20 Sep 2017 14:52:48 +0200 Subject: Tests: Run `python -m pip.__main__` to support Python 2.6 See https://bugs.python.org/issue2751 --- setuptools/tests/test_develop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/tests/test_develop.py') diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py index ec67c798..cb4ff4b4 100644 --- a/setuptools/tests/test_develop.py +++ b/setuptools/tests/test_develop.py @@ -169,7 +169,7 @@ class TestNamespaces: install_cmd = [ sys.executable, '-m', - 'pip', + 'pip.__main__', 'install', str(pkg_A), '-t', str(target), -- cgit v1.2.3