eric7.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

DefaultIndexUrlPypi
DefaultIndexUrlSearch
DefaultIndexUrlSimple
DefaultPyPiUrl

Class Methods

None

Methods

Pip Constructor
__checkUpgradePyQt Private method to check, if an upgrade of PyQt packages is attempted.
cacheList Public method to list files contained in the pip cache.
cachePurge Public method to remove all files from the pip cache.
cacheRemove Public method to remove files from the pip cache.
getIndexUrl Public method to get the index URL for PyPI.
getIndexUrlPypi Public method to get the index URL for PyPI API calls.
getIndexUrlSearch Public method to get the index URL for PyPI API calls.
getInstalledPackages Public method to get the list of installed packages.
getNetworkAccessManager Public method to get a reference to the network access manager object.
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.
showCacheInfo Public method to show some information about the pip cache.
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
Return:
flag indicating to abort the upgrade attempt
Return Type:
bool

Pip.cacheList

cacheList(venvName)

Public method to list files contained in the pip cache.

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

Pip.cachePurge

cachePurge(venvName)

Public method to remove all files from the pip cache.

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

Pip.cacheRemove

cacheRemove(venvName)

Public method to remove files from the pip cache.

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

Pip.getIndexUrl

getIndexUrl()

Public method to get the index URL for PyPI.

Return:
index URL for PyPI
Return Type:
str

Pip.getIndexUrlPypi

getIndexUrlPypi()

Public method to get the index URL for PyPI API calls.

Return:
index URL for XML RPC calls
Return Type:
str

Pip.getIndexUrlSearch

getIndexUrlSearch()

Public method to get the index URL for PyPI API calls.

Return:
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
Return:
list of tuples containing the package name and version
Return Type:
list of tuple of (str, str)

Pip.getNetworkAccessManager

getNetworkAccessManager()

Public method to get a reference to the network access manager object.

Return:
reference to the network access manager object
Return Type:
QNetworkAccessManager

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
Return:
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
Return:
dictionary containing PyPI package data
Return Type:
dict

Pip.getProjectEnvironmentString

getProjectEnvironmentString()

Public method to get the string for the project environment.

Return:
string for the project environment
Return Type:
str

Pip.getUserConfig

getUserConfig()

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

Return:
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
Return:
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
Return:
interpreter path
Return Type:
str

Pip.getVirtualenvNames

getVirtualenvNames(noRemote=False, noConda=False)

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

noRemote (bool)
flag indicating to exclude environments for remote debugging
noConda (bool)
flag indicating to exclude Conda environments
Return:
sorted list of virtual environment names
Return Type:
list of str

Pip.installPackages

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

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
forceReinstall (bool)
flag indicating to force a reinstall of the packages

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
Return:
tuple containing a flag indicating success and the output of the process
Return Type:
tuple of (bool, str)

Pip.showCacheInfo

showCacheInfo(venvName)

Public method to show some information about the pip cache.

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

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
Return:
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
Return:
flag indicating a successful execution
Return Type:
bool
Up