Skip to content

Commit

Permalink
fix: [dep] Fixed python dependency installation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kakueeen authored and deepin-ci-robot committed Oct 14, 2024
1 parent 24066de commit 1879d81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/plugins/core/depend/pipinstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ QString PIPInstaller::description()

bool PIPInstaller::checkInstalled(const QString &package)
{
// remove extra dependency
// e.g: python-package[all] -> python-package
QString pkgName = package;
QRegularExpression regex(R"(\[.*\])");
if (pkgName.contains(regex))
pkgName.remove(regex);

QProcess process;
QString cmd("pip3 show %1");
process.start(cmd.arg(package));
process.start(cmd.arg(pkgName));
process.waitForFinished();

QString output = process.readAllStandardOutput();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/python/pythonplugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"InstallerName" : "pip",
"Packages" : [
"debugpy",
"python-language-server"
"python-language-server[all]"
]
}
]
Expand Down

0 comments on commit 1879d81

Please sign in to comment.