/home/lnzliplg/www/ensurepip.tar
__pycache__/__main__.cpython-38.opt-1.pyc000064400000000344151735157710014100 0ustar00U

e5dX�@s*ddlZddlZedkr&e�e���dS)�N�__main__)Z	ensurepip�sys�__name__�exitZ_main�rr�*/usr/lib64/python3.8/ensurepip/__main__.py�<module>s__pycache__/__main__.cpython-38.pyc000064400000000344151735157710013141 0ustar00U

e5dX�@s*ddlZddlZedkr&e�e���dS)�N�__main__)Z	ensurepip�sys�__name__�exitZ_main�rr�*/usr/lib64/python3.8/ensurepip/__main__.py�<module>s__pycache__/_uninstall.cpython-38.pyc000064400000001650151735157710013572 0ustar00U

e5d(�@s>dZddlZddlZddlZddd�Zedkr:e�e��dS)zDBasic pip uninstallation support, helper for the Windows uninstaller�NcCsVtjdd�}|jddd�t���dd�|jdd	d
ddd
d�|�|�}tj|jd�S)Nzpython -m ensurepip._uninstall)�progz	--version�versionzpip {}z7Show the version of pip this will attempt to uninstall.)�actionr�helpz-vz	--verbose�countr�	verbosityzDGive more output. Option is additive, and can be used up to 3 times.)r�default�destr)r)	�argparse�ArgumentParser�add_argument�format�	ensurepipr�
parse_argsZ_uninstall_helperr)�argv�parser�args�r�,/usr/lib64/python3.8/ensurepip/_uninstall.py�_mains"��	
r�__main__)N)�__doc__r
r�sysr�__name__�exitrrrr�<module>s
__pycache__/_uninstall.cpython-38.opt-2.pyc000064400000001523151735157710014531 0ustar00U

e5d(�@s:ddlZddlZddlZddd�Zedkr6e�e��dS)�NcCsVtjdd�}|jddd�t���dd�|jdd	d
ddd
d�|�|�}tj|jd�S)Nzpython -m ensurepip._uninstall)�progz	--version�versionzpip {}z7Show the version of pip this will attempt to uninstall.)�actionr�helpz-vz	--verbose�countr�	verbosityzDGive more output. Option is additive, and can be used up to 3 times.)r�default�destr)r)	�argparse�ArgumentParser�add_argument�format�	ensurepipr�
parse_argsZ_uninstall_helperr)�argv�parser�args�r�,/usr/lib64/python3.8/ensurepip/_uninstall.py�_mains"��	
r�__main__)N)r
r�sysr�__name__�exitrrrr�<module>s

__pycache__/__init__.cpython-38.opt-2.pyc000064400000012065151735157710014123 0ustar00U

&�.eb�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddgZ	dZ
dZiZdd�Z
e
d�Ze
d	�Zded
fd	ed
fgZddd�Zd
d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N�version�	bootstrap)�
setuptools�pipz/usr/share/python38-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|��}tj�|�t||<q:q t	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�
_WHEEL_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�*/usr/lib64/python3.8/ensurepip/__init__.py�_get_most_recent_wheel_versionsrrrZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS)	Nz$
import runpy
import sys
sys.path = z + sys.path
sys.argv[1:] = z>
runpy.run_module("pip", run_name="__main__", alter_sys=True)
z-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip's��r&cCstS)N)�_PIP_VERSIONrrrrr;scCs2dd�tjD�}|D]}tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)�
startswith)�.0�krrr�
<listcomp>Es
z7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settingsAs
r.F��root�upgrade�user�
altinstall�default_pip�	verbositycCst||||||d�dS)Nr/)�
_bootstrapr/rrrrMs

�cCsP|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t�����}g}tD]x\}}	}
t	||	}t
tj�t
|�d��4}t
tj�||�d��}
|
�|���W5QRXW5QRX|�tj�||��qTddd	d
|g}|r�|d|g7}|r�|dg7}|�r
|d
g7}|�r"|dd|g7}t|dd�tD�|�W5QR�SQRXdS)Nz.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--user�-�vcSsg|]}|d�qS�rr�r)�prrrr+�sz_bootstrap.<locals>.<listcomp>)�
ValueErrorr�auditr.rr,�tempfileZTemporaryDirectory�	_PROJECTSr�openrr	r
�write�read�appendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ
wheel_nameZsfp�fpr"rrrr6\s4	
"

r6)r5cCs�zddl}Wntk
r"YdSX|jtkrNd}t|�|jt�tjd�dSt�dddg}|rt|dd|g7}t	|d	d
�t
t�D��S)NrzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))�fileZ	uninstallz-yz--disable-pip-version-checkr<r=cSsg|]}|d�qSr>rr?rrrr+�sz%_uninstall_helper.<locals>.<listcomp>)r�ImportError�__version__r'�printrr�stderrr.r&�reversedrD)r5r�msgr"rrr�_uninstall_helper�s

rQcCs�ddl}|jdd�}|jddd�t��dd�|jd	d
dddd
d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j	|j
|j|jd�S)Nrzpython -m ensurepip)�progz	--versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz	--verbose�countr5zDGive more output. Option is additive, and can be used up to 3 times.)rS�default�destrTz-Ur:�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz--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.)r0r1r2r5r3r4)
�argparse�ArgumentParser�add_argumentrr�
parse_argsr6r0r1r2r5r3r4)�argvrY�parserr"rrr�_main�sn
�������
�r_)N)N)Zdistutils.versionrr
rZos.pathrZrunpyrCr�__all__Z_PACKAGE_NAMESr
rrZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrr�<module>s@�
��6__pycache__/__main__.cpython-38.opt-2.pyc000064400000000344151735157710014101 0ustar00U

e5dX�@s*ddlZddlZedkr&e�e���dS)�N�__main__)Z	ensurepip�sys�__name__�exitZ_main�rr�*/usr/lib64/python3.8/ensurepip/__main__.py�<module>s__pycache__/_uninstall.cpython-38.opt-1.pyc000064400000001650151735157710014531 0ustar00U

e5d(�@s>dZddlZddlZddlZddd�Zedkr:e�e��dS)zDBasic pip uninstallation support, helper for the Windows uninstaller�NcCsVtjdd�}|jddd�t���dd�|jdd	d
ddd
d�|�|�}tj|jd�S)Nzpython -m ensurepip._uninstall)�progz	--version�versionzpip {}z7Show the version of pip this will attempt to uninstall.)�actionr�helpz-vz	--verbose�countr�	verbosityzDGive more output. Option is additive, and can be used up to 3 times.)r�default�destr)r)	�argparse�ArgumentParser�add_argument�format�	ensurepipr�
parse_argsZ_uninstall_helperr)�argv�parser�args�r�,/usr/lib64/python3.8/ensurepip/_uninstall.py�_mains"��	
r�__main__)N)�__doc__r
r�sysr�__name__�exitrrrr�<module>s
__pycache__/__init__.cpython-38.pyc000064400000013166151735157710013166 0ustar00U

&�.eb�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddgZ	dZ
dZiZdd�Z
e
d�Ze
d	�Zded
fd	ed
fgZddd�Zd
d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N�version�	bootstrap)�
setuptools�pipz/usr/share/python38-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|��}tj�|�t||<q:q t	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�
_WHEEL_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�*/usr/lib64/python3.8/ensurepip/__init__.py�_get_most_recent_wheel_versionsrrrZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS)	Nz$
import runpy
import sys
sys.path = z + sys.path
sys.argv[1:] = z>
runpy.run_module("pip", run_name="__main__", alter_sys=True)
z-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip's��r&cCstS)zA
    Returns a string specifying the bundled version of pip.
    )�_PIP_VERSIONrrrrr;scCs2dd�tjD�}|D]}tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)�
startswith)�.0�krrr�
<listcomp>Es
z7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settingsAs
r.F��root�upgrade�user�
altinstall�default_pip�	verbositycCst||||||d�dS)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/N)�
_bootstrapr/rrrrMs

�cCsP|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t�����}g}tD]x\}}	}
t	||	}t
tj�t
|�d��4}t
tj�||�d��}
|
�|���W5QRXW5QRX|�tj�||��qTddd	d
|g}|r�|d|g7}|r�|dg7}|�r
|d
g7}|�r"|dd|g7}t|dd�tD�|�W5QR�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 togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--user�-�vcSsg|]}|d�qS�rr�r)�prrrr+�sz_bootstrap.<locals>.<listcomp>N)�
ValueErrorr�auditr.rr,�tempfileZTemporaryDirectory�	_PROJECTSr�openrr	r
�write�read�appendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ
wheel_nameZsfp�fpr"rrrr6\s4	
"

r6)r5cCs�zddl}Wntk
r"YdSX|jtkrNd}t|�|jt�tjd�dSt�dddg}|rt|dd	|g7}t	|d
d�t
t�D��S)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-checkr<r=cSsg|]}|d�qSr>rr?rrrr+�sz%_uninstall_helper.<locals>.<listcomp>)r�ImportError�__version__r'�printrr�stderrr.r&�reversedrD)r5r�msgr"rrr�_uninstall_helper�s

rQcCs�ddl}|jdd�}|jddd�t��dd�|jd	d
dddd
d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j	|j
|j|jd�S)Nrzpython -m ensurepip)�progz	--versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz	--verbose�countr5zDGive more output. Option is additive, and can be used up to 3 times.)rS�default�destrTz-Ur:�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz--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.)r0r1r2r5r3r4)
�argparse�ArgumentParser�add_argumentrr�
parse_argsr6r0r1r2r5r3r4)�argvrY�parserr"rrr�_main�sn
�������
�r_)N)N)Zdistutils.versionrr
rZos.pathrZrunpyrCr�__all__Z_PACKAGE_NAMESr
rrZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrr�<module>s@�
��6__pycache__/__init__.cpython-38.opt-1.pyc000064400000013166151735157710014125 0ustar00U

&�.eb�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddgZ	dZ
dZiZdd�Z
e
d�Ze
d	�Zded
fd	ed
fgZddd�Zd
d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N�version�	bootstrap)�
setuptools�pipz/usr/share/python38-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|��}tj�|�t||<q:q t	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�
_WHEEL_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�*/usr/lib64/python3.8/ensurepip/__init__.py�_get_most_recent_wheel_versionsrrrZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS)	Nz$
import runpy
import sys
sys.path = z + sys.path
sys.argv[1:] = z>
runpy.run_module("pip", run_name="__main__", alter_sys=True)
z-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip's��r&cCstS)zA
    Returns a string specifying the bundled version of pip.
    )�_PIP_VERSIONrrrrr;scCs2dd�tjD�}|D]}tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)�
startswith)�.0�krrr�
<listcomp>Es
z7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settingsAs
r.F��root�upgrade�user�
altinstall�default_pip�	verbositycCst||||||d�dS)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/N)�
_bootstrapr/rrrrMs

�cCsP|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t�����}g}tD]x\}}	}
t	||	}t
tj�t
|�d��4}t
tj�||�d��}
|
�|���W5QRXW5QRX|�tj�||��qTddd	d
|g}|r�|d|g7}|r�|dg7}|�r
|d
g7}|�r"|dd|g7}t|dd�tD�|�W5QR�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 togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--user�-�vcSsg|]}|d�qS�rr�r)�prrrr+�sz_bootstrap.<locals>.<listcomp>N)�
ValueErrorr�auditr.rr,�tempfileZTemporaryDirectory�	_PROJECTSr�openrr	r
�write�read�appendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ
wheel_nameZsfp�fpr"rrrr6\s4	
"

r6)r5cCs�zddl}Wntk
r"YdSX|jtkrNd}t|�|jt�tjd�dSt�dddg}|rt|dd	|g7}t	|d
d�t
t�D��S)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-checkr<r=cSsg|]}|d�qSr>rr?rrrr+�sz%_uninstall_helper.<locals>.<listcomp>)r�ImportError�__version__r'�printrr�stderrr.r&�reversedrD)r5r�msgr"rrr�_uninstall_helper�s

rQcCs�ddl}|jdd�}|jddd�t��dd�|jd	d
dddd
d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j	|j
|j|jd�S)Nrzpython -m ensurepip)�progz	--versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz	--verbose�countr5zDGive more output. Option is additive, and can be used up to 3 times.)rS�default�destrTz-Ur:�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz--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.)r0r1r2r5r3r4)
�argparse�ArgumentParser�add_argumentrr�
parse_argsr6r0r1r2r5r3r4)�argvrY�parserr"rrr�_main�sn
�������
�r_)N)N)Zdistutils.versionrr
rZos.pathrZrunpyrCr�__all__Z_PACKAGE_NAMESr
rrZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrr�<module>s@�
��6_uninstall.py000064400000001450151735157710007302 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())
__init__.py000064400000016542151735157710006701 0ustar00import distutils.version
import glob
import os
import os.path
import sys
import runpy
import tempfile
import subprocess


__all__ = ["version", "bootstrap"]
_PACKAGE_NAMES = ('setuptools', 'pip')

_WHEEL_DIR = "/usr/share/python38-wheels/"

_wheels = {}

def _get_most_recent_wheel_version(pkg):
    prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
    _wheels[pkg] = {}
    for suffix in "-py2.py3-none-any.whl", "-py3-none-any.whl":
        pattern = "{}*{}".format(prefix, suffix)
        for path in glob.glob(pattern):
            version_str = path[len(prefix):-len(suffix)]
            _wheels[pkg][version_str] = os.path.basename(path)
    return str(max(_wheels[pkg], key=distutils.version.LooseVersion))


_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")

_PIP_VERSION = _get_most_recent_wheel_version("pip")

_PROJECTS = [
    ("setuptools", _SETUPTOOLS_VERSION, "py3"),
    ("pip", _PIP_VERSION, "py3"),
]


def _run_pip(args, additional_paths=None):
    # Run the bootstraping in a subprocess to avoid leaking any state that happens
    # after pip has executed. Particulary, this avoids the case when pip holds onto
    # the files in *additional_paths*, preventing us to remove them at the end of the
    # invocation.
    code = f"""
import runpy
import sys
sys.path = {additional_paths or []} + sys.path
sys.argv[1:] = {args}
runpy.run_module("pip", run_name="__main__", alter_sys=True)
"""

    cmd = [sys.executable, '-c', code]
    if sys.flags.isolated:
        # run code in isolated mode if currently running isolated
        cmd.insert(1, '-I')
    return subprocess.run(cmd, check=True).returncode


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")

    sys.audit("ensurepip.bootstrap", root)

    _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, py_tag in _PROJECTS:
            wheel_name = _wheels[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-cache-dir", "--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__.py000064400000000130151735157710006644 0ustar00import ensurepip
import sys

if __name__ == "__main__":
    sys.exit(ensurepip._main())