__pycache__/__init__.cpython-36.opt-1.pyc000064400000012721147204471250014111 0ustar003 fP@sddlZddlZddlZddlZddlZddlZddgZdjej dZ ddZ e dZ e dZ de fde fgZdd d Zd dZd d ZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrapz/usr/share/python{}-wheels/csRtjjtdj|ddj}fddtj|D}tt|tj j dS)Nz{}-z-py2.py3-none-any.whlz{}*{}c3s$|]}|tt VqdS)N)len).0p)prefixsuffix*/usr/lib64/python3.6/ensurepip/__init__.py sz1_get_most_recent_wheel_version..)key) ospathjoin _WHEEL_DIRformatglobstrmax distutilsrZ LooseVersion)ZpkgpatternZversionsr )rrr _get_most_recent_wheel_version s  rZ setuptoolspipc Csd|dk r|tjt_yddlm}Wn tk rDddlm}YnX|ddkr\|jd||S)Nr)maininstalllistwheelz--pre)rrr)sysrZ pip._internalr ImportErrorrappend)argsadditional_pathsrr r r _run_pip s   r"cCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONr r r r r0scCs6ddtjD}x|D] }tj|=qWtjtjd<dS)NcSsg|]}|jdr|qS)ZPIP_) startswith)rkr r r :sz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)r environdevnull)Zkeys_to_remover%r r r #_disable_pip_configuration_settings6s  r)F)rootupgradeuser altinstall default_pip verbositycCst||||||ddS)z Bootstrap pip into the current Python installation (or the given root directory). Note that calling this function will alter both sys.path and os.environ. )r*r+r,r-r.r/N) _bootstrap)r*r+r,r-r.r/r r r rBs cCs4|r|rtdt|r&dtjd<n|s4dtjd<tj}g}x~tD]v\}} dj|| } ttj j t | d4} ttj j || d} | j | j WdQRXWdQRX|jtj j || qHWdd d |g} |r| d |g7} |r| d g7} |r| d g7} |r| dd|g7} t| ddtD|SQRXdS)z Bootstrap pip into the current Python installation (or the given root directory). Returns pip command status code. Note that calling this function will alter both sys.path and os.environ. z.Cannot use altinstall and default_pip togetherr-ZENSUREPIP_OPTIONSrz{}-{}-py2.py3-none-any.whlrbwbNz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|] }|dqS)rr )rrr r r r&sz_bootstrap..) ValueErrorr)r r'tempfileZTemporaryDirectory _PROJECTSropenrrrwritereadrr")r*r+r,r-r.r/Ztmpdirr!ZprojectrZ wheel_nameZsfpfpr r r r r0Qs2     "    r0)r/c Csy ddl}Wntk r dSX|jtkrLd}t|j|jttjddStdddg}|rr|dd |g7}t |d d t t DS) z~Helper to support a clean default uninstall process on Windows Note that calling this function may alter os.environ. rNzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))fileZ uninstallz-yz--disable-pip-version-checkr3r4cSsg|] }|dqS)rr )rrr r r r&sz%_uninstall_helper..) rr __version__r#printrrstderrr)r"reversedr7)r/rmsgr r r r _uninstall_helpers   rBcCsddl}|jdd}|jdddjtdd|jd d d dd d d|jdddddd|jddddd|jdddd|jddddd|jddddd|j|}t|j|j|j |j |j |j dS)Nrzpython -m ensurepip)progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)actionrhelpz-vz --verbosecountr/zDGive more output. Option is additive, and can be used up to 3 times.)rDdefaultdestrEz-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.)rDrGrEz--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.)rGrEz --altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z --default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r*r+r,r/r-r.) argparseArgumentParser add_argumentrr parse_argsr0r*r+r,r/r-r.)argvrJparserr r r r _mainsZ   rP)N)N)Zdistutils.versionrrr Zos.pathrr6__all__r version_inforrZ_SETUPTOOLS_VERSIONr#r7r"rr)rr0rBrPr r r r s.    2__pycache__/__init__.cpython-36.opt-2.pyc000064400000011620147204471250014107 0ustar003 fP@sddlZddlZddlZddlZddlZddlZddgZdjej dZ ddZ e dZ e dZ de fde fgZdd d Zd dZd d ZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrapz/usr/share/python{}-wheels/csRtjjtdj|ddj}fddtj|D}tt|tj j dS)Nz{}-z-py2.py3-none-any.whlz{}*{}c3s$|]}|tt VqdS)N)len).0p)prefixsuffix*/usr/lib64/python3.6/ensurepip/__init__.py sz1_get_most_recent_wheel_version..)key) ospathjoin _WHEEL_DIRformatglobstrmax distutilsrZ LooseVersion)ZpkgpatternZversionsr )rrr _get_most_recent_wheel_version s  rZ setuptoolspipc Csd|dk r|tjt_yddlm}Wn tk rDddlm}YnX|ddkr\|jd||S)Nr)maininstalllistwheelz--pre)rrr)sysrZ pip._internalr ImportErrorrappend)argsadditional_pathsrr r r _run_pip s   r"cCstS)N) _PIP_VERSIONr r r r r0scCs6ddtjD}x|D] }tj|=qWtjtjd<dS)NcSsg|]}|jdr|qS)ZPIP_) startswith)rkr r r :sz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)r environdevnull)Zkeys_to_remover%r r r #_disable_pip_configuration_settings6s  r)F)rootupgradeuser altinstall default_pip verbositycCst||||||ddS)N)r*r+r,r-r.r/) _bootstrap)r*r+r,r-r.r/r r r rBs cCs4|r|rtdt|r&dtjd<n|s4dtjd<tj}g}x~tD]v\}} dj|| } ttj j t | d4} ttj j || d} | j | j WdQRXWdQRX|jtj j || qHWddd |g} |r| d |g7} |r| d g7} |r| d g7} |r| d d|g7} t| ddtD|SQRXdS)Nz.Cannot use altinstall and default_pip togetherr-ZENSUREPIP_OPTIONSrz{}-{}-py2.py3-none-any.whlrbwbz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|] }|dqS)rr )rrr r r r&sz_bootstrap..) ValueErrorr)r r'tempfileZTemporaryDirectory _PROJECTSropenrrrwritereadrr")r*r+r,r-r.r/Ztmpdirr!ZprojectrZ wheel_nameZsfpfpr r r r r0Qs2     "    r0)r/c Csy ddl}Wntk r dSX|jtkrLd}t|j|jttjddStdddg}|rr|dd|g7}t |d d t t DS) NrzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))fileZ uninstallz-yz--disable-pip-version-checkr3r4cSsg|] }|dqS)rr )rrr r r r&sz%_uninstall_helper..) rr __version__r#printrrstderrr)r"reversedr7)r/rmsgr r r r _uninstall_helpers   rBcCsddl}|jdd}|jdddjtdd|jd d d dd d d|jdddddd|jddddd|jdddd|jddddd|jddddd|j|}t|j|j|j |j |j |j dS)Nrzpython -m ensurepip)progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)actionrhelpz-vz --verbosecountr/zDGive more output. Option is additive, and can be used up to 3 times.)rDdefaultdestrEz-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.)rDrGrEz--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.)rGrEz --altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z --default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r*r+r,r/r-r.) argparseArgumentParser add_argumentrr parse_argsr0r*r+r,r/r-r.)argvrJparserr r r r _mainsZ   rP)N)N)Zdistutils.versionrrr Zos.pathrr6__all__r version_inforrZ_SETUPTOOLS_VERSIONr#r7r"rr)rr0rBrPr r r r s.    2__pycache__/__init__.cpython-36.pyc000064400000012721147204471250013152 0ustar003 fP@sddlZddlZddlZddlZddlZddlZddgZdjej dZ ddZ e dZ e dZ de fde fgZdd d Zd dZd d ZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrapz/usr/share/python{}-wheels/csRtjjtdj|ddj}fddtj|D}tt|tj j dS)Nz{}-z-py2.py3-none-any.whlz{}*{}c3s$|]}|tt VqdS)N)len).0p)prefixsuffix*/usr/lib64/python3.6/ensurepip/__init__.py sz1_get_most_recent_wheel_version..)key) ospathjoin _WHEEL_DIRformatglobstrmax distutilsrZ LooseVersion)ZpkgpatternZversionsr )rrr _get_most_recent_wheel_version s  rZ setuptoolspipc Csd|dk r|tjt_yddlm}Wn tk rDddlm}YnX|ddkr\|jd||S)Nr)maininstalllistwheelz--pre)rrr)sysrZ pip._internalr ImportErrorrappend)argsadditional_pathsrr r r _run_pip s   r"cCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONr r r r r0scCs6ddtjD}x|D] }tj|=qWtjtjd<dS)NcSsg|]}|jdr|qS)ZPIP_) startswith)rkr r r :sz7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)r environdevnull)Zkeys_to_remover%r r r #_disable_pip_configuration_settings6s  r)F)rootupgradeuser altinstall default_pip verbositycCst||||||ddS)z Bootstrap pip into the current Python installation (or the given root directory). Note that calling this function will alter both sys.path and os.environ. )r*r+r,r-r.r/N) _bootstrap)r*r+r,r-r.r/r r r rBs cCs4|r|rtdt|r&dtjd<n|s4dtjd<tj}g}x~tD]v\}} dj|| } ttj j t | d4} ttj j || d} | j | j WdQRXWdQRX|jtj j || qHWdd d |g} |r| d |g7} |r| d g7} |r| d g7} |r| dd|g7} t| ddtD|SQRXdS)z Bootstrap pip into the current Python installation (or the given root directory). Returns pip command status code. Note that calling this function will alter both sys.path and os.environ. z.Cannot use altinstall and default_pip togetherr-ZENSUREPIP_OPTIONSrz{}-{}-py2.py3-none-any.whlrbwbNz --no-indexz --find-linksz--rootz --upgradez--user-vcSsg|] }|dqS)rr )rrr r r r&sz_bootstrap..) ValueErrorr)r r'tempfileZTemporaryDirectory _PROJECTSropenrrrwritereadrr")r*r+r,r-r.r/Ztmpdirr!ZprojectrZ wheel_nameZsfpfpr r r r r0Qs2     "    r0)r/c Csy ddl}Wntk r dSX|jtkrLd}t|j|jttjddStdddg}|rr|dd |g7}t |d d t t DS) z~Helper to support a clean default uninstall process on Windows Note that calling this function may alter os.environ. rNzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))fileZ uninstallz-yz--disable-pip-version-checkr3r4cSsg|] }|dqS)rr )rrr r r r&sz%_uninstall_helper..) rr __version__r#printrrstderrr)r"reversedr7)r/rmsgr r r r _uninstall_helpers   rBcCsddl}|jdd}|jdddjtdd|jd d d dd d d|jdddddd|jddddd|jdddd|jddddd|jddddd|j|}t|j|j|j |j |j |j dS)Nrzpython -m ensurepip)progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)actionrhelpz-vz --verbosecountr/zDGive more output. Option is additive, and can be used up to 3 times.)rDdefaultdestrEz-Uz --upgrade store_trueFz8Upgrade pip and dependencies, even if already installed.)rDrGrEz--userzInstall using the user scheme.z--rootz=Install everything relative to this alternate root directory.)rGrEz --altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z --default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r*r+r,r/r-r.) argparseArgumentParser add_argumentrr parse_argsr0r*r+r,r/r-r.)argvrJparserr r r r _mainsZ   rP)N)N)Zdistutils.versionrrr Zos.pathrr6__all__r version_inforrZ_SETUPTOOLS_VERSIONr#r7r"rr)rr0rBrPr r r r s.    2__pycache__/__main__.cpython-36.opt-1.pyc000064400000000334147204471250014067 0ustar003 \X@s*ddlZddlZedkr&ejejdS)N__main__)Z ensurepipsys__name__exit_mainrr*/usr/lib64/python3.6/ensurepip/__main__.pys__pycache__/__main__.cpython-36.opt-2.pyc000064400000000334147204471250014070 0ustar003 \X@s*ddlZddlZedkr&ejejdS)N__main__)Z ensurepipsys__name__exit_mainrr*/usr/lib64/python3.6/ensurepip/__main__.pys__pycache__/__main__.cpython-36.pyc000064400000000334147204471250013130 0ustar003 \X@s*ddlZddlZedkr&ejejdS)N__main__)Z ensurepipsys__name__exit_mainrr*/usr/lib64/python3.6/ensurepip/__main__.pys__pycache__/_uninstall.cpython-36.opt-1.pyc000064400000001626147204471250014524 0ustar003 \(@s>dZddlZddlZddlZdddZedkr:ejedS)zDBasic pip uninstallation support, helper for the Windows uninstallerNcCsVtjdd}|jdddjtjdd|jdd d d d d d|j|}tj|jdS)Nzpython -m ensurepip._uninstall)progz --versionversionzpip {}z7Show the version of pip this will attempt to uninstall.)actionrhelpz-vz --verbosecountr verbosityzDGive more output. Option is additive, and can be used up to 3 times.)rdefaultdestr)r) argparseArgumentParser add_argumentformat ensurepipr parse_argsZ_uninstall_helperr)argvparserargsr,/usr/lib64/python3.6/ensurepip/_uninstall.py_mains   r__main__)N)__doc__r rsysr__name__exitrrrrs  __pycache__/_uninstall.cpython-36.opt-2.pyc000064400000001501147204471250014515 0ustar003 \(@s:ddlZddlZddlZdddZedkr6ejedS)NcCsVtjdd}|jdddjtjdd|jdd d d d d d|j|}tj|jdS)Nzpython -m ensurepip._uninstall)progz --versionversionzpip {}z7Show the version of pip this will attempt to uninstall.)actionrhelpz-vz --verbosecountr verbosityzDGive more output. Option is additive, and can be used up to 3 times.)rdefaultdestr)r) argparseArgumentParser add_argumentformat ensurepipr parse_argsZ_uninstall_helperr)argvparserargsr,/usr/lib64/python3.6/ensurepip/_uninstall.py_mains   r__main__)N)r rsysr__name__exitrrrrs  __pycache__/_uninstall.cpython-36.pyc000064400000001626147204471250013565 0ustar003 \(@s>dZddlZddlZddlZdddZedkr:ejedS)zDBasic pip uninstallation support, helper for the Windows uninstallerNcCsVtjdd}|jdddjtjdd|jdd d d d d d|j|}tj|jdS)Nzpython -m ensurepip._uninstall)progz --versionversionzpip {}z7Show the version of pip this will attempt to uninstall.)actionrhelpz-vz --verbosecountr verbosityzDGive more output. Option is additive, and can be used up to 3 times.)rdefaultdestr)r) argparseArgumentParser add_argumentformat ensurepipr parse_argsZ_uninstall_helperr)argvparserargsr,/usr/lib64/python3.6/ensurepip/_uninstall.py_mains   r__main__)N)__doc__r rsysr__name__exitrrrrs  __init__.py000064400000015520147204471250006666 0ustar00import distutils.version import glob import os import os.path import sys import tempfile __all__ = ["version", "bootstrap"] _WHEEL_DIR = "/usr/share/python{}-wheels/".format(sys.version_info[0]) def _get_most_recent_wheel_version(pkg): prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg)) suffix = "-py2.py3-none-any.whl" pattern = "{}*{}".format(prefix, suffix) versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern)) return str(max(versions, key=distutils.version.LooseVersion)) _SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools") _PIP_VERSION = _get_most_recent_wheel_version("pip") _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION), ("pip", _PIP_VERSION), ] def _run_pip(args, additional_paths=None): # Add our bundled software to the sys.path so we can import it if additional_paths is not None: sys.path = additional_paths + sys.path try: # pip 10 from pip._internal import main except ImportError: # pip 9 from pip import main if args[0] in ["install", "list", "wheel"]: args.append('--pre') return main(args) def version(): """ Returns a string specifying the bundled version of pip. """ return _PIP_VERSION def _disable_pip_configuration_settings(): # We deliberately ignore all pip environment variables # when invoking pip # See http://bugs.python.org/issue19734 for details keys_to_remove = [k for k in os.environ if k.startswith("PIP_")] for k in keys_to_remove: del os.environ[k] # We also ignore the settings in the default pip configuration file # See http://bugs.python.org/issue20053 for details os.environ['PIP_CONFIG_FILE'] = os.devnull def bootstrap(*, root=None, upgrade=False, user=False, altinstall=False, default_pip=False, verbosity=0): """ Bootstrap pip into the current Python installation (or the given root directory). Note that calling this function will alter both sys.path and os.environ. """ # Discard the return value _bootstrap(root=root, upgrade=upgrade, user=user, altinstall=altinstall, default_pip=default_pip, verbosity=verbosity) def _bootstrap(*, root=None, upgrade=False, user=False, altinstall=False, default_pip=False, verbosity=0): """ Bootstrap pip into the current Python installation (or the given root directory). Returns pip command status code. Note that calling this function will alter both sys.path and os.environ. """ if altinstall and default_pip: raise ValueError("Cannot use altinstall and default_pip together") _disable_pip_configuration_settings() # By default, installing pip and setuptools installs all of the # following scripts (X.Y == running Python version): # # pip, pipX, pipX.Y, easy_install, easy_install-X.Y # # pip 1.5+ allows ensurepip to request that some of those be left out if altinstall: # omit pip, pipX and easy_install os.environ["ENSUREPIP_OPTIONS"] = "altinstall" elif not default_pip: # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" with tempfile.TemporaryDirectory() as tmpdir: # Put our bundled wheels into a temporary directory and construct the # additional paths that need added to sys.path additional_paths = [] for project, version in _PROJECTS: wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp: with open(os.path.join(tmpdir, wheel_name), "wb") as fp: fp.write(sfp.read()) additional_paths.append(os.path.join(tmpdir, wheel_name)) # Construct the arguments to be passed to the pip command args = ["install", "--no-index", "--find-links", tmpdir] if root: args += ["--root", root] if upgrade: args += ["--upgrade"] if user: args += ["--user"] if verbosity: args += ["-" + "v" * verbosity] return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) def _uninstall_helper(*, verbosity=0): """Helper to support a clean default uninstall process on Windows Note that calling this function may alter os.environ. """ # Nothing to do if pip was never installed, or has been removed try: import pip except ImportError: return # If the pip version doesn't match the bundled one, leave it alone if pip.__version__ != _PIP_VERSION: msg = ("ensurepip will only uninstall a matching version " "({!r} installed, {!r} bundled)") print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr) return _disable_pip_configuration_settings() # Construct the arguments to be passed to the pip command args = ["uninstall", "-y", "--disable-pip-version-check"] if verbosity: args += ["-" + "v" * verbosity] return _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) def _main(argv=None): import argparse parser = argparse.ArgumentParser(prog="python -m ensurepip") parser.add_argument( "--version", action="version", version="pip {}".format(version()), help="Show the version of pip that is bundled with this Python.", ) parser.add_argument( "-v", "--verbose", action="count", default=0, dest="verbosity", help=("Give more output. Option is additive, and can be used up to 3 " "times."), ) parser.add_argument( "-U", "--upgrade", action="store_true", default=False, help="Upgrade pip and dependencies, even if already installed.", ) parser.add_argument( "--user", action="store_true", default=False, help="Install using the user scheme.", ) parser.add_argument( "--root", default=None, help="Install everything relative to this alternate root directory.", ) parser.add_argument( "--altinstall", action="store_true", default=False, help=("Make an alternate install, installing only the X.Y versioned " "scripts (Default: pipX, pipX.Y, easy_install-X.Y)."), ) parser.add_argument( "--default-pip", action="store_true", default=False, help=("Make a default pip install, installing the unqualified pip " "and easy_install in addition to the versioned scripts."), ) args = parser.parse_args(argv) return _bootstrap( root=args.root, upgrade=args.upgrade, user=args.user, verbosity=args.verbosity, altinstall=args.altinstall, default_pip=args.default_pip, ) __main__.py000064400000000130147204471250006636 0ustar00import ensurepip import sys if __name__ == "__main__": sys.exit(ensurepip._main()) _uninstall.py000064400000001450147204471250007274 0ustar00"""Basic pip uninstallation support, helper for the Windows uninstaller""" import argparse import ensurepip import sys def _main(argv=None): parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall") parser.add_argument( "--version", action="version", version="pip {}".format(ensurepip.version()), help="Show the version of pip this will attempt to uninstall.", ) parser.add_argument( "-v", "--verbose", action="count", default=0, dest="verbosity", help=("Give more output. Option is additive, and can be used up to 3 " "times."), ) args = parser.parse_args(argv) return ensurepip._uninstall_helper(verbosity=args.verbosity) if __name__ == "__main__": sys.exit(_main())