Added uninstall command

This commit is contained in:
2021-03-14 10:58:59 +01:00
parent fc12d1803d
commit da582a8d88
6 changed files with 118 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ class Pip:
@staticmethod
def install(package: str, *args, source: str = None, stdout=None, stderr=None):
pip_args = [sys.executable, "-m", "pip", "install"]
pip_args = [sys.executable, "-m", "pip", "install", "--yes"]
for arg in args:
pip_args.append(arg)
@@ -37,3 +37,7 @@ class Pip:
pip_args.append(package)
subprocess.run(pip_args, stdout=stdout, stderr=stderr)
@staticmethod
def uninstall(package: str, stdout=None, stderr=None):
subprocess.run([sys.executable, "-m", "pip", "uninstall", "--yes", package], stdout=stdout, stderr=stderr)