src/eric7/PipInterface/Pip.py

branch
eric7-maintenance
changeset 9371
1da8bc75946f
parent 9305
3b7ef53c34c7
parent 9323
6ae7193558ac
child 9442
906485dcd210
--- a/src/eric7/PipInterface/Pip.py	Fri Sep 02 14:10:44 2022 +0200
+++ b/src/eric7/PipInterface/Pip.py	Sat Oct 01 13:06:10 2022 +0200
@@ -474,6 +474,27 @@
                 if res:
                     dia.exec()
 
+    def installEditableProject(self, interpreter, projectPath):
+        """
+        Public method to install a project in development mode.
+
+        @param interpreter interpreter to be used for execution
+        @type str
+        @param projectPath path of the project
+        @type str
+        """
+        if interpreter and projectPath:
+            args = ["-m", "pip", "install"]
+            if Preferences.getPip("PipSearchIndex"):
+                indexUrl = Preferences.getPip("PipSearchIndex") + "/simple"
+                args += ["--index-url", indexUrl]
+            args += ["--editable", projectPath]
+
+            dia = PipDialog(self.tr("Install Project"))
+            res = dia.startProcess(interpreter, args)
+            if res:
+                dia.exec()
+
     def uninstallPackages(self, packages, venvName):
         """
         Public method to uninstall the given list of packages.
@@ -991,13 +1012,8 @@
         if envName:
             interpreter = self.getVirtualenvInterpreter(envName)
             if interpreter:
-                from . import pipdeptree
-
-                with open(pipdeptree.__file__, "r") as f:
-                    content = f.read()
                 args = [
-                    "-c",
-                    content,
+                    os.path.join(os.path.dirname(__file__), "pipdeptree.py"),
                     "--json-tree",
                 ]
                 if localPackages:
@@ -1048,13 +1064,9 @@
         if envName:
             interpreter = self.getVirtualenvInterpreter(envName)
             if interpreter:
-                from . import piplicenses
 
-                with open(piplicenses.__file__, "r") as f:
-                    content = f.read()
                 args = [
-                    "-c",
-                    content,
+                    os.path.join(os.path.dirname(__file__), "piplicenses.py"),
                     "--from",
                     "mixed",
                     "--with-system",
@@ -1067,7 +1079,7 @@
                 if usersite:
                     args.append("--user-only")
                 if summary:
-                    args.append("--summary")
+                    args.append("--summary-by-license")
 
                 proc = QProcess()
                 proc.start(interpreter, args)

eric ide

mercurial