kitir/_libs/package_utils.py
def pip_cmd(*packages, **kwargs):
    """
    executes pip on current machine. Using the supplied mode and packages
    :param packages: a list of packages,
    :param kwargs: kwargs for iexec and flags
    :return:
    """

    # delete pip cache dir
    shutil.rmtree('/root/.cache/pip', ignore_errors=True)

    # test for pip
    if running_on_windows:
        pip_base = 'python -m pip'
    else:
        pip_base = verify_pip(**kwargs)

    mode = kwargs.pop('mode', 'install')

    # validate
    assert mode in ['install', 'uninstall']  # todo: expand modes

    # kwargs
    kwargs.setdefault('trace_file', ir_artifact_dir + '/packages/pip/pip_iexec_trace.out')
    kwargs.setdefault('to_console', True)

    # flags  # todo: expand flags
    flags = []
    if mode == 'install' and kwargs.pop('upgrade', True):
        flags.append('--upgrade')
    if mode == 'install' and kwargs.pop('egg', True):
        flags.append('--egg')
    if mode == 'install' and kwargs.pop('force_reinstall', True):
        flags.append('--force-reinstall')
    if mode == 'uninstall' and kwargs.pop('yes', True):
        flags.append('--yes')
    if mode == 'install' and kwargs.pop('isolated', False):
        flags.append('--isolated')
    if mode == 'install' and kwargs.pop('disable_cache', False):
        flags.append('--no-cache-dir')

    # cmd
    cmd = '{} {} {} {}'.format(pip_base, mode, ' '.join(flags), ' '.join(packages))

    return iexec(cmd, **kwargs)

    executes pip on current machine. Using the supplied mode and packages
    :param packages: a list of packages,
    :param kwargs: kwargs for iexec and flags
    :return:
    
executes pip on current machine. Using the supplied mode and packages
executes pip on current machine . Using the supplied mode and packages
def pip_cmd(*packages, **kwargs):
    shutil.rmtree('/root/.cache/pip', ignore_errors=True)
    if running_on_windows:
        pip_base = 'python -m pip'
    else:
        pip_base = verify_pip(**kwargs)
    mode = kwargs.pop('mode', 'install')
    assert mode in ['install', 'uninstall']  
    kwargs.setdefault('trace_file', ir_artifact_dir + '/packages/pip/pip_iexec_trace.out')
    kwargs.setdefault('to_console', True)
    flags = []
    if mode == 'install' and kwargs.pop('upgrade', True):
        flags.append('--upgrade')
    if mode == 'install' and kwargs.pop('egg', True):
        flags.append('--egg')
    if mode == 'install' and kwargs.pop('force_reinstall', True):
        flags.append('--force-reinstall')
    if mode == 'uninstall' and kwargs.pop('yes', True):
        flags.append('--yes')
    if mode == 'install' and kwargs.pop('isolated', False):
        flags.append('--isolated')
    if mode == 'install' and kwargs.pop('disable_cache', False):
        flags.append('--no-cache-dir')
    cmd = '{} {} {} {}'.format(pip_base, mode, ' '.join(flags), ' '.join(packages))
    return iexec(cmd, **kwargs)
def pip_cmd ( * packages , ** kwargs ) : shutil . rmtree ( '/root/.cache/pip' , ignore_errors = True ) if running_on_windows : pip_base = 'python -m pip' else : pip_base = verify_pip ( ** kwargs ) mode = kwargs . pop ( 'mode' , 'install' ) assert mode in [ 'install' , 'uninstall' ] kwargs . setdefault ( 'trace_file' , ir_artifact_dir + '/packages/pip/pip_iexec_trace.out' ) kwargs . setdefault ( 'to_console' , True ) flags = [ ] if mode == 'install' and kwargs . pop ( 'upgrade' , True ) : flags . append ( '--upgrade' ) if mode == 'install' and kwargs . pop ( 'egg' , True ) : flags . append ( '--egg' ) if mode == 'install' and kwargs . pop ( 'force_reinstall' , True ) : flags . append ( '--force-reinstall' ) if mode == 'uninstall' and kwargs . pop ( 'yes' , True ) : flags . append ( '--yes' ) if mode == 'install' and kwargs . pop ( 'isolated' , False ) : flags . append ( '--isolated' ) if mode == 'install' and kwargs . pop ( 'disable_cache' , False ) : flags . append ( '--no-cache-dir' ) cmd = '{} {} {} {}' . format ( pip_base , mode , ' ' . join ( flags ) , ' ' . join ( packages ) ) return iexec ( cmd , ** kwargs )
executes pip on current machine.
executes pip on current machine .
"""
    executes pip on current machine. Using the supplied mode and packages
    :param packages: a list of packages,
    :param kwargs: kwargs for iexec and flags
    :return:
    """ # delete pip cache dir # test for pip # validate # todo: expand modes # kwargs # flags  # todo: expand flags # cmd
None
packages
a list of packages.
a list of packages .
kwargs
kwargs for iexec and flags
kwargs for iexec and flags