eric6/Documentation/Source/eric6.PipInterface.Pip.html

Mon, 08 Feb 2021 18:01:02 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 08 Feb 2021 18:01:02 +0100
changeset 8085
f6db8b3ecea9
parent 7989
a21d673a8f99
child 8090
c53117374255
permissions
-rw-r--r--

pip Interface
- changed code for the search function to work with the PyPI search page because the XML-RPC search interface of PyPI is still disabled

<!DOCTYPE html>
<html><head>
<title>eric6.PipInterface.Pip</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>eric6.PipInterface.Pip</h1>

<p>
Package implementing the pip GUI logic.
</p>
<h3>Global Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>

<table>

<tr>
<td><a href="#Pip">Pip</a></td>
<td>Class implementing the pip GUI logic.</td>
</tr>
</table>
<h3>Functions</h3>

<table>
<tr><td>None</td></tr>
</table>
<hr />
<hr />
<a NAME="Pip" ID="Pip"></a>
<h2>Pip</h2>

<p>
    Class implementing the pip GUI logic.
</p>
<h3>Derived from</h3>
QObject
<h3>Class Attributes</h3>

<table>
<tr><td>DefaultIndexUrlPip</td></tr><tr><td>DefaultIndexUrlXml</td></tr><tr><td>DefaultPyPiUrl</td></tr>
</table>
<h3>Class Methods</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>

<table>

<tr>
<td><a href="#Pip.__init__">Pip</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#Pip.__checkUpgradePyQt">__checkUpgradePyQt</a></td>
<td>Private method to check, if an upgrade of PyQt packages is attempted.</td>
</tr>
<tr>
<td><a href="#Pip.cacheList">cacheList</a></td>
<td>Public method to list files contained in the pip cache.</td>
</tr>
<tr>
<td><a href="#Pip.cachePurge">cachePurge</a></td>
<td>Public method to remove all files from the pip cache.</td>
</tr>
<tr>
<td><a href="#Pip.cacheRemove">cacheRemove</a></td>
<td>Public method to remove files from the pip cache.</td>
</tr>
<tr>
<td><a href="#Pip.getIndexUrl">getIndexUrl</a></td>
<td>Public method to get the index URL for PyPI.</td>
</tr>
<tr>
<td><a href="#Pip.getIndexUrlXml">getIndexUrlXml</a></td>
<td>Public method to get the index URL for XML RPC calls.</td>
</tr>
<tr>
<td><a href="#Pip.getInstalledPackages">getInstalledPackages</a></td>
<td>Public method to get the list of installed packages.</td>
</tr>
<tr>
<td><a href="#Pip.getNetworkAccessManager">getNetworkAccessManager</a></td>
<td>Public method to get a reference to the network access manager object.</td>
</tr>
<tr>
<td><a href="#Pip.getOutdatedPackages">getOutdatedPackages</a></td>
<td>Public method to get the list of outdated packages.</td>
</tr>
<tr>
<td><a href="#Pip.getPackageDetails">getPackageDetails</a></td>
<td>Public method to get package details using the PyPI JSON interface.</td>
</tr>
<tr>
<td><a href="#Pip.getProjectEnvironmentString">getProjectEnvironmentString</a></td>
<td>Public method to get the string for the project environment.</td>
</tr>
<tr>
<td><a href="#Pip.getUserConfig">getUserConfig</a></td>
<td>Public method to get the name of the user configuration file.</td>
</tr>
<tr>
<td><a href="#Pip.getVirtualenvConfig">getVirtualenvConfig</a></td>
<td>Public method to get the name of the virtualenv configuration file.</td>
</tr>
<tr>
<td><a href="#Pip.getVirtualenvInterpreter">getVirtualenvInterpreter</a></td>
<td>Public method to get the interpreter for a virtual environment.</td>
</tr>
<tr>
<td><a href="#Pip.getVirtualenvNames">getVirtualenvNames</a></td>
<td>Public method to get a sorted list of virtual environment names.</td>
</tr>
<tr>
<td><a href="#Pip.installPackages">installPackages</a></td>
<td>Public method to install the given list of packages.</td>
</tr>
<tr>
<td><a href="#Pip.installPip">installPip</a></td>
<td>Public method to install pip.</td>
</tr>
<tr>
<td><a href="#Pip.installRequirements">installRequirements</a></td>
<td>Public method to install packages as given in a requirements file.</td>
</tr>
<tr>
<td><a href="#Pip.repairPip">repairPip</a></td>
<td>Public method to repair the pip installation.</td>
</tr>
<tr>
<td><a href="#Pip.runProcess">runProcess</a></td>
<td>Public method to execute the current pip with the given arguments.</td>
</tr>
<tr>
<td><a href="#Pip.showCacheInfo">showCacheInfo</a></td>
<td>Public method to show some information about the pip cache.</td>
</tr>
<tr>
<td><a href="#Pip.uninstallPackages">uninstallPackages</a></td>
<td>Public method to uninstall the given list of packages.</td>
</tr>
<tr>
<td><a href="#Pip.uninstallRequirements">uninstallRequirements</a></td>
<td>Public method to uninstall packages as given in a requirements file.</td>
</tr>
<tr>
<td><a href="#Pip.upgradePackages">upgradePackages</a></td>
<td>Public method to upgrade the given list of packages.</td>
</tr>
</table>
<h3>Static Methods</h3>

<table>
<tr><td>None</td></tr>
</table>

<a NAME="Pip.__init__" ID="Pip.__init__"></a>
<h4>Pip (Constructor)</h4>
<b>Pip</b>(<i>parent=None</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>parent</i> (QObject)</dt>
<dd>
parent
</dd>
</dl>
<a NAME="Pip.__checkUpgradePyQt" ID="Pip.__checkUpgradePyQt"></a>
<h4>Pip.__checkUpgradePyQt</h4>
<b>__checkUpgradePyQt</b>(<i>packages</i>)

<p>
        Private method to check, if an upgrade of PyQt packages is attempted.
</p>
<dl>

<dt><i>packages</i> (list of str)</dt>
<dd>
list of packages to upgrade
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating to abort the upgrade attempt
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="Pip.cacheList" ID="Pip.cacheList"></a>
<h4>Pip.cacheList</h4>
<b>cacheList</b>(<i>venvName</i>)

<p>
        Public method to list files contained in the pip cache.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<a NAME="Pip.cachePurge" ID="Pip.cachePurge"></a>
<h4>Pip.cachePurge</h4>
<b>cachePurge</b>(<i>venvName</i>)

<p>
        Public method to remove all files from the pip cache.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<a NAME="Pip.cacheRemove" ID="Pip.cacheRemove"></a>
<h4>Pip.cacheRemove</h4>
<b>cacheRemove</b>(<i>venvName</i>)

<p>
        Public method to remove files from the pip cache.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<a NAME="Pip.getIndexUrl" ID="Pip.getIndexUrl"></a>
<h4>Pip.getIndexUrl</h4>
<b>getIndexUrl</b>(<i></i>)

<p>
        Public method to get the index URL for PyPI.
</p>
<dl>
<dt>Return:</dt>
<dd>
index URL for PyPI
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Pip.getIndexUrlXml" ID="Pip.getIndexUrlXml"></a>
<h4>Pip.getIndexUrlXml</h4>
<b>getIndexUrlXml</b>(<i></i>)

<p>
        Public method to get the index URL for XML RPC calls.
</p>
<dl>
<dt>Return:</dt>
<dd>
index URL for XML RPC calls
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Pip.getInstalledPackages" ID="Pip.getInstalledPackages"></a>
<h4>Pip.getInstalledPackages</h4>
<b>getInstalledPackages</b>(<i>envName, localPackages=True, notRequired=False, usersite=False</i>)

<p>
        Public method to get the list of installed packages.
</p>
<dl>

<dt><i>envName</i> (str)</dt>
<dd>
name of the environment to get the packages for
</dd>
<dt><i>localPackages</i> (bool)</dt>
<dd>
flag indicating to get local packages only
</dd>
<dt><i>notRequired</i> (bool)</dt>
<dd>
flag indicating to list packages that are not
            dependencies of installed packages as well
</dd>
<dt><i>usersite</i> (bool)</dt>
<dd>
flag indicating to only list packages installed
            in user-site
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of tuples containing the package name and version
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of tuple of (str, str)
</dd>
</dl>
<a NAME="Pip.getNetworkAccessManager" ID="Pip.getNetworkAccessManager"></a>
<h4>Pip.getNetworkAccessManager</h4>
<b>getNetworkAccessManager</b>(<i></i>)

<p>
        Public method to get a reference to the network access manager object.
</p>
<dl>
<dt>Return:</dt>
<dd>
reference to the network access manager object
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
QNetworkAccessManager
</dd>
</dl>
<a NAME="Pip.getOutdatedPackages" ID="Pip.getOutdatedPackages"></a>
<h4>Pip.getOutdatedPackages</h4>
<b>getOutdatedPackages</b>(<i>envName, localPackages=True, notRequired=False, usersite=False</i>)

<p>
        Public method to get the list of outdated packages.
</p>
<dl>

<dt><i>envName</i> (str)</dt>
<dd>
name of the environment to get the packages for
</dd>
<dt><i>localPackages</i> (bool)</dt>
<dd>
flag indicating to get local packages only
</dd>
<dt><i>notRequired</i> (bool)</dt>
<dd>
flag indicating to list packages that are not
            dependencies of installed packages as well
</dd>
<dt><i>usersite</i> (bool)</dt>
<dd>
flag indicating to only list packages installed
            in user-site
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of tuples containing the package name, installed version
            and available version
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of tuple of (str, str, str)
</dd>
</dl>
<a NAME="Pip.getPackageDetails" ID="Pip.getPackageDetails"></a>
<h4>Pip.getPackageDetails</h4>
<b>getPackageDetails</b>(<i>name, version</i>)

<p>
        Public method to get package details using the PyPI JSON interface.
</p>
<dl>

<dt><i>name</i> (str)</dt>
<dd>
package name
</dd>
<dt><i>version</i> (str)</dt>
<dd>
package version
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
dictionary containing PyPI package data
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
dict
</dd>
</dl>
<a NAME="Pip.getProjectEnvironmentString" ID="Pip.getProjectEnvironmentString"></a>
<h4>Pip.getProjectEnvironmentString</h4>
<b>getProjectEnvironmentString</b>(<i></i>)

<p>
        Public method to get the string for the project environment.
</p>
<dl>
<dt>Return:</dt>
<dd>
string for the project environment
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Pip.getUserConfig" ID="Pip.getUserConfig"></a>
<h4>Pip.getUserConfig</h4>
<b>getUserConfig</b>(<i></i>)

<p>
        Public method to get the name of the user configuration file.
</p>
<dl>
<dt>Return:</dt>
<dd>
path of the user configuration file
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Pip.getVirtualenvConfig" ID="Pip.getVirtualenvConfig"></a>
<h4>Pip.getVirtualenvConfig</h4>
<b>getVirtualenvConfig</b>(<i>venvName</i>)

<p>
        Public method to get the name of the virtualenv configuration file.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the environment to get config file path for
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
path of the virtualenv configuration file
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Pip.getVirtualenvInterpreter" ID="Pip.getVirtualenvInterpreter"></a>
<h4>Pip.getVirtualenvInterpreter</h4>
<b>getVirtualenvInterpreter</b>(<i>venvName</i>)

<p>
        Public method to get the interpreter for a virtual environment.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
logical name for the virtual environment
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
interpreter path
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Pip.getVirtualenvNames" ID="Pip.getVirtualenvNames"></a>
<h4>Pip.getVirtualenvNames</h4>
<b>getVirtualenvNames</b>(<i>noRemote=False, noConda=False</i>)

<p>
        Public method to get a sorted list of virtual environment names.
</p>
<dl>

<dt><i>noRemote</i> (bool)</dt>
<dd>
flag indicating to exclude environments for remote
            debugging
</dd>
<dt><i>noConda</i> (bool)</dt>
<dd>
flag indicating to exclude Conda environments
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
sorted list of virtual environment names
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Pip.installPackages" ID="Pip.installPackages"></a>
<h4>Pip.installPackages</h4>
<b>installPackages</b>(<i>packages, venvName="", userSite=False, interpreter=""</i>)

<p>
        Public method to install the given list of packages.
</p>
<dl>

<dt><i>packages</i> (list of str)</dt>
<dd>
list of packages to install
</dd>
<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
<dt><i>userSite</i> (bool)</dt>
<dd>
flag indicating an install to the user install
            directory
</dd>
<dt><i>interpreter</i> (str)</dt>
<dd>
interpreter to be used for execution
</dd>
</dl>
<a NAME="Pip.installPip" ID="Pip.installPip"></a>
<h4>Pip.installPip</h4>
<b>installPip</b>(<i>venvName, userSite=False</i>)

<p>
        Public method to install pip.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the environment to install pip into
</dd>
<dt><i>userSite</i> (bool)</dt>
<dd>
flag indicating an install to the user install
            directory
</dd>
</dl>
<a NAME="Pip.installRequirements" ID="Pip.installRequirements"></a>
<h4>Pip.installRequirements</h4>
<b>installRequirements</b>(<i>venvName</i>)

<p>
        Public method to install packages as given in a requirements file.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<a NAME="Pip.repairPip" ID="Pip.repairPip"></a>
<h4>Pip.repairPip</h4>
<b>repairPip</b>(<i>venvName</i>)

<p>
        Public method to repair the pip installation.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the environment to install pip into
</dd>
</dl>
<a NAME="Pip.runProcess" ID="Pip.runProcess"></a>
<h4>Pip.runProcess</h4>
<b>runProcess</b>(<i>args, interpreter</i>)

<p>
        Public method to execute the current pip with the given arguments.
</p>
<p>
        The selected pip executable is called with the given arguments and
        waited for its end.
</p>
<dl>

<dt><i>args</i> (list of str)</dt>
<dd>
list of command line arguments
</dd>
<dt><i>interpreter</i> (str)</dt>
<dd>
path of the Python interpreter to be used
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
tuple containing a flag indicating success and the output
            of the process
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
tuple of (bool, str)
</dd>
</dl>
<a NAME="Pip.showCacheInfo" ID="Pip.showCacheInfo"></a>
<h4>Pip.showCacheInfo</h4>
<b>showCacheInfo</b>(<i>venvName</i>)

<p>
        Public method to show some information about the pip cache.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<a NAME="Pip.uninstallPackages" ID="Pip.uninstallPackages"></a>
<h4>Pip.uninstallPackages</h4>
<b>uninstallPackages</b>(<i>packages, venvName</i>)

<p>
        Public method to uninstall the given list of packages.
</p>
<dl>

<dt><i>packages</i> (list of str)</dt>
<dd>
list of packages to uninstall
</dd>
<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating a successful execution
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="Pip.uninstallRequirements" ID="Pip.uninstallRequirements"></a>
<h4>Pip.uninstallRequirements</h4>
<b>uninstallRequirements</b>(<i>venvName</i>)

<p>
        Public method to uninstall packages as given in a requirements file.
</p>
<dl>

<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
</dl>
<a NAME="Pip.upgradePackages" ID="Pip.upgradePackages"></a>
<h4>Pip.upgradePackages</h4>
<b>upgradePackages</b>(<i>packages, venvName, userSite=False</i>)

<p>
        Public method to upgrade the given list of packages.
</p>
<dl>

<dt><i>packages</i> (list of str)</dt>
<dd>
list of packages to upgrade
</dd>
<dt><i>venvName</i> (str)</dt>
<dd>
name of the virtual environment to be used
</dd>
<dt><i>userSite</i> (bool)</dt>
<dd>
flag indicating an install to the user install
            directory
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating a successful execution
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial