941 dependencies = [] |
941 dependencies = [] |
942 |
942 |
943 if envName: |
943 if envName: |
944 interpreter = self.getVirtualenvInterpreter(envName) |
944 interpreter = self.getVirtualenvInterpreter(envName) |
945 if interpreter: |
945 if interpreter: |
|
946 from . import pipdeptree |
|
947 with open(pipdeptree.__file__, "r") as f: |
|
948 content = f.read() |
946 args = [ |
949 args = [ |
947 "-m", "pipdeptree", |
950 "-c", |
|
951 content, |
948 "--json-tree", |
952 "--json-tree", |
949 "--python", interpreter, |
|
950 ] |
953 ] |
951 if localPackages: |
954 if localPackages: |
952 args.append("--local-only") |
955 args.append("--local-only") |
953 if usersite: |
956 if usersite: |
954 args.append("--user-only") |
957 args.append("--user-only") |
955 if reverse: |
958 if reverse: |
956 args.append("--reverse") |
959 args.append("--reverse") |
957 |
960 |
958 proc = QProcess() |
961 proc = QProcess() |
959 proc.start(Globals.getPythonExecutable(), args) |
962 proc.start(interpreter, args) |
960 if proc.waitForStarted(15000) and proc.waitForFinished(30000): |
963 if proc.waitForStarted(15000) and proc.waitForFinished(30000): |
961 output = str(proc.readAllStandardOutput(), |
964 output = str(proc.readAllStandardOutput(), |
962 Preferences.getSystem("IOEncoding"), |
965 Preferences.getSystem("IOEncoding"), |
963 'replace').strip() |
966 'replace').strip() |
964 with contextlib.suppress(json.JSONDecodeError): |
967 with contextlib.suppress(json.JSONDecodeError): |