eric7/Documentation/Source/eric7.PipInterface.Pip.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.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>
22 <a NAME="top" ID="top"></a>
23 <h1>eric7.PipInterface.Pip</h1>
24
25 <p>
26 Package implementing the pip GUI logic.
27 </p>
28 <h3>Global Attributes</h3>
29
30 <table>
31 <tr><td>None</td></tr>
32 </table>
33 <h3>Classes</h3>
34
35 <table>
36
37 <tr>
38 <td><a href="#Pip">Pip</a></td>
39 <td>Class implementing the pip GUI logic.</td>
40 </tr>
41 </table>
42 <h3>Functions</h3>
43
44 <table>
45 <tr><td>None</td></tr>
46 </table>
47 <hr />
48 <hr />
49 <a NAME="Pip" ID="Pip"></a>
50 <h2>Pip</h2>
51
52 <p>
53 Class implementing the pip GUI logic.
54 </p>
55 <h3>Derived from</h3>
56 QObject
57 <h3>Class Attributes</h3>
58
59 <table>
60 <tr><td>DefaultIndexUrlPypi</td></tr><tr><td>DefaultIndexUrlSearch</td></tr><tr><td>DefaultIndexUrlSimple</td></tr><tr><td>DefaultPyPiUrl</td></tr>
61 </table>
62 <h3>Class Methods</h3>
63
64 <table>
65 <tr><td>None</td></tr>
66 </table>
67 <h3>Methods</h3>
68
69 <table>
70
71 <tr>
72 <td><a href="#Pip.__init__">Pip</a></td>
73 <td>Constructor</td>
74 </tr>
75 <tr>
76 <td><a href="#Pip.__checkUpgradePyQt">__checkUpgradePyQt</a></td>
77 <td>Private method to check, if an upgrade of PyQt packages is attempted.</td>
78 </tr>
79 <tr>
80 <td><a href="#Pip.cacheList">cacheList</a></td>
81 <td>Public method to list files contained in the pip cache.</td>
82 </tr>
83 <tr>
84 <td><a href="#Pip.cachePurge">cachePurge</a></td>
85 <td>Public method to remove all files from the pip cache.</td>
86 </tr>
87 <tr>
88 <td><a href="#Pip.cacheRemove">cacheRemove</a></td>
89 <td>Public method to remove files from the pip cache.</td>
90 </tr>
91 <tr>
92 <td><a href="#Pip.getIndexUrl">getIndexUrl</a></td>
93 <td>Public method to get the index URL for PyPI.</td>
94 </tr>
95 <tr>
96 <td><a href="#Pip.getIndexUrlPypi">getIndexUrlPypi</a></td>
97 <td>Public method to get the index URL for PyPI API calls.</td>
98 </tr>
99 <tr>
100 <td><a href="#Pip.getIndexUrlSearch">getIndexUrlSearch</a></td>
101 <td>Public method to get the index URL for PyPI API calls.</td>
102 </tr>
103 <tr>
104 <td><a href="#Pip.getInstalledPackages">getInstalledPackages</a></td>
105 <td>Public method to get the list of installed packages.</td>
106 </tr>
107 <tr>
108 <td><a href="#Pip.getNetworkAccessManager">getNetworkAccessManager</a></td>
109 <td>Public method to get a reference to the network access manager object.</td>
110 </tr>
111 <tr>
112 <td><a href="#Pip.getOutdatedPackages">getOutdatedPackages</a></td>
113 <td>Public method to get the list of outdated packages.</td>
114 </tr>
115 <tr>
116 <td><a href="#Pip.getPackageDetails">getPackageDetails</a></td>
117 <td>Public method to get package details using the PyPI JSON interface.</td>
118 </tr>
119 <tr>
120 <td><a href="#Pip.getProjectEnvironmentString">getProjectEnvironmentString</a></td>
121 <td>Public method to get the string for the project environment.</td>
122 </tr>
123 <tr>
124 <td><a href="#Pip.getUserConfig">getUserConfig</a></td>
125 <td>Public method to get the name of the user configuration file.</td>
126 </tr>
127 <tr>
128 <td><a href="#Pip.getVirtualenvConfig">getVirtualenvConfig</a></td>
129 <td>Public method to get the name of the virtualenv configuration file.</td>
130 </tr>
131 <tr>
132 <td><a href="#Pip.getVirtualenvInterpreter">getVirtualenvInterpreter</a></td>
133 <td>Public method to get the interpreter for a virtual environment.</td>
134 </tr>
135 <tr>
136 <td><a href="#Pip.getVirtualenvNames">getVirtualenvNames</a></td>
137 <td>Public method to get a sorted list of virtual environment names.</td>
138 </tr>
139 <tr>
140 <td><a href="#Pip.installPackages">installPackages</a></td>
141 <td>Public method to install the given list of packages.</td>
142 </tr>
143 <tr>
144 <td><a href="#Pip.installPip">installPip</a></td>
145 <td>Public method to install pip.</td>
146 </tr>
147 <tr>
148 <td><a href="#Pip.installRequirements">installRequirements</a></td>
149 <td>Public method to install packages as given in a requirements file.</td>
150 </tr>
151 <tr>
152 <td><a href="#Pip.repairPip">repairPip</a></td>
153 <td>Public method to repair the pip installation.</td>
154 </tr>
155 <tr>
156 <td><a href="#Pip.runProcess">runProcess</a></td>
157 <td>Public method to execute the current pip with the given arguments.</td>
158 </tr>
159 <tr>
160 <td><a href="#Pip.showCacheInfo">showCacheInfo</a></td>
161 <td>Public method to show some information about the pip cache.</td>
162 </tr>
163 <tr>
164 <td><a href="#Pip.uninstallPackages">uninstallPackages</a></td>
165 <td>Public method to uninstall the given list of packages.</td>
166 </tr>
167 <tr>
168 <td><a href="#Pip.uninstallRequirements">uninstallRequirements</a></td>
169 <td>Public method to uninstall packages as given in a requirements file.</td>
170 </tr>
171 <tr>
172 <td><a href="#Pip.upgradePackages">upgradePackages</a></td>
173 <td>Public method to upgrade the given list of packages.</td>
174 </tr>
175 </table>
176 <h3>Static Methods</h3>
177
178 <table>
179 <tr><td>None</td></tr>
180 </table>
181
182 <a NAME="Pip.__init__" ID="Pip.__init__"></a>
183 <h4>Pip (Constructor)</h4>
184 <b>Pip</b>(<i>parent=None</i>)
185
186 <p>
187 Constructor
188 </p>
189 <dl>
190
191 <dt><i>parent</i> (QObject)</dt>
192 <dd>
193 parent
194 </dd>
195 </dl>
196 <a NAME="Pip.__checkUpgradePyQt" ID="Pip.__checkUpgradePyQt"></a>
197 <h4>Pip.__checkUpgradePyQt</h4>
198 <b>__checkUpgradePyQt</b>(<i>packages</i>)
199
200 <p>
201 Private method to check, if an upgrade of PyQt packages is attempted.
202 </p>
203 <dl>
204
205 <dt><i>packages</i> (list of str)</dt>
206 <dd>
207 list of packages to upgrade
208 </dd>
209 </dl>
210 <dl>
211 <dt>Return:</dt>
212 <dd>
213 flag indicating to abort the upgrade attempt
214 </dd>
215 </dl>
216 <dl>
217 <dt>Return Type:</dt>
218 <dd>
219 bool
220 </dd>
221 </dl>
222 <a NAME="Pip.cacheList" ID="Pip.cacheList"></a>
223 <h4>Pip.cacheList</h4>
224 <b>cacheList</b>(<i>venvName</i>)
225
226 <p>
227 Public method to list files contained in the pip cache.
228 </p>
229 <dl>
230
231 <dt><i>venvName</i> (str)</dt>
232 <dd>
233 name of the virtual environment to be used
234 </dd>
235 </dl>
236 <a NAME="Pip.cachePurge" ID="Pip.cachePurge"></a>
237 <h4>Pip.cachePurge</h4>
238 <b>cachePurge</b>(<i>venvName</i>)
239
240 <p>
241 Public method to remove all files from the pip cache.
242 </p>
243 <dl>
244
245 <dt><i>venvName</i> (str)</dt>
246 <dd>
247 name of the virtual environment to be used
248 </dd>
249 </dl>
250 <a NAME="Pip.cacheRemove" ID="Pip.cacheRemove"></a>
251 <h4>Pip.cacheRemove</h4>
252 <b>cacheRemove</b>(<i>venvName</i>)
253
254 <p>
255 Public method to remove files from the pip cache.
256 </p>
257 <dl>
258
259 <dt><i>venvName</i> (str)</dt>
260 <dd>
261 name of the virtual environment to be used
262 </dd>
263 </dl>
264 <a NAME="Pip.getIndexUrl" ID="Pip.getIndexUrl"></a>
265 <h4>Pip.getIndexUrl</h4>
266 <b>getIndexUrl</b>(<i></i>)
267
268 <p>
269 Public method to get the index URL for PyPI.
270 </p>
271 <dl>
272 <dt>Return:</dt>
273 <dd>
274 index URL for PyPI
275 </dd>
276 </dl>
277 <dl>
278 <dt>Return Type:</dt>
279 <dd>
280 str
281 </dd>
282 </dl>
283 <a NAME="Pip.getIndexUrlPypi" ID="Pip.getIndexUrlPypi"></a>
284 <h4>Pip.getIndexUrlPypi</h4>
285 <b>getIndexUrlPypi</b>(<i></i>)
286
287 <p>
288 Public method to get the index URL for PyPI API calls.
289 </p>
290 <dl>
291 <dt>Return:</dt>
292 <dd>
293 index URL for XML RPC calls
294 </dd>
295 </dl>
296 <dl>
297 <dt>Return Type:</dt>
298 <dd>
299 str
300 </dd>
301 </dl>
302 <a NAME="Pip.getIndexUrlSearch" ID="Pip.getIndexUrlSearch"></a>
303 <h4>Pip.getIndexUrlSearch</h4>
304 <b>getIndexUrlSearch</b>(<i></i>)
305
306 <p>
307 Public method to get the index URL for PyPI API calls.
308 </p>
309 <dl>
310 <dt>Return:</dt>
311 <dd>
312 index URL for XML RPC calls
313 </dd>
314 </dl>
315 <dl>
316 <dt>Return Type:</dt>
317 <dd>
318 str
319 </dd>
320 </dl>
321 <a NAME="Pip.getInstalledPackages" ID="Pip.getInstalledPackages"></a>
322 <h4>Pip.getInstalledPackages</h4>
323 <b>getInstalledPackages</b>(<i>envName, localPackages=True, notRequired=False, usersite=False</i>)
324
325 <p>
326 Public method to get the list of installed packages.
327 </p>
328 <dl>
329
330 <dt><i>envName</i> (str)</dt>
331 <dd>
332 name of the environment to get the packages for
333 </dd>
334 <dt><i>localPackages</i> (bool)</dt>
335 <dd>
336 flag indicating to get local packages only
337 </dd>
338 <dt><i>notRequired</i> (bool)</dt>
339 <dd>
340 flag indicating to list packages that are not
341 dependencies of installed packages as well
342 </dd>
343 <dt><i>usersite</i> (bool)</dt>
344 <dd>
345 flag indicating to only list packages installed
346 in user-site
347 </dd>
348 </dl>
349 <dl>
350 <dt>Return:</dt>
351 <dd>
352 list of tuples containing the package name and version
353 </dd>
354 </dl>
355 <dl>
356 <dt>Return Type:</dt>
357 <dd>
358 list of tuple of (str, str)
359 </dd>
360 </dl>
361 <a NAME="Pip.getNetworkAccessManager" ID="Pip.getNetworkAccessManager"></a>
362 <h4>Pip.getNetworkAccessManager</h4>
363 <b>getNetworkAccessManager</b>(<i></i>)
364
365 <p>
366 Public method to get a reference to the network access manager object.
367 </p>
368 <dl>
369 <dt>Return:</dt>
370 <dd>
371 reference to the network access manager object
372 </dd>
373 </dl>
374 <dl>
375 <dt>Return Type:</dt>
376 <dd>
377 QNetworkAccessManager
378 </dd>
379 </dl>
380 <a NAME="Pip.getOutdatedPackages" ID="Pip.getOutdatedPackages"></a>
381 <h4>Pip.getOutdatedPackages</h4>
382 <b>getOutdatedPackages</b>(<i>envName, localPackages=True, notRequired=False, usersite=False</i>)
383
384 <p>
385 Public method to get the list of outdated packages.
386 </p>
387 <dl>
388
389 <dt><i>envName</i> (str)</dt>
390 <dd>
391 name of the environment to get the packages for
392 </dd>
393 <dt><i>localPackages</i> (bool)</dt>
394 <dd>
395 flag indicating to get local packages only
396 </dd>
397 <dt><i>notRequired</i> (bool)</dt>
398 <dd>
399 flag indicating to list packages that are not
400 dependencies of installed packages as well
401 </dd>
402 <dt><i>usersite</i> (bool)</dt>
403 <dd>
404 flag indicating to only list packages installed
405 in user-site
406 </dd>
407 </dl>
408 <dl>
409 <dt>Return:</dt>
410 <dd>
411 list of tuples containing the package name, installed version
412 and available version
413 </dd>
414 </dl>
415 <dl>
416 <dt>Return Type:</dt>
417 <dd>
418 list of tuple of (str, str, str)
419 </dd>
420 </dl>
421 <a NAME="Pip.getPackageDetails" ID="Pip.getPackageDetails"></a>
422 <h4>Pip.getPackageDetails</h4>
423 <b>getPackageDetails</b>(<i>name, version</i>)
424
425 <p>
426 Public method to get package details using the PyPI JSON interface.
427 </p>
428 <dl>
429
430 <dt><i>name</i> (str)</dt>
431 <dd>
432 package name
433 </dd>
434 <dt><i>version</i> (str)</dt>
435 <dd>
436 package version
437 </dd>
438 </dl>
439 <dl>
440 <dt>Return:</dt>
441 <dd>
442 dictionary containing PyPI package data
443 </dd>
444 </dl>
445 <dl>
446 <dt>Return Type:</dt>
447 <dd>
448 dict
449 </dd>
450 </dl>
451 <a NAME="Pip.getProjectEnvironmentString" ID="Pip.getProjectEnvironmentString"></a>
452 <h4>Pip.getProjectEnvironmentString</h4>
453 <b>getProjectEnvironmentString</b>(<i></i>)
454
455 <p>
456 Public method to get the string for the project environment.
457 </p>
458 <dl>
459 <dt>Return:</dt>
460 <dd>
461 string for the project environment
462 </dd>
463 </dl>
464 <dl>
465 <dt>Return Type:</dt>
466 <dd>
467 str
468 </dd>
469 </dl>
470 <a NAME="Pip.getUserConfig" ID="Pip.getUserConfig"></a>
471 <h4>Pip.getUserConfig</h4>
472 <b>getUserConfig</b>(<i></i>)
473
474 <p>
475 Public method to get the name of the user configuration file.
476 </p>
477 <dl>
478 <dt>Return:</dt>
479 <dd>
480 path of the user configuration file
481 </dd>
482 </dl>
483 <dl>
484 <dt>Return Type:</dt>
485 <dd>
486 str
487 </dd>
488 </dl>
489 <a NAME="Pip.getVirtualenvConfig" ID="Pip.getVirtualenvConfig"></a>
490 <h4>Pip.getVirtualenvConfig</h4>
491 <b>getVirtualenvConfig</b>(<i>venvName</i>)
492
493 <p>
494 Public method to get the name of the virtualenv configuration file.
495 </p>
496 <dl>
497
498 <dt><i>venvName</i> (str)</dt>
499 <dd>
500 name of the environment to get config file path for
501 </dd>
502 </dl>
503 <dl>
504 <dt>Return:</dt>
505 <dd>
506 path of the virtualenv configuration file
507 </dd>
508 </dl>
509 <dl>
510 <dt>Return Type:</dt>
511 <dd>
512 str
513 </dd>
514 </dl>
515 <a NAME="Pip.getVirtualenvInterpreter" ID="Pip.getVirtualenvInterpreter"></a>
516 <h4>Pip.getVirtualenvInterpreter</h4>
517 <b>getVirtualenvInterpreter</b>(<i>venvName</i>)
518
519 <p>
520 Public method to get the interpreter for a virtual environment.
521 </p>
522 <dl>
523
524 <dt><i>venvName</i> (str)</dt>
525 <dd>
526 logical name for the virtual environment
527 </dd>
528 </dl>
529 <dl>
530 <dt>Return:</dt>
531 <dd>
532 interpreter path
533 </dd>
534 </dl>
535 <dl>
536 <dt>Return Type:</dt>
537 <dd>
538 str
539 </dd>
540 </dl>
541 <a NAME="Pip.getVirtualenvNames" ID="Pip.getVirtualenvNames"></a>
542 <h4>Pip.getVirtualenvNames</h4>
543 <b>getVirtualenvNames</b>(<i>noRemote=False, noConda=False</i>)
544
545 <p>
546 Public method to get a sorted list of virtual environment names.
547 </p>
548 <dl>
549
550 <dt><i>noRemote</i> (bool)</dt>
551 <dd>
552 flag indicating to exclude environments for remote
553 debugging
554 </dd>
555 <dt><i>noConda</i> (bool)</dt>
556 <dd>
557 flag indicating to exclude Conda environments
558 </dd>
559 </dl>
560 <dl>
561 <dt>Return:</dt>
562 <dd>
563 sorted list of virtual environment names
564 </dd>
565 </dl>
566 <dl>
567 <dt>Return Type:</dt>
568 <dd>
569 list of str
570 </dd>
571 </dl>
572 <a NAME="Pip.installPackages" ID="Pip.installPackages"></a>
573 <h4>Pip.installPackages</h4>
574 <b>installPackages</b>(<i>packages, venvName="", userSite=False, interpreter="", forceReinstall=False</i>)
575
576 <p>
577 Public method to install the given list of packages.
578 </p>
579 <dl>
580
581 <dt><i>packages</i> (list of str)</dt>
582 <dd>
583 list of packages to install
584 </dd>
585 <dt><i>venvName</i> (str)</dt>
586 <dd>
587 name of the virtual environment to be used
588 </dd>
589 <dt><i>userSite</i> (bool)</dt>
590 <dd>
591 flag indicating an install to the user install
592 directory
593 </dd>
594 <dt><i>interpreter</i> (str)</dt>
595 <dd>
596 interpreter to be used for execution
597 </dd>
598 <dt><i>forceReinstall</i> (bool)</dt>
599 <dd>
600 flag indicating to force a reinstall of
601 the packages
602 </dd>
603 </dl>
604 <a NAME="Pip.installPip" ID="Pip.installPip"></a>
605 <h4>Pip.installPip</h4>
606 <b>installPip</b>(<i>venvName, userSite=False</i>)
607
608 <p>
609 Public method to install pip.
610 </p>
611 <dl>
612
613 <dt><i>venvName</i> (str)</dt>
614 <dd>
615 name of the environment to install pip into
616 </dd>
617 <dt><i>userSite</i> (bool)</dt>
618 <dd>
619 flag indicating an install to the user install
620 directory
621 </dd>
622 </dl>
623 <a NAME="Pip.installRequirements" ID="Pip.installRequirements"></a>
624 <h4>Pip.installRequirements</h4>
625 <b>installRequirements</b>(<i>venvName</i>)
626
627 <p>
628 Public method to install packages as given in a requirements file.
629 </p>
630 <dl>
631
632 <dt><i>venvName</i> (str)</dt>
633 <dd>
634 name of the virtual environment to be used
635 </dd>
636 </dl>
637 <a NAME="Pip.repairPip" ID="Pip.repairPip"></a>
638 <h4>Pip.repairPip</h4>
639 <b>repairPip</b>(<i>venvName</i>)
640
641 <p>
642 Public method to repair the pip installation.
643 </p>
644 <dl>
645
646 <dt><i>venvName</i> (str)</dt>
647 <dd>
648 name of the environment to install pip into
649 </dd>
650 </dl>
651 <a NAME="Pip.runProcess" ID="Pip.runProcess"></a>
652 <h4>Pip.runProcess</h4>
653 <b>runProcess</b>(<i>args, interpreter</i>)
654
655 <p>
656 Public method to execute the current pip with the given arguments.
657 </p>
658 <p>
659 The selected pip executable is called with the given arguments and
660 waited for its end.
661 </p>
662 <dl>
663
664 <dt><i>args</i> (list of str)</dt>
665 <dd>
666 list of command line arguments
667 </dd>
668 <dt><i>interpreter</i> (str)</dt>
669 <dd>
670 path of the Python interpreter to be used
671 </dd>
672 </dl>
673 <dl>
674 <dt>Return:</dt>
675 <dd>
676 tuple containing a flag indicating success and the output
677 of the process
678 </dd>
679 </dl>
680 <dl>
681 <dt>Return Type:</dt>
682 <dd>
683 tuple of (bool, str)
684 </dd>
685 </dl>
686 <a NAME="Pip.showCacheInfo" ID="Pip.showCacheInfo"></a>
687 <h4>Pip.showCacheInfo</h4>
688 <b>showCacheInfo</b>(<i>venvName</i>)
689
690 <p>
691 Public method to show some information about the pip cache.
692 </p>
693 <dl>
694
695 <dt><i>venvName</i> (str)</dt>
696 <dd>
697 name of the virtual environment to be used
698 </dd>
699 </dl>
700 <a NAME="Pip.uninstallPackages" ID="Pip.uninstallPackages"></a>
701 <h4>Pip.uninstallPackages</h4>
702 <b>uninstallPackages</b>(<i>packages, venvName</i>)
703
704 <p>
705 Public method to uninstall the given list of packages.
706 </p>
707 <dl>
708
709 <dt><i>packages</i> (list of str)</dt>
710 <dd>
711 list of packages to uninstall
712 </dd>
713 <dt><i>venvName</i> (str)</dt>
714 <dd>
715 name of the virtual environment to be used
716 </dd>
717 </dl>
718 <dl>
719 <dt>Return:</dt>
720 <dd>
721 flag indicating a successful execution
722 </dd>
723 </dl>
724 <dl>
725 <dt>Return Type:</dt>
726 <dd>
727 bool
728 </dd>
729 </dl>
730 <a NAME="Pip.uninstallRequirements" ID="Pip.uninstallRequirements"></a>
731 <h4>Pip.uninstallRequirements</h4>
732 <b>uninstallRequirements</b>(<i>venvName</i>)
733
734 <p>
735 Public method to uninstall packages as given in a requirements file.
736 </p>
737 <dl>
738
739 <dt><i>venvName</i> (str)</dt>
740 <dd>
741 name of the virtual environment to be used
742 </dd>
743 </dl>
744 <a NAME="Pip.upgradePackages" ID="Pip.upgradePackages"></a>
745 <h4>Pip.upgradePackages</h4>
746 <b>upgradePackages</b>(<i>packages, venvName, userSite=False</i>)
747
748 <p>
749 Public method to upgrade the given list of packages.
750 </p>
751 <dl>
752
753 <dt><i>packages</i> (list of str)</dt>
754 <dd>
755 list of packages to upgrade
756 </dd>
757 <dt><i>venvName</i> (str)</dt>
758 <dd>
759 name of the virtual environment to be used
760 </dd>
761 <dt><i>userSite</i> (bool)</dt>
762 <dd>
763 flag indicating an install to the user install
764 directory
765 </dd>
766 </dl>
767 <dl>
768 <dt>Return:</dt>
769 <dd>
770 flag indicating a successful execution
771 </dd>
772 </dl>
773 <dl>
774 <dt>Return Type:</dt>
775 <dd>
776 bool
777 </dd>
778 </dl>
779 <div align="right"><a href="#top">Up</a></div>
780 <hr />
781 </body></html>

eric ide

mercurial