From 2650749ccf0ae6aeb114ecc67e0459b0802d1516 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 31 2016 08:13:18 +0000 Subject: import python27-python-pip-7.1.0-2.el7 --- diff --git a/.gitignore b/.gitignore index a516223..3aa0d3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/pip-1.5.6.tar.gz +SOURCES/pip-7.1.0.tar.gz diff --git a/.python27-python-pip.metadata b/.python27-python-pip.metadata index 96be0ee..4e08cb8 100644 --- a/.python27-python-pip.metadata +++ b/.python27-python-pip.metadata @@ -1 +1 @@ -e6cd9e6f2fd8d28c9976313632ef8aa8ac31249e SOURCES/pip-1.5.6.tar.gz +f0254e9b58d29268125fdf08e4cac303592f26d6 SOURCES/pip-7.1.0.tar.gz diff --git a/SOURCES/local-dos.patch b/SOURCES/local-dos.patch deleted file mode 100644 index 721ca51..0000000 --- a/SOURCES/local-dos.patch +++ /dev/null @@ -1,395 +0,0 @@ -diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py -index 8ed3d91..01b2104 100644 ---- a/pip/cmdoptions.py -+++ b/pip/cmdoptions.py -@@ -9,7 +9,7 @@ To be consistent, all options will follow this design. - """ - import copy - from optparse import OptionGroup, SUPPRESS_HELP, Option --from pip.locations import build_prefix, default_log_file -+from pip.locations import default_log_file - - - def make_option_group(group, parser): -@@ -297,10 +297,8 @@ build_dir = OptionMaker( - '-b', '--build', '--build-dir', '--build-directory', - dest='build_dir', - metavar='dir', -- default=build_prefix, -- help='Directory to unpack packages into and build in. ' -- 'The default in a virtualenv is "/build". ' -- 'The default for global installs is "/pip_build_".') -+ help='Directory to unpack packages into and build in.', -+) - - install_options = OptionMaker( - '--install-option', -diff --git a/pip/commands/install.py b/pip/commands/install.py -index cbf22a0..cb7d0db 100644 ---- a/pip/commands/install.py -+++ b/pip/commands/install.py -@@ -10,6 +10,7 @@ from pip.basecommand import Command - from pip.index import PackageFinder - from pip.exceptions import InstallationError, CommandError, PreviousBuildDirError - from pip import cmdoptions -+from pip.util import BuildDirectory - - - class InstallCommand(Command): -@@ -188,7 +189,7 @@ class InstallCommand(Command): - if ( - options.no_install or - options.no_download or -- (options.build_dir != build_prefix) or -+ options.build_dir or - options.no_clean - ): - logger.deprecated('1.7', 'DEPRECATION: --no-install, --no-download, --build, ' -@@ -197,7 +198,16 @@ class InstallCommand(Command): - if options.download_dir: - options.no_install = True - options.ignore_installed = True -- options.build_dir = os.path.abspath(options.build_dir) -+ -+ # If we have --no-install or --no-download and no --build we use the -+ # legacy static build dir -+ if (options.build_dir is None -+ and (options.no_install or options.no_download)): -+ options.build_dir = build_prefix -+ -+ if options.build_dir: -+ options.build_dir = os.path.abspath(options.build_dir) -+ - options.src_dir = os.path.abspath(options.src_dir) - install_options = options.install_options or [] - if options.use_user_site: -@@ -246,73 +256,75 @@ class InstallCommand(Command): - - finder = self._build_package_finder(options, index_urls, session) - -- requirement_set = RequirementSet( -- build_dir=options.build_dir, -- src_dir=options.src_dir, -- download_dir=options.download_dir, -- download_cache=options.download_cache, -- upgrade=options.upgrade, -- as_egg=options.as_egg, -- ignore_installed=options.ignore_installed, -- ignore_dependencies=options.ignore_dependencies, -- force_reinstall=options.force_reinstall, -- use_user_site=options.use_user_site, -- target_dir=temp_target_dir, -- session=session, -- pycompile=options.compile, -- ) -- for name in args: -- requirement_set.add_requirement( -- InstallRequirement.from_line(name, None)) -- for name in options.editables: -- requirement_set.add_requirement( -- InstallRequirement.from_editable(name, default_vcs=options.default_vcs)) -- for filename in options.requirements: -- for req in parse_requirements(filename, finder=finder, options=options, session=session): -- requirement_set.add_requirement(req) -- if not requirement_set.has_requirements: -- opts = {'name': self.name} -- if options.find_links: -- msg = ('You must give at least one requirement to %(name)s ' -- '(maybe you meant "pip %(name)s %(links)s"?)' % -- dict(opts, links=' '.join(options.find_links))) -- else: -- msg = ('You must give at least one requirement ' -- 'to %(name)s (see "pip help %(name)s")' % opts) -- logger.warn(msg) -- return -- -- try: -- if not options.no_download: -- requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) -- else: -- requirement_set.locate_files() -- -- if not options.no_install and not self.bundle: -- 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: -- logger.notify('Successfully installed %s' % installed) -- elif not self.bundle: -- downloaded = ' '.join([req.name for req in -- requirement_set.successfully_downloaded]) -- if downloaded: -- logger.notify('Successfully downloaded %s' % downloaded) -- elif self.bundle: -- requirement_set.create_bundle(self.bundle_filename) -- logger.notify('Created bundle in %s' % self.bundle_filename) -- except PreviousBuildDirError: -- options.no_clean = True -- raise -- finally: -- # Clean up -- if (not options.no_clean) and ((not options.no_install) or options.download_dir): -- requirement_set.cleanup_files(bundle=self.bundle) -+ build_delete = (not (options.no_clean or options.build_dir)) -+ with BuildDirectory(options.build_dir, delete=build_delete) as build_dir: -+ requirement_set = RequirementSet( -+ build_dir=build_dir, -+ src_dir=options.src_dir, -+ download_dir=options.download_dir, -+ download_cache=options.download_cache, -+ upgrade=options.upgrade, -+ as_egg=options.as_egg, -+ ignore_installed=options.ignore_installed, -+ ignore_dependencies=options.ignore_dependencies, -+ force_reinstall=options.force_reinstall, -+ use_user_site=options.use_user_site, -+ target_dir=temp_target_dir, -+ session=session, -+ pycompile=options.compile, -+ ) -+ for name in args: -+ requirement_set.add_requirement( -+ InstallRequirement.from_line(name, None)) -+ for name in options.editables: -+ requirement_set.add_requirement( -+ InstallRequirement.from_editable(name, default_vcs=options.default_vcs)) -+ for filename in options.requirements: -+ for req in parse_requirements(filename, finder=finder, options=options, session=session): -+ requirement_set.add_requirement(req) -+ if not requirement_set.has_requirements: -+ opts = {'name': self.name} -+ if options.find_links: -+ msg = ('You must give at least one requirement to %(name)s ' -+ '(maybe you meant "pip %(name)s %(links)s"?)' % -+ dict(opts, links=' '.join(options.find_links))) -+ else: -+ msg = ('You must give at least one requirement ' -+ 'to %(name)s (see "pip help %(name)s")' % opts) -+ logger.warn(msg) -+ return -+ -+ try: -+ if not options.no_download: -+ requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) -+ else: -+ requirement_set.locate_files() -+ -+ if not options.no_install and not self.bundle: -+ 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: -+ logger.notify('Successfully installed %s' % installed) -+ elif not self.bundle: -+ downloaded = ' '.join([req.name for req in -+ requirement_set.successfully_downloaded]) -+ if downloaded: -+ logger.notify('Successfully downloaded %s' % downloaded) -+ elif self.bundle: -+ requirement_set.create_bundle(self.bundle_filename) -+ logger.notify('Created bundle in %s' % self.bundle_filename) -+ except PreviousBuildDirError: -+ options.no_clean = True -+ raise -+ finally: -+ # Clean up -+ if (not options.no_clean) and ((not options.no_install) or options.download_dir): -+ requirement_set.cleanup_files(bundle=self.bundle) - - if options.target_dir: - if not os.path.exists(options.target_dir): -diff --git a/pip/commands/wheel.py b/pip/commands/wheel.py -index 6527063..a96631a 100644 ---- a/pip/commands/wheel.py -+++ b/pip/commands/wheel.py -@@ -8,7 +8,7 @@ from pip.index import PackageFinder - from pip.log import logger - from pip.exceptions import CommandError, PreviousBuildDirError - from pip.req import InstallRequirement, RequirementSet, parse_requirements --from pip.util import normalize_path -+from pip.util import BuildDirectory, normalize_path - from pip.wheel import WheelBuilder - from pip import cmdoptions - -@@ -123,6 +123,9 @@ class WheelCommand(Command): - "--extra-index-url is suggested.") - index_urls += options.mirrors - -+ if options.build_dir: -+ options.build_dir = os.path.abspath(options.build_dir) -+ - session = self._build_session(options) - - finder = PackageFinder(find_links=options.find_links, -@@ -137,59 +140,60 @@ class WheelCommand(Command): - session=session, - ) - -- options.build_dir = os.path.abspath(options.build_dir) -- requirement_set = RequirementSet( -- build_dir=options.build_dir, -- src_dir=None, -- download_dir=None, -- download_cache=options.download_cache, -- ignore_dependencies=options.ignore_dependencies, -- ignore_installed=True, -- session=session, -- wheel_download_dir=options.wheel_dir -- ) -- -- # make the wheelhouse -- if not os.path.exists(options.wheel_dir): -- os.makedirs(options.wheel_dir) -- -- #parse args and/or requirements files -- for name in args: -- requirement_set.add_requirement( -- InstallRequirement.from_line(name, None)) -- -- for filename in options.requirements: -- for req in parse_requirements( -- filename, -- finder=finder, -- options=options, -- session=session): -- if req.editable: -- logger.notify("ignoring %s" % req.url) -- continue -- requirement_set.add_requirement(req) -- -- #fail if no requirements -- if not requirement_set.has_requirements: -- opts = {'name': self.name} -- msg = ('You must give at least one requirement ' -- 'to %(name)s (see "pip help %(name)s")' % opts) -- logger.error(msg) -- return -+ build_delete = (not (options.no_clean or options.build_dir)) -+ with BuildDirectory(options.build_dir, delete=build_delete) as build_dir: -+ requirement_set = RequirementSet( -+ build_dir=build_dir, -+ src_dir=None, -+ download_dir=None, -+ download_cache=options.download_cache, -+ ignore_dependencies=options.ignore_dependencies, -+ ignore_installed=True, -+ session=session, -+ wheel_download_dir=options.wheel_dir -+ ) - -- try: -- #build wheels -- wb = WheelBuilder( -- requirement_set, -- finder, -- options.wheel_dir, -- build_options = options.build_options or [], -- global_options = options.global_options or [] -- ) -- wb.build() -- except PreviousBuildDirError: -- options.no_clean = True -- raise -- finally: -- if not options.no_clean: -- requirement_set.cleanup_files() -+ # make the wheelhouse -+ if not os.path.exists(options.wheel_dir): -+ os.makedirs(options.wheel_dir) -+ -+ #parse args and/or requirements files -+ for name in args: -+ requirement_set.add_requirement( -+ InstallRequirement.from_line(name, None)) -+ -+ for filename in options.requirements: -+ for req in parse_requirements( -+ filename, -+ finder=finder, -+ options=options, -+ session=session): -+ if req.editable: -+ logger.notify("ignoring %s" % req.url) -+ continue -+ requirement_set.add_requirement(req) -+ -+ #fail if no requirements -+ if not requirement_set.has_requirements: -+ opts = {'name': self.name} -+ msg = ('You must give at least one requirement ' -+ 'to %(name)s (see "pip help %(name)s")' % opts) -+ logger.error(msg) -+ return -+ -+ try: -+ #build wheels -+ wb = WheelBuilder( -+ requirement_set, -+ finder, -+ options.wheel_dir, -+ build_options = options.build_options or [], -+ global_options = options.global_options or [] -+ ) -+ wb.build() -+ except PreviousBuildDirError: -+ options.no_clean = True -+ raise -+ finally: -+ if not options.no_clean: -+ requirement_set.cleanup_files() -diff --git a/pip/util.py b/pip/util.py -index f459bb2..f5edeeb 100644 ---- a/pip/util.py -+++ b/pip/util.py -@@ -8,6 +8,7 @@ import zipfile - import tarfile - import subprocess - import textwrap -+import tempfile - - from pip.exceptions import InstallationError, BadCommand, PipError - from pip.backwardcompat import(WindowsError, string_types, raw_input, -@@ -718,3 +719,35 @@ def is_prerelease(vers): - - parsed = version._normalized_key(normalized) - return any([any([y in set(["a", "b", "c", "rc", "dev"]) for y in x]) for x in parsed]) -+ -+ -+class BuildDirectory(object): -+ -+ def __init__(self, name=None, delete=None): -+ # If we were not given an explicit directory, and we were not given an -+ # explicit delete option, then we'll default to deleting. -+ if name is None and delete is None: -+ delete = True -+ -+ if name is None: -+ name = tempfile.mkdtemp(prefix="pip-build-") -+ # If we were not given an explicit directory, and we were not given -+ # an explicit delete option, then we'll default to deleting. -+ if delete is None: -+ delete = True -+ -+ self.name = name -+ self.delete = delete -+ -+ def __repr__(self): -+ return "<{} {!r}>".format(self.__class__.__name__, self.name) -+ -+ def __enter__(self): -+ return self.name -+ -+ def __exit__(self, exc, value, tb): -+ self.cleanup() -+ -+ def cleanup(self): -+ if self.delete: -+ rmtree(self.name) diff --git a/SOURCES/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch b/SOURCES/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch index f2e8487..d581eee 100644 --- a/SOURCES/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch +++ b/SOURCES/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): - help="Install everything relative to this alternate root directory.") + "directory.") cmd_opts.add_option( + '--strip-file-prefix', @@ -23,29 +23,25 @@ index 1693d01..0287c06 100644 "--compile", action="store_true", dest="compile", -@@ -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 +@@ -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 index 3ae306d..c171130 100644 ---- a/pip/req.py -+++ b/pip/req.py +--- a/pip/req/req_install.py ++++ b/pip/req/req_install.py @@ -615,15 +615,19 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) - name = name.replace(os.path.sep, '/') - return name + else: + return True -- def install(self, install_options, global_options=(), root=None): -+ def install(self, install_options, global_options=(), root=None, strip_file_prefix=None): +- def install(self, install_options, global_options=[], root=None): ++ def install(self, install_options, global_options=[], root=None, strip_file_prefix=None): if self.editable: self.install_editable(install_options, global_options) return @@ -62,9 +58,9 @@ index 3ae306d..c171130 100644 self.install_succeeded = True return -@@ -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 +@@ -844,14 +848,15 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) + def is_wheel(self): + return self.link and self.link.is_wheel - def move_wheel_files(self, wheeldir, root=None): + def move_wheel_files(self, wheeldir, root=None, strip_file_prefix=None): @@ -74,10 +70,11 @@ index 3ae306d..c171130 100644 home=self.target_dir, root=root, pycompile=self.pycompile, + isolated=self.isolated, + strip_file_prefix=strip_file_prefix, ) - @property + def get_dist(self): diff --git a/pip/wheel.py b/pip/wheel.py index fa3e270..3a366d0 100644 --- a/pip/wheel.py @@ -86,8 +83,8 @@ index fa3e270..3a366d0 100644 def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, -- pycompile=True, scheme=None): -+ pycompile=True, scheme=None, strip_file_prefix=None): +- pycompile=True, scheme=None, isolated=False): ++ pycompile=True, scheme=None, isolated=False, strip_file_prefix=None): """Install a wheel""" if not scheme: diff --git a/SPECS/python-pip.spec b/SPECS/python-pip.spec index 4a651c4..e8c058f 100644 --- a/SPECS/python-pip.spec +++ b/SPECS/python-pip.spec @@ -8,12 +8,17 @@ %global srcname pip %if 0%{?build_wheel} -%global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl +%global python2_wheelname %{srcname}-%{version}-py2.py3-none-any.whl +%endif + +%global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) +%if "%{bashcompdir}" != "%{_sysconfdir}/bash_completion.d" +%global bashcomp2 1 %endif Name: %{?scl_prefix}python-%{srcname} -Version: 1.5.6 -Release: 5%{?dist} +Version: 7.1.0 +Release: 2%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -22,9 +27,6 @@ URL: http://www.pip-installer.org Source0: http://pypi.python.org/packages/source/p/pip/%{srcname}-%{version}.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 - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -43,12 +45,12 @@ same techniques for finding packages, so packages that were made easy_installable should be pip-installable as well. + %prep %{?scl:scl enable %{scl} - << \EOF} %setup -q -n %{srcname}-%{version} %patch0 -p1 -%patch1 -p1 %{__sed} -i '1d' pip/__init__.py %{?scl:EOF} @@ -69,26 +71,57 @@ easy_installable should be pip-installable as well. %{?scl:scl enable %{scl} - << \EOF} %if 0%{?build_wheel} -pip install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot} +pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot} %else -%{__python2} setup.py install --skip-build --root %{buildroot} +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} %endif -%{?scl:EOF} +mkdir -p %{buildroot}%{bashcompdir} +PYTHONPATH=%{buildroot}%{python_sitelib} \ + %{buildroot}%{_bindir}/pip completion --bash \ + > %{buildroot}%{bashcompdir}/pip +pips2=pip +for pip in %{buildroot}%{_bindir}/pip*; do + pip=$(basename $pip) + case $pip in + pip2*) + pips2="$pips2 $pip" +%if 0%{?bashcomp2} + ln -s pip %{buildroot}%{bashcompdir}/$pip +%endif + esac +done + +sed -i -e "s/^\\(complete.*\\) pip\$/\\1 $pips2/" \ + %{buildroot}%{bashcompdir}/pip +%{?scl:EOF} %clean %{__rm} -rf %{buildroot} -# unfortunately, pip's test suite requires virtualenv >= 1.6 which isn't in -# fedora yet. Once it is, check can be implemented %files %defattr(-,root,root,-) -%doc LICENSE.txt README.rst docs -%attr(755,root,root) %{_bindir}/pip* -%{python2_sitelib}/pip* +%doc README.rst LICENSE.txt docs +%attr(755,root,root) %{_bindir}/pip +%attr(755,root,root) %{_bindir}/pip2* +%{python_sitelib}/pip* +%{bashcompdir} +%if 0%{?bashcomp2} +%dir %(dirname %{bashcompdir}) +%endif + %changelog +* Tue May 10 2016 Charalampos Stratakis - 7.1.0-2 +- Change license tag to doc tag so directory is owned by the collection +- Will revert when ownership of directories is defined in scl-utils-build package +Resolves: rhbz#1334447 + +* Mon Feb 15 2016 Charalampos Stratakis - 7.1.0-1 +- Update to 7.1.0 +Resolves: rhbz#1255516 + * Tue Jan 20 2015 Slavek Kabrda - 1.5.6-5 - Rebuild for python27 (not as wheel) Resolves: rhbz#994189 @@ -183,4 +216,3 @@ Resolves: rhbz#994189 - upgrade to 0.6.1 of pip * Mon Aug 31 2009 Peter Halliday - 0.4-1 - Initial package -