Documentation/Source/eric6.PipInterface.Pip.html

changeset 6807
7e5eba19d86d
child 6828
bb6667ea9ae7
equal deleted inserted replaced
6806:d306647cb82d 6807:7e5eba19d86d
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.PipInterface.Pip</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric6.PipInterface.Pip</h1>
23 <p>
24 Package implementing the pip GUI logic.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>None</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr>
33 <td><a href="#Pip">Pip</a></td>
34 <td>Class implementing the pip GUI logic.</td>
35 </tr>
36 </table>
37 <h3>Functions</h3>
38 <table>
39 <tr><td>None</td></tr>
40 </table>
41 <hr /><hr />
42 <a NAME="Pip" ID="Pip"></a>
43 <h2>Pip</h2>
44 <p>
45 Class implementing the pip GUI logic.
46 </p>
47 <h3>Derived from</h3>
48 QObject
49 <h3>Class Attributes</h3>
50 <table>
51 <tr><td>DefaultIndexUrlPip</td></tr><tr><td>DefaultIndexUrlXml</td></tr><tr><td>DefaultPyPiUrl</td></tr>
52 </table>
53 <h3>Class Methods</h3>
54 <table>
55 <tr><td>None</td></tr>
56 </table>
57 <h3>Methods</h3>
58 <table>
59 <tr>
60 <td><a href="#Pip.__init__">Pip</a></td>
61 <td>Constructor</td>
62 </tr><tr>
63 <td><a href="#Pip.__checkUpgradePyQt">__checkUpgradePyQt</a></td>
64 <td>Private method to check, if an upgrade of PyQt packages is attempted.</td>
65 </tr><tr>
66 <td><a href="#Pip.getIndexUrl">getIndexUrl</a></td>
67 <td>Public method to get the index URL for PyPI.</td>
68 </tr><tr>
69 <td><a href="#Pip.getIndexUrlXml">getIndexUrlXml</a></td>
70 <td>Public method to get the index URL for XML RPC calls.</td>
71 </tr><tr>
72 <td><a href="#Pip.getInstalledPackages">getInstalledPackages</a></td>
73 <td>Public method to get the list of installed packages.</td>
74 </tr><tr>
75 <td><a href="#Pip.getOutdatedPackages">getOutdatedPackages</a></td>
76 <td>Public method to get the list of outdated packages.</td>
77 </tr><tr>
78 <td><a href="#Pip.getPackageDetails">getPackageDetails</a></td>
79 <td>Public method to get package details using the PyPI JSON interface.</td>
80 </tr><tr>
81 <td><a href="#Pip.getProjectEnvironmentString">getProjectEnvironmentString</a></td>
82 <td>Public method to get the string for the project environment.</td>
83 </tr><tr>
84 <td><a href="#Pip.getUserConfig">getUserConfig</a></td>
85 <td>Public method to get the name of the user configuration file.</td>
86 </tr><tr>
87 <td><a href="#Pip.getVirtualenvConfig">getVirtualenvConfig</a></td>
88 <td>Public method to get the name of the virtualenv configuration file.</td>
89 </tr><tr>
90 <td><a href="#Pip.getVirtualenvInterpreter">getVirtualenvInterpreter</a></td>
91 <td>Public method to get the interpreter for a virtual environment.</td>
92 </tr><tr>
93 <td><a href="#Pip.getVirtualenvNames">getVirtualenvNames</a></td>
94 <td>Public method to get a sorted list of virtual environment names.</td>
95 </tr><tr>
96 <td><a href="#Pip.installPackages">installPackages</a></td>
97 <td>Public method to install the given list of packages.</td>
98 </tr><tr>
99 <td><a href="#Pip.installPip">installPip</a></td>
100 <td>Public method to install pip.</td>
101 </tr><tr>
102 <td><a href="#Pip.installRequirements">installRequirements</a></td>
103 <td>Public method to install packages as given in a requirements file.</td>
104 </tr><tr>
105 <td><a href="#Pip.repairPip">repairPip</a></td>
106 <td>Public method to repair the pip installation.</td>
107 </tr><tr>
108 <td><a href="#Pip.runProcess">runProcess</a></td>
109 <td>Public method to execute the current pip with the given arguments.</td>
110 </tr><tr>
111 <td><a href="#Pip.uninstallPackages">uninstallPackages</a></td>
112 <td>Public method to uninstall the given list of packages.</td>
113 </tr><tr>
114 <td><a href="#Pip.uninstallRequirements">uninstallRequirements</a></td>
115 <td>Public method to uninstall packages as given in a requirements file.</td>
116 </tr><tr>
117 <td><a href="#Pip.upgradePackages">upgradePackages</a></td>
118 <td>Public method to upgrade the given list of packages.</td>
119 </tr>
120 </table>
121 <h3>Static Methods</h3>
122 <table>
123 <tr><td>None</td></tr>
124 </table>
125 <a NAME="Pip.__init__" ID="Pip.__init__"></a>
126 <h4>Pip (Constructor)</h4>
127 <b>Pip</b>(<i>parent=None</i>)
128 <p>
129 Constructor
130 </p><dl>
131 <dt><i>parent</i> (QObject)</dt>
132 <dd>
133 parent
134 </dd>
135 </dl><a NAME="Pip.__checkUpgradePyQt" ID="Pip.__checkUpgradePyQt"></a>
136 <h4>Pip.__checkUpgradePyQt</h4>
137 <b>__checkUpgradePyQt</b>(<i>packages</i>)
138 <p>
139 Private method to check, if an upgrade of PyQt packages is attempted.
140 </p><dl>
141 <dt><i>packages</i> (list of str)</dt>
142 <dd>
143 list of packages to upgrade
144 </dd>
145 </dl><dl>
146 <dt>Returns:</dt>
147 <dd>
148 flag indicating to abort the upgrade attempt
149 </dd>
150 </dl><dl>
151 <dt>Return Type:</dt>
152 <dd>
153 bool
154 </dd>
155 </dl><a NAME="Pip.getIndexUrl" ID="Pip.getIndexUrl"></a>
156 <h4>Pip.getIndexUrl</h4>
157 <b>getIndexUrl</b>(<i></i>)
158 <p>
159 Public method to get the index URL for PyPI.
160 </p><dl>
161 <dt>Returns:</dt>
162 <dd>
163 index URL for PyPI
164 </dd>
165 </dl><dl>
166 <dt>Return Type:</dt>
167 <dd>
168 str
169 </dd>
170 </dl><a NAME="Pip.getIndexUrlXml" ID="Pip.getIndexUrlXml"></a>
171 <h4>Pip.getIndexUrlXml</h4>
172 <b>getIndexUrlXml</b>(<i></i>)
173 <p>
174 Public method to get the index URL for XML RPC calls.
175 </p><dl>
176 <dt>Returns:</dt>
177 <dd>
178 index URL for XML RPC calls
179 </dd>
180 </dl><dl>
181 <dt>Return Type:</dt>
182 <dd>
183 str
184 </dd>
185 </dl><a NAME="Pip.getInstalledPackages" ID="Pip.getInstalledPackages"></a>
186 <h4>Pip.getInstalledPackages</h4>
187 <b>getInstalledPackages</b>(<i>envName, localPackages=True, notRequired=False, usersite=False</i>)
188 <p>
189 Public method to get the list of installed packages.
190 </p><dl>
191 <dt><i>envName</i> (str)</dt>
192 <dd>
193 name of the environment to get the packages for
194 </dd><dt><i>localPackages</i> (bool)</dt>
195 <dd>
196 flag indicating to get local packages only
197 </dd><dt><i>notRequired</i> (bool)</dt>
198 <dd>
199 flag indicating to list packages that are not
200 dependencies of installed packages as well
201 </dd><dt><i>usersite</i> (bool)</dt>
202 <dd>
203 flag indicating to only list packages installed
204 in user-site
205 </dd>
206 </dl><dl>
207 <dt>Returns:</dt>
208 <dd>
209 list of tuples containing the package name and version
210 </dd>
211 </dl><dl>
212 <dt>Return Type:</dt>
213 <dd>
214 list of tuple of (str, str)
215 </dd>
216 </dl><a NAME="Pip.getOutdatedPackages" ID="Pip.getOutdatedPackages"></a>
217 <h4>Pip.getOutdatedPackages</h4>
218 <b>getOutdatedPackages</b>(<i>envName, localPackages=True, notRequired=False, usersite=False</i>)
219 <p>
220 Public method to get the list of outdated packages.
221 </p><dl>
222 <dt><i>envName</i> (str)</dt>
223 <dd>
224 name of the environment to get the packages for
225 </dd><dt><i>localPackages</i> (bool)</dt>
226 <dd>
227 flag indicating to get local packages only
228 </dd><dt><i>notRequired</i> (bool)</dt>
229 <dd>
230 flag indicating to list packages that are not
231 dependencies of installed packages as well
232 </dd><dt><i>usersite</i> (bool)</dt>
233 <dd>
234 flag indicating to only list packages installed
235 in user-site
236 </dd>
237 </dl><dl>
238 <dt>Returns:</dt>
239 <dd>
240 list of tuples containing the package name, installed version
241 and available version
242 </dd>
243 </dl><dl>
244 <dt>Return Type:</dt>
245 <dd>
246 list of tuple of (str, str, str)
247 </dd>
248 </dl><a NAME="Pip.getPackageDetails" ID="Pip.getPackageDetails"></a>
249 <h4>Pip.getPackageDetails</h4>
250 <b>getPackageDetails</b>(<i>name, version</i>)
251 <p>
252 Public method to get package details using the PyPI JSON interface.
253 </p><dl>
254 <dt><i>name</i> (str)</dt>
255 <dd>
256 package name
257 </dd><dt><i>version</i> (str)</dt>
258 <dd>
259 package version
260 </dd>
261 </dl><dl>
262 <dt>Returns:</dt>
263 <dd>
264 dictionary containing PyPI package data
265 </dd>
266 </dl><dl>
267 <dt>Return Type:</dt>
268 <dd>
269 dict
270 </dd>
271 </dl><a NAME="Pip.getProjectEnvironmentString" ID="Pip.getProjectEnvironmentString"></a>
272 <h4>Pip.getProjectEnvironmentString</h4>
273 <b>getProjectEnvironmentString</b>(<i></i>)
274 <p>
275 Public method to get the string for the project environment.
276 </p><dl>
277 <dt>Returns:</dt>
278 <dd>
279 string for the project environment
280 </dd>
281 </dl><dl>
282 <dt>Return Type:</dt>
283 <dd>
284 str
285 </dd>
286 </dl><a NAME="Pip.getUserConfig" ID="Pip.getUserConfig"></a>
287 <h4>Pip.getUserConfig</h4>
288 <b>getUserConfig</b>(<i></i>)
289 <p>
290 Public method to get the name of the user configuration file.
291 </p><dl>
292 <dt>Returns:</dt>
293 <dd>
294 path of the user configuration file
295 </dd>
296 </dl><dl>
297 <dt>Return Type:</dt>
298 <dd>
299 str
300 </dd>
301 </dl><a NAME="Pip.getVirtualenvConfig" ID="Pip.getVirtualenvConfig"></a>
302 <h4>Pip.getVirtualenvConfig</h4>
303 <b>getVirtualenvConfig</b>(<i>venvName</i>)
304 <p>
305 Public method to get the name of the virtualenv configuration file.
306 </p><dl>
307 <dt><i>venvName</i> (str)</dt>
308 <dd>
309 name of the environment to get config file path for
310 </dd>
311 </dl><dl>
312 <dt>Returns:</dt>
313 <dd>
314 path of the virtualenv configuration file
315 </dd>
316 </dl><dl>
317 <dt>Return Type:</dt>
318 <dd>
319 str
320 </dd>
321 </dl><a NAME="Pip.getVirtualenvInterpreter" ID="Pip.getVirtualenvInterpreter"></a>
322 <h4>Pip.getVirtualenvInterpreter</h4>
323 <b>getVirtualenvInterpreter</b>(<i>venvName</i>)
324 <p>
325 Public method to get the interpreter for a virtual environment.
326 </p><dl>
327 <dt><i>venvName</i> (str)</dt>
328 <dd>
329 logical name for the virtual environment
330 </dd>
331 </dl><dl>
332 <dt>Returns:</dt>
333 <dd>
334 interpreter path
335 </dd>
336 </dl><dl>
337 <dt>Return Type:</dt>
338 <dd>
339 str
340 </dd>
341 </dl><a NAME="Pip.getVirtualenvNames" ID="Pip.getVirtualenvNames"></a>
342 <h4>Pip.getVirtualenvNames</h4>
343 <b>getVirtualenvNames</b>(<i></i>)
344 <p>
345 Public method to get a sorted list of virtual environment names.
346 </p><dl>
347 <dt>Returns:</dt>
348 <dd>
349 sorted list of virtual environment names
350 </dd>
351 </dl><dl>
352 <dt>Return Type:</dt>
353 <dd>
354 list of str
355 </dd>
356 </dl><a NAME="Pip.installPackages" ID="Pip.installPackages"></a>
357 <h4>Pip.installPackages</h4>
358 <b>installPackages</b>(<i>packages, venvName, userSite=False</i>)
359 <p>
360 Public method to install the given list of packages.
361 </p><dl>
362 <dt><i>packages</i> (list of str)</dt>
363 <dd>
364 list of packages to install
365 </dd><dt><i>venvName</i> (str)</dt>
366 <dd>
367 name of the virtual environment to be used
368 </dd><dt><i>userSite</i> (bool)</dt>
369 <dd>
370 flag indicating an install to the user install
371 directory
372 </dd>
373 </dl><a NAME="Pip.installPip" ID="Pip.installPip"></a>
374 <h4>Pip.installPip</h4>
375 <b>installPip</b>(<i>venvName, userSite=False</i>)
376 <p>
377 Public method to install pip.
378 </p><dl>
379 <dt><i>venvName</i> (str)</dt>
380 <dd>
381 name of the environment to install pip into
382 </dd><dt><i>userSite</i> (bool)</dt>
383 <dd>
384 flag indicating an install to the user install
385 directory
386 </dd>
387 </dl><a NAME="Pip.installRequirements" ID="Pip.installRequirements"></a>
388 <h4>Pip.installRequirements</h4>
389 <b>installRequirements</b>(<i>venvName</i>)
390 <p>
391 Public method to install packages as given in a requirements file.
392 </p><dl>
393 <dt><i>venvName</i> (str)</dt>
394 <dd>
395 name of the virtual environment to be used
396 </dd>
397 </dl><a NAME="Pip.repairPip" ID="Pip.repairPip"></a>
398 <h4>Pip.repairPip</h4>
399 <b>repairPip</b>(<i>venvName</i>)
400 <p>
401 Public method to repair the pip installation.
402 </p><dl>
403 <dt><i>venvName</i> (str)</dt>
404 <dd>
405 name of the environment to install pip into
406 </dd>
407 </dl><a NAME="Pip.runProcess" ID="Pip.runProcess"></a>
408 <h4>Pip.runProcess</h4>
409 <b>runProcess</b>(<i>args, interpreter</i>)
410 <p>
411 Public method to execute the current pip with the given arguments.
412 </p><p>
413 The selected pip executable is called with the given arguments and
414 waited for its end.
415 </p><dl>
416 <dt><i>args</i> (list of str)</dt>
417 <dd>
418 list of command line arguments
419 </dd><dt><i>interpreter</i> (str)</dt>
420 <dd>
421 path of the Python interpreter to be used
422 </dd>
423 </dl><dl>
424 <dt>Returns:</dt>
425 <dd>
426 tuple containing a flag indicating success and the output
427 of the process
428 </dd>
429 </dl><dl>
430 <dt>Return Type:</dt>
431 <dd>
432 tuple of (bool, str)
433 </dd>
434 </dl><a NAME="Pip.uninstallPackages" ID="Pip.uninstallPackages"></a>
435 <h4>Pip.uninstallPackages</h4>
436 <b>uninstallPackages</b>(<i>packages, venvName</i>)
437 <p>
438 Public method to uninstall the given list of packages.
439 </p><dl>
440 <dt><i>packages</i> (list of str)</dt>
441 <dd>
442 list of packages to uninstall
443 </dd><dt><i>venvName</i> (str)</dt>
444 <dd>
445 name of the virtual environment to be used
446 </dd>
447 </dl><dl>
448 <dt>Returns:</dt>
449 <dd>
450 flag indicating a successful execution
451 </dd>
452 </dl><dl>
453 <dt>Return Type:</dt>
454 <dd>
455 bool
456 </dd>
457 </dl><a NAME="Pip.uninstallRequirements" ID="Pip.uninstallRequirements"></a>
458 <h4>Pip.uninstallRequirements</h4>
459 <b>uninstallRequirements</b>(<i>venvName</i>)
460 <p>
461 Public method to uninstall packages as given in a requirements file.
462 </p><dl>
463 <dt><i>venvName</i> (str)</dt>
464 <dd>
465 name of the virtual environment to be used
466 </dd>
467 </dl><a NAME="Pip.upgradePackages" ID="Pip.upgradePackages"></a>
468 <h4>Pip.upgradePackages</h4>
469 <b>upgradePackages</b>(<i>packages, venvName, userSite=False</i>)
470 <p>
471 Public method to upgrade the given list of packages.
472 </p><dl>
473 <dt><i>packages</i> (list of str)</dt>
474 <dd>
475 list of packages to upgrade
476 </dd><dt><i>venvName</i> (str)</dt>
477 <dd>
478 name of the virtual environment to be used
479 </dd><dt><i>userSite</i> (bool)</dt>
480 <dd>
481 flag indicating an install to the user install
482 directory
483 </dd>
484 </dl><dl>
485 <dt>Returns:</dt>
486 <dd>
487 flag indicating a successful execution
488 </dd>
489 </dl><dl>
490 <dt>Return Type:</dt>
491 <dd>
492 bool
493 </dd>
494 </dl>
495 <div align="right"><a href="#top">Up</a></div>
496 <hr />
497 </body></html>

eric ide

mercurial