From 60689115239c00deacbcc81a48e0f38f39fc7cb3 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 10 Mar 2015 14:33:02 +0100 Subject: [PATCH] Revert "Update to 6.0.8" This reverts commit f50907e1c1b65c68127c0c4b3f72d1980f5b3e4d. --- .gitignore | 1 - ...pping-prefix-from-wheel-RECORD-files.patch | 47 ++++++++++--------- python-pip.spec | 36 +++++--------- skip-network-tests.patch | 24 ++++++++++ sources | 3 +- 5 files changed, 63 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index 9ee51e6..b633d86 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ pip-0.7.2.tar.gz /pip-1.5.4.tar.gz /pip-1.5.6.tar.gz /pip-1.5.6-tests.tar.gz -/pip-6.0.8.tar.gz diff --git a/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch b/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch index bc7fa88..f2e8487 100644 --- a/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch +++ b/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch @@ -9,7 +9,7 @@ index 1693d01..0287c06 100644 --- a/pip/commands/install.py +++ b/pip/commands/install.py @@ -137,6 +137,14 @@ class InstallCommand(Command): - "directory.") + help="Install everything relative to this alternate root directory.") cmd_opts.add_option( + '--strip-file-prefix', @@ -23,22 +23,26 @@ index 1693d01..0287c06 100644 "--compile", action="store_true", dest="compile", -@@ -345,6 +353,7 @@ class InstallCommand(Command): - install_options, - global_options, - root=options.root_path, -+ strip_file_prefix=options.strip_file_prefix, - ) - reqs = sorted( - requirement_set.successfully_installed, - -diff --git a/pip/req/req_install.py b/pip/req/req_install.py +@@ -273,7 +281,11 @@ class InstallCommand(Command): + requirement_set.locate_files() + + if not options.no_install and not self.bundle: +- requirement_set.install(install_options, global_options, root=options.root_path) ++ requirement_set.install( ++ install_options, ++ global_options, ++ root=options.root_path, ++ strip_file_prefix=options.strip_file_prefix) + installed = ' '.join([req.name for req in + requirement_set.successfully_installed]) + if installed: +diff --git a/pip/req.py b/pip/req.py index 3ae306d..c171130 100644 ---- a/pip/req/req_install.py -+++ b/pip/req/req_install.py +--- a/pip/req.py ++++ b/pip/req.py @@ -615,15 +615,19 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) - else: - return True + name = name.replace(os.path.sep, '/') + return name - def install(self, install_options, global_options=(), root=None): + def install(self, install_options, global_options=(), root=None, strip_file_prefix=None): @@ -58,9 +62,9 @@ index 3ae306d..c171130 100644 self.install_succeeded = True return -@@ -844,14 +848,15 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) - def is_wheel(self): - return self.url and '.whl' in self.url +@@ -844,13 +848,14 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) + self._bundle_build_dirs = bundle_build_dirs + self._bundle_editable_dirs = bundle_editable_dirs - def move_wheel_files(self, wheeldir, root=None): + def move_wheel_files(self, wheeldir, root=None, strip_file_prefix=None): @@ -70,11 +74,10 @@ index 3ae306d..c171130 100644 home=self.target_dir, root=root, pycompile=self.pycompile, - isolated=self.isolated, + strip_file_prefix=strip_file_prefix, ) - def get_dist(self): + @property diff --git a/pip/wheel.py b/pip/wheel.py index fa3e270..3a366d0 100644 --- a/pip/wheel.py @@ -83,8 +86,8 @@ index fa3e270..3a366d0 100644 def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, -- pycompile=True, scheme=None, isolated=False): -+ pycompile=True, scheme=None, isolated=False, strip_file_prefix=None): +- pycompile=True, scheme=None): ++ pycompile=True, scheme=None, strip_file_prefix=None): """Install a wheel""" if not scheme: diff --git a/python-pip.spec b/python-pip.spec index f9551e9..b7e2774 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -1,7 +1,7 @@ %if (! 0%{?rhel}) || 0%{?rhel} > 7 %global with_python3 1 %global build_wheel 1 -%global with_tests 0 +%global with_tests 1 %endif %if 0%{?rhel} && 0%{?rhel} < 6 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} @@ -16,8 +16,8 @@ %endif Name: python-%{srcname} -Version: 6.0.8 -Release: 1%{?dist} +Version: 1.5.6 +Release: 6%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -28,11 +28,12 @@ Source0: http://pypi.python.org/packages/source/p/pip/%{srcname}-%{versio # to get tests: # git clone https://github.com/pypa/pip && cd fig # git checkout 1.5.6 && tar -czvf pip-1.5.6-tests.tar.gz tests/ -%if 0%{?with_tests} -Source1: pip-6.0.8-tests.tar.gz -%endif +Source1: pip-1.5.6-tests.tar.gz Patch0: pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch +# patch by dstufft, more at http://seclists.org/oss-sec/2014/q4/655 +Patch1: local-dos.patch +Patch2: skip-network-tests.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -42,8 +43,6 @@ BuildRequires: python-setuptools %if 0%{?with_tests} BuildRequires: python-mock BuildRequires: pytest -BuildRequires: python-pretend -BuildRequires: python-freezegun BuildRequires: python-scripttest BuildRequires: python-virtualenv %endif @@ -67,14 +66,6 @@ Group: Development/Libraries BuildRequires: python3-devel BuildRequires: python3-setuptools -%if 0%{?with_tests} -BuildRequires: python3-mock -BuildRequires: python3-pytest -BuildRequires: python3-pretend -BuildRequires: python3-freezegun -BuildRequires: python3-scripttest -BuildRequires: python3-virtualenv -%endif %if 0%{?build_wheel} BuildRequires: python3-pip BuildRequires: python3-wheel @@ -90,11 +81,11 @@ easy_installable should be pip-installable as well. %prep %setup -q -n %{srcname}-%{version} -%if 0%{?with_tests} tar -xf %{SOURCE1} -%endif %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %{__sed} -i '1d' pip/__init__.py @@ -144,10 +135,7 @@ pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefi %if 0%{?with_tests} %check -py.test -m 'not network' -pushd %{py3dir} -py.test-3.4 -m 'not network' -popd +python setup.py test %endif @@ -173,8 +161,8 @@ popd %endif # with_python3 %changelog -* Fri Mar 06 2015 Matej Stuchlik - 6.0.8-1 -- Update to 6.0.8 +* Tue Mar 10 2015 Matej Stuchlik - 1.5.6-7 +- Revert the 6.0.8 update * Thu Dec 18 2014 Slavek Kabrda - 1.5.6-5 - Only enable tests on Fedora. diff --git a/skip-network-tests.patch b/skip-network-tests.patch index 9dec67e..4fbbf1a 100644 --- a/skip-network-tests.patch +++ b/skip-network-tests.patch @@ -1,3 +1,27 @@ +diff -up pip-1.5.6/tests/functional/test_bundle.py.orig pip-1.5.6/tests/functional/test_bundle.py +--- pip-1.5.6/tests/functional/test_bundle.py.orig 2014-11-27 11:23:19.857665215 +0100 ++++ pip-1.5.6/tests/functional/test_bundle.py 2014-11-27 11:31:10.992460920 +0100 +@@ -1,10 +1,12 @@ + import zipfile + import textwrap ++import pytest + from os.path import abspath, exists, join + from pip.download import path_to_url + from tests.lib.local_repos import local_checkout + + ++@pytest.mark.skipif(True, reason='No network') + def test_create_bundle(script, tmpdir, data): + """ + Test making a bundle. We'll grab one package from the filesystem +@@ -30,6 +32,7 @@ def test_create_bundle(script, tmpdir, d + assert 'build/pip/' in files + + ++@pytest.mark.skipif(True, reason='No network') + def test_cleanup_after_create_bundle(script, tmpdir, data): + """ + Test clean up after making a bundle. Make sure (build|src)-bundle/ dirs are removed but not src/. diff -up pip-1.5.6/tests/functional/test_freeze.py.orig pip-1.5.6/tests/functional/test_freeze.py --- pip-1.5.6/tests/functional/test_freeze.py.orig 2014-11-27 11:23:19.947665742 +0100 +++ pip-1.5.6/tests/functional/test_freeze.py 2014-11-27 11:30:45.937308998 +0100 diff --git a/sources b/sources index 7d60591..185df82 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -2332e6f97e75ded3bddde0ced01dbda3 pip-6.0.8.tar.gz +01026f87978932060cc86c1dc527903e pip-1.5.6.tar.gz +03fb001023223970c16e9379f53af8b6 pip-1.5.6-tests.tar.gz