# eric6.PipInterface.Pip

Package implementing the pip GUI logic.

### Global Attributes

None

### Classes

Pip | Class implementing the pip GUI logic.

### Functions

None

## Pip

Class implementing the pip GUI logic.

### Derived from

QObject

### Class Attributes

DefaultIndexUrlPip
DefaultIndexUrlXml
DefaultPyPiUrl

### Class Methods

None

### Methods

Pip | Constructor
__checkUpgradePyQt | Private method to check, if an upgrade of PyQt packages is attempted.
getIndexUrl | Public method to get the index URL for PyPI.
getIndexUrlXml | Public method to get the index URL for XML RPC calls.
getInstalledPackages | Public method to get the list of installed packages.
getOutdatedPackages | Public method to get the list of outdated packages.
getPackageDetails | Public method to get package details using the PyPI JSON interface.
getProjectEnvironmentString | Public method to get the string for the project environment.
getUserConfig | Public method to get the name of the user configuration file.
getVirtualenvConfig | Public method to get the name of the virtualenv configuration file.
getVirtualenvInterpreter | Public method to get the interpreter for a virtual environment.
getVirtualenvNames | Public method to get a sorted list of virtual environment names.
installPackages | Public method to install the given list of packages.
installPip | Public method to install pip.
installRequirements | Public method to install packages as given in a requirements file.
repairPip | Public method to repair the pip installation.
runProcess | Public method to execute the current pip with the given arguments.
uninstallPackages | Public method to uninstall the given list of packages.
uninstallRequirements | Public method to uninstall packages as given in a requirements file.
upgradePackages | Public method to upgrade the given list of packages.

### Static Methods

None

#### Pip (Constructor)

Pip(parent=None)

Constructor

parent (QObject)
  parent

#### Pip.__checkUpgradePyQt

__checkUpgradePyQt(packages)

Private method to check, if an upgrade of PyQt packages is attempted.

packages (list of str)
  list of packages to upgrade

Returns:
  flag indicating to abort the upgrade attempt

Return Type:
  bool

#### Pip.getIndexUrl

getIndexUrl()

Public method to get the index URL for PyPI.

Returns:
  index URL for PyPI

Return Type:
  str

#### Pip.getIndexUrlXml

getIndexUrlXml()

Public method to get the index URL for XML RPC calls.

Returns:
  index URL for XML RPC calls

Return Type:
  str

#### Pip.getInstalledPackages

getInstalledPackages(envName, localPackages=True, notRequired=False, usersite=False)

Public method to get the list of installed packages.

envName (str)
  name of the environment to get the packages for
localPackages (bool)
  flag indicating to get local packages only
notRequired (bool)
  flag indicating to list packages that are not dependencies of installed packages as well
usersite (bool)
  flag indicating to only list packages installed in user-site

Returns:
  list of tuples containing the package name and version

Return Type:
  list of tuple of (str, str)

#### Pip.getOutdatedPackages

getOutdatedPackages(envName, localPackages=True, notRequired=False, usersite=False)

Public method to get the list of outdated packages.

envName (str)
  name of the environment to get the packages for
localPackages (bool)
  flag indicating to get local packages only
notRequired (bool)
  flag indicating to list packages that are not dependencies of installed packages as well
usersite (bool)
  flag indicating to only list packages installed in user-site

Returns:
  list of tuples containing the package name, installed version and available version

Return Type:
  list of tuple of (str, str, str)

#### Pip.getPackageDetails

getPackageDetails(name, version)

Public method to get package details using the PyPI JSON interface.

name (str)
  package name
version (str)
  package version

Returns:
  dictionary containing PyPI package data

Return Type:
  dict

#### Pip.getProjectEnvironmentString

getProjectEnvironmentString()

Public method to get the string for the project environment.

Returns:
  string for the project environment

Return Type:
  str

#### Pip.getUserConfig

getUserConfig()

Public method to get the name of the user configuration file.

Returns:
  path of the user configuration file

Return Type:
  str

#### Pip.getVirtualenvConfig

getVirtualenvConfig(venvName)

Public method to get the name of the virtualenv configuration file.

venvName (str)
  name of the environment to get config file path for

Returns:
  path of the virtualenv configuration file

Return Type:
  str

#### Pip.getVirtualenvInterpreter

getVirtualenvInterpreter(venvName)

Public method to get the interpreter for a virtual environment.

venvName (str)
  logical name for the virtual environment

Returns:
  interpreter path

Return Type:
  str

#### Pip.getVirtualenvNames

getVirtualenvNames(noRemote=False)

Public method to get a sorted list of virtual environment names.

noRemote (bool)
  flag indicating to exclude environments for remote debugging

Returns:
  sorted list of virtual environment names

Return Type:
  list of str

#### Pip.installPackages

installPackages(packages, venvName="", userSite=False, interpreter="")

Public method to install the given list of packages.

packages (list of str)
  list of packages to install
venvName (str)
  name of the virtual environment to be used
userSite (bool)
  flag indicating an install to the user install directory
interpreter (str)
  interpreter to be used for execution

#### Pip.installPip

installPip(venvName, userSite=False)

Public method to install pip.

venvName (str)
  name of the environment to install pip into
userSite (bool)
  flag indicating an install to the user install directory

#### Pip.installRequirements

installRequirements(venvName)

Public method to install packages as given in a requirements file.

venvName (str)
  name of the virtual environment to be used

#### Pip.repairPip

repairPip(venvName)

Public method to repair the pip installation.

venvName (str)
  name of the environment to install pip into

#### Pip.runProcess

runProcess(args, interpreter)

Public method to execute the current pip with the given arguments.

The selected pip executable is called with the given arguments and waited for its end.

args (list of str)
  list of command line arguments
interpreter (str)
  path of the Python interpreter to be used

Returns:
  tuple containing a flag indicating success and the output of the process

Return Type:
  tuple of (bool, str)

#### Pip.uninstallPackages

uninstallPackages(packages, venvName)

Public method to uninstall the given list of packages.

packages (list of str)
  list of packages to uninstall
venvName (str)
  name of the virtual environment to be used

Returns:
  flag indicating a successful execution

Return Type:
  bool

#### Pip.uninstallRequirements

uninstallRequirements(venvName)

Public method to uninstall packages as given in a requirements file.

venvName (str)
  name of the virtual environment to be used

#### Pip.upgradePackages

upgradePackages(packages, venvName, userSite=False)

Public method to upgrade the given list of packages.

packages (list of str)
  list of packages to upgrade
venvName (str)
  name of the virtual environment to be used
userSite (bool)
  flag indicating an install to the user install directory

Returns:
  flag indicating a successful execution

Return Type:
  bool

Up