23 from eric7 import CondaInterface |
23 from eric7 import CondaInterface |
24 from eric7.EricGui import EricPixmapCache |
24 from eric7.EricGui import EricPixmapCache |
25 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
25 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
26 from eric7.EricWidgets import EricFileDialog, EricMessageBox, EricTextInputDialog |
26 from eric7.EricWidgets import EricFileDialog, EricMessageBox, EricTextInputDialog |
27 from eric7.EricWidgets.EricApplication import ericApp |
27 from eric7.EricWidgets.EricApplication import ericApp |
|
28 from eric7.VirtualEnv.VirtualenvMeta import VirtualenvMetaData |
28 |
29 |
29 from .Ui_CondaPackagesWidget import Ui_CondaPackagesWidget |
30 from .Ui_CondaPackagesWidget import Ui_CondaPackagesWidget |
30 |
31 |
31 |
32 |
32 class CondaPackagesWidget(QWidget, Ui_CondaPackagesWidget): |
33 class CondaPackagesWidget(QWidget, Ui_CondaPackagesWidget): |
665 "--clone", |
666 "--clone", |
666 prefix, |
667 prefix, |
667 ] |
668 ] |
668 ok, prefix, interpreter = self.__conda.createCondaEnvironment(args) |
669 ok, prefix, interpreter = self.__conda.createCondaEnvironment(args) |
669 if ok: |
670 if ok: |
670 ericApp().getObject("VirtualEnvManager").addVirtualEnv( |
671 metadata = VirtualenvMetaData( |
671 virtEnvName, prefix, interpreter, isConda=True |
672 name=virtEnvName, |
|
673 path=prefix, |
|
674 interpreter=interpreter, |
|
675 is_conda=True, |
672 ) |
676 ) |
|
677 ericApp().getObject("VirtualEnvManager").addVirtualEnv(metadata) |
673 |
678 |
674 @pyqtSlot() |
679 @pyqtSlot() |
675 def __createEnvironment(self): |
680 def __createEnvironment(self): |
676 """ |
681 """ |
677 Private slot to create a conda environment from a requirements file. |
682 Private slot to create a conda environment from a requirements file. |
687 "--file", |
692 "--file", |
688 requirements, |
693 requirements, |
689 ] |
694 ] |
690 ok, prefix, interpreter = self.__conda.createCondaEnvironment(args) |
695 ok, prefix, interpreter = self.__conda.createCondaEnvironment(args) |
691 if ok: |
696 if ok: |
692 ericApp().getObject("VirtualEnvManager").addVirtualEnv( |
697 metadata = VirtualenvMetaData( |
693 virtEnvName, prefix, interpreter, isConda=True |
698 name=virtEnvName, |
|
699 path=prefix, |
|
700 interpreter=interpreter, |
|
701 is_conda=True, |
694 ) |
702 ) |
|
703 ericApp().getObject("VirtualEnvManager").addVirtualEnv(metadata) |
695 |
704 |
696 @pyqtSlot() |
705 @pyqtSlot() |
697 def __deleteEnvironment(self): |
706 def __deleteEnvironment(self): |
698 """ |
707 """ |
699 Private slot to delete a conda environment. |
708 Private slot to delete a conda environment. |