eric7.PipInterface.PipPackagesWidget

Module implementing the pip packages management widget.

Global Attributes

None

Classes

PipPackagesWidget Class implementing the pip packages management widget.
PypiSearchResultsParser Class implementing the parser for the PyPI search result page.

Functions

None


PipPackagesWidget

Class implementing the pip packages management widget.

Derived from

QWidget, Ui_PipPackagesWidget

Class Attributes

SearchVersionRole
ShowProcessClassifiersMode
ShowProcessEntryPointsMode
ShowProcessFilesListMode
ShowProcessGeneralMode

Class Methods

None

Methods

PipPackagesWidget Constructor
__aboutToShowPipMenu Private slot to set the action enabled status.
__allUpdateableItems Private method to get a list of all items that can be updated.
__availablePipVersion Private method to get the pip version of the selected environment.
__editConfiguration Private method to edit a configuration.
__editUserConfiguration Private slot to edit the user configuration.
__editVirtualenvConfiguration Private slot to edit the configuration of the selected environment.
__finishSearch Private slot performing the search finishing actions.
__generateRequirements Private slot to generate the contents for a requirements file.
__initPipMenu Private method to create the super menu and attach it to the super menu button.
__installLocalPackage Private slot to install a package available on local storage.
__installPackages Private slot to install packages to be given by the user.
__installPip Private slot to install pip into the selected environment.
__installPipUser Private slot to install pip into the user site for the selected environment.
__installRequirements Private slot to install packages as given in a requirements file.
__isPipAvailable Private method to check, if the pip package is available for the selected environment.
__pipConfigure Private slot to open the configuration page.
__populateEnvironments Private method to get a list of environments and populate the selector.
__projectClosed Private slot to handle the projectClosed signal.
__purgeCache Private slot to empty the pip cache.
__refreshPackagesList Private method to referesh the packages list.
__reinstallPackages Private slot to force a re-installation of the selected packages.
__removeCachedFiles Private slot to remove files from the pip cache.
__repairPip Private slot to repair the pip installation of the selected environment.
__search Private method to perform the search by calling the PyPI search URL.
__searchResponse Private method to extract the search result data from the response.
__selectedUpdateableItems Private method to get a list of selected items that can be updated.
__showCacheInfo Private slot to show information about the cache.
__showCacheList Private slot to show a list of cached files.
__showPackageDetails Private method to populate the package details dialog.
__showSearchedDetails Private slot to show details about the selected search result package.
__uninstallRequirements Private slot to uninstall packages as given in a requirements file.
__updateActionButtons Private method to set the state of the action buttons.
__updateSearchActionButtons Private method to update the action button states of the search widget.
__updateSearchButton Private method to update the state of the search button.
executeInstallPackages Public method to install the given list of packages.
executeUninstallPackages Public method to uninstall the given list of packages.
executeUpgradePackages Public method to execute the pip upgrade command.
getPip Public method to get a reference to the pip interface object.
on_environmentsComboBox_currentIndexChanged Private slot handling the selection of a Python environment.
on_installButton_clicked Private slot to handle pressing the Install button..
on_installUserSiteButton_clicked Private slot to handle pressing the Install to User-Site button..
on_installedFilesCheckBox_clicked Private slot to handle a change of the installed files information checkbox.
on_localCheckBox_clicked Private slot handling the switching of the local mode.
on_notRequiredCheckBox_clicked Private slot handling the switching of the 'not required' mode.
on_packagesList_itemActivated Private slot reacting on a package item activation.
on_packagesList_itemSelectionChanged Private slot handling the selection of a package.
on_refreshButton_clicked Private slot to refresh the display.
on_searchButton_clicked Private slot handling a press of the search button.
on_searchEditName_returnPressed Private slot initiating a search via a press of the Return key.
on_searchEditName_textChanged Private slot handling a change of the search term.
on_searchResultList_itemActivated Private slot reacting on an search result item activation.
on_searchResultList_itemSelectionChanged Private slot handling changes of the search result selection.
on_searchToggleButton_toggled Private slot to togle the search widget.
on_showDetailsButton_clicked Private slot to handle pressing the Show Details button.
on_showPackageDetailsButton_clicked Private slot to show information for the selected package.
on_uninstallButton_clicked Private slot to remove selected packages of the selected environment.
on_upgradeAllButton_clicked Private slot to upgrade all packages of the selected environment.
on_upgradeButton_clicked Private slot to upgrade selected packages of the selected environment.
on_userCheckBox_clicked Private slot handling the switching of the 'user-site' mode.
on_verboseCheckBox_clicked Private slot to handle a change of the verbose package information checkbox.

Static Methods

None

PipPackagesWidget (Constructor)

PipPackagesWidget(pip, parent=None)

Constructor

pip (Pip)
reference to the global pip interface
parent (QWidget)
reference to the parent widget

PipPackagesWidget.__aboutToShowPipMenu

__aboutToShowPipMenu()

Private slot to set the action enabled status.

PipPackagesWidget.__allUpdateableItems

__allUpdateableItems()

Private method to get a list of all items that can be updated.

Return:
list of all items that can be updated
Return Type:
list of QTreeWidgetItem

PipPackagesWidget.__availablePipVersion

__availablePipVersion()

Private method to get the pip version of the selected environment.

Return:
tuple containing the version number or tuple with all zeros in case pip is not available
Return Type:
tuple of int

PipPackagesWidget.__editConfiguration

__editConfiguration(venvName="")

Private method to edit a configuration.

venvName (str)
name of the environment to act upon

PipPackagesWidget.__editUserConfiguration

__editUserConfiguration()

Private slot to edit the user configuration.

PipPackagesWidget.__editVirtualenvConfiguration

__editVirtualenvConfiguration()

Private slot to edit the configuration of the selected environment.

PipPackagesWidget.__finishSearch

__finishSearch()

Private slot performing the search finishing actions.

PipPackagesWidget.__generateRequirements

__generateRequirements()

Private slot to generate the contents for a requirements file.

PipPackagesWidget.__initPipMenu

__initPipMenu()

Private method to create the super menu and attach it to the super menu button.

PipPackagesWidget.__installLocalPackage

__installLocalPackage()

Private slot to install a package available on local storage.

PipPackagesWidget.__installPackages

__installPackages()

Private slot to install packages to be given by the user.

PipPackagesWidget.__installPip

__installPip()

Private slot to install pip into the selected environment.

PipPackagesWidget.__installPipUser

__installPipUser()

Private slot to install pip into the user site for the selected environment.

PipPackagesWidget.__installRequirements

__installRequirements()

Private slot to install packages as given in a requirements file.

PipPackagesWidget.__isPipAvailable

__isPipAvailable()

Private method to check, if the pip package is available for the selected environment.

Return:
flag indicating availability
Return Type:
bool

PipPackagesWidget.__pipConfigure

__pipConfigure()

Private slot to open the configuration page.

PipPackagesWidget.__populateEnvironments

__populateEnvironments()

Private method to get a list of environments and populate the selector.

PipPackagesWidget.__projectClosed

__projectClosed(shutdown)

Private slot to handle the projectClosed signal.

shutdown (bool)
flag indicating the IDE shutdown

PipPackagesWidget.__purgeCache

__purgeCache()

Private slot to empty the pip cache.

PipPackagesWidget.__refreshPackagesList

__refreshPackagesList()

Private method to referesh the packages list.

PipPackagesWidget.__reinstallPackages

__reinstallPackages()

Private slot to force a re-installation of the selected packages.

PipPackagesWidget.__removeCachedFiles

__removeCachedFiles()

Private slot to remove files from the pip cache.

PipPackagesWidget.__repairPip

__repairPip()

Private slot to repair the pip installation of the selected environment.

PipPackagesWidget.__search

__search()

Private method to perform the search by calling the PyPI search URL.

PipPackagesWidget.__searchResponse

__searchResponse(reply)

Private method to extract the search result data from the response.

reply (QNetworkReply)
reference to the reply object containing the data

PipPackagesWidget.__selectedUpdateableItems

__selectedUpdateableItems()

Private method to get a list of selected items that can be updated.

Return:
list of selected items that can be updated
Return Type:
list of QTreeWidgetItem

PipPackagesWidget.__showCacheInfo

__showCacheInfo()

Private slot to show information about the cache.

PipPackagesWidget.__showCacheList

__showCacheList()

Private slot to show a list of cached files.

PipPackagesWidget.__showPackageDetails

__showPackageDetails(packageName, packageVersion, upgradable=False, installable=False)

Private method to populate the package details dialog.

packageName (str)
name of the package to show details for
packageVersion (str)
version of the package
upgradable (bool (optional))
flag indicating that the package may be upgraded (defaults to False)
installable (bool (optional))
flag indicating that the package may be installed (defaults to False)

PipPackagesWidget.__showSearchedDetails

__showSearchedDetails(item=None)

Private slot to show details about the selected search result package.

item (QTreeWidgetItem)
reference to the search result item to show details for

PipPackagesWidget.__uninstallRequirements

__uninstallRequirements()

Private slot to uninstall packages as given in a requirements file.

PipPackagesWidget.__updateActionButtons

__updateActionButtons()

Private method to set the state of the action buttons.

PipPackagesWidget.__updateSearchActionButtons

__updateSearchActionButtons()

Private method to update the action button states of the search widget.

PipPackagesWidget.__updateSearchButton

__updateSearchButton()

Private method to update the state of the search button.

PipPackagesWidget.executeInstallPackages

executeInstallPackages(packages, userSite=False)

Public method to install the given list of packages.

packages (list of str)
list of package names to be installed
userSite (bool)
flag indicating to install to the user directory

PipPackagesWidget.executeUninstallPackages

executeUninstallPackages(packages)

Public method to uninstall the given list of packages.

packages (list of str)
list of package names to be uninstalled

PipPackagesWidget.executeUpgradePackages

executeUpgradePackages(packages)

Public method to execute the pip upgrade command.

packages (list of str)
list of package names to be upgraded

PipPackagesWidget.getPip

getPip()

Public method to get a reference to the pip interface object.

Return:
reference to the pip interface object
Return Type:
Pip

PipPackagesWidget.on_environmentsComboBox_currentIndexChanged

on_environmentsComboBox_currentIndexChanged(index)

Private slot handling the selection of a Python environment.

index (int)
index of the selected Python environment

PipPackagesWidget.on_installButton_clicked

on_installButton_clicked()

Private slot to handle pressing the Install button..

PipPackagesWidget.on_installUserSiteButton_clicked

on_installUserSiteButton_clicked()

Private slot to handle pressing the Install to User-Site button..

PipPackagesWidget.on_installedFilesCheckBox_clicked

on_installedFilesCheckBox_clicked(checked)

Private slot to handle a change of the installed files information checkbox.

checked (bool)
state of the checkbox

PipPackagesWidget.on_localCheckBox_clicked

on_localCheckBox_clicked(checked)

Private slot handling the switching of the local mode.

checked (bool)
state of the local check box

PipPackagesWidget.on_notRequiredCheckBox_clicked

on_notRequiredCheckBox_clicked(checked)

Private slot handling the switching of the 'not required' mode.

checked (bool)
state of the 'not required' check box

PipPackagesWidget.on_packagesList_itemActivated

on_packagesList_itemActivated(item, column)

Private slot reacting on a package item activation.

item (QTreeWidgetItem)
reference to the activated item
column (int)
activated column

PipPackagesWidget.on_packagesList_itemSelectionChanged

on_packagesList_itemSelectionChanged()

Private slot handling the selection of a package.

PipPackagesWidget.on_refreshButton_clicked

on_refreshButton_clicked()

Private slot to refresh the display.

PipPackagesWidget.on_searchButton_clicked

on_searchButton_clicked()

Private slot handling a press of the search button.

PipPackagesWidget.on_searchEditName_returnPressed

on_searchEditName_returnPressed()

Private slot initiating a search via a press of the Return key.

PipPackagesWidget.on_searchEditName_textChanged

on_searchEditName_textChanged(txt)

Private slot handling a change of the search term.

txt (str)
search term

PipPackagesWidget.on_searchResultList_itemActivated

on_searchResultList_itemActivated(item, column)

Private slot reacting on an search result item activation.

item (QTreeWidgetItem)
reference to the activated item
column (int)
activated column

PipPackagesWidget.on_searchResultList_itemSelectionChanged

on_searchResultList_itemSelectionChanged()

Private slot handling changes of the search result selection.

PipPackagesWidget.on_searchToggleButton_toggled

on_searchToggleButton_toggled(checked)

Private slot to togle the search widget.

checked (bool)
state of the search widget button

PipPackagesWidget.on_showDetailsButton_clicked

on_showDetailsButton_clicked()

Private slot to handle pressing the Show Details button.

PipPackagesWidget.on_showPackageDetailsButton_clicked

on_showPackageDetailsButton_clicked()

Private slot to show information for the selected package.

PipPackagesWidget.on_uninstallButton_clicked

on_uninstallButton_clicked()

Private slot to remove selected packages of the selected environment.

PipPackagesWidget.on_upgradeAllButton_clicked

on_upgradeAllButton_clicked()

Private slot to upgrade all packages of the selected environment.

PipPackagesWidget.on_upgradeButton_clicked

on_upgradeButton_clicked()

Private slot to upgrade selected packages of the selected environment.

PipPackagesWidget.on_userCheckBox_clicked

on_userCheckBox_clicked(checked)

Private slot handling the switching of the 'user-site' mode.

checked (bool)
state of the 'user-site' check box

PipPackagesWidget.on_verboseCheckBox_clicked

on_verboseCheckBox_clicked(checked)

Private slot to handle a change of the verbose package information checkbox.

checked (bool)
state of the checkbox
Up


PypiSearchResultsParser

Class implementing the parser for the PyPI search result page.

Derived from

html.parser.HTMLParser

Class Attributes

ClassPrefix

Class Methods

None

Methods

PypiSearchResultsParser Constructor
__getClass Private method to extract the class attribute out of the list of attributes.
__getDate Private method to extract the datetime attribute out of the list of attributes and process it.
getResults Public method to get the extracted search results.
handle_data Public method process arbitrary data.
handle_endtag Public method to process the end tag.
handle_starttag Public method to process the start tag.

Static Methods

None

PypiSearchResultsParser (Constructor)

PypiSearchResultsParser(data)

Constructor

data (str)
data to be parsed

PypiSearchResultsParser.__getClass

__getClass(attrs)

Private method to extract the class attribute out of the list of attributes.

attrs (list of tuple of (str, str))
list of tag attributes as (name, value) tuples
Return:
value of the 'class' attribute or None
Return Type:
str

PypiSearchResultsParser.__getDate

__getDate(attrs)

Private method to extract the datetime attribute out of the list of attributes and process it.

attrs (list of tuple of (str, str))
list of tag attributes as (name, value) tuples
Return:
value of the 'class' attribute or None
Return Type:
str

PypiSearchResultsParser.getResults

getResults()

Public method to get the extracted search results.

Return:
extracted result data
Return Type:
list of dict

PypiSearchResultsParser.handle_data

handle_data(data)

Public method process arbitrary data.

data (str)
data to be processed

PypiSearchResultsParser.handle_endtag

handle_endtag(tag)

Public method to process the end tag.

tag (str)
tag name (all lowercase)

PypiSearchResultsParser.handle_starttag

handle_starttag(tag, attrs)

Public method to process the start tag.

tag (str)
tag name (all lowercase)
attrs (list of tuple of (str, str))
list of tag attributes as (name, value) tuples
Up