From 15debf339d74859c89f3f9c83be40eeaa3d89203 Mon Sep 17 00:00:00 2001 From: Swann Date: Fri, 10 Jul 2020 18:00:44 +0200 Subject: [PATCH] feat: auto-update dependencies --- multi_user/environment.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multi_user/environment.py b/multi_user/environment.py index 56373fb..96dcc9b 100644 --- a/multi_user/environment.py +++ b/multi_user/environment.py @@ -52,6 +52,10 @@ def install_package(name): subprocess.run([str(PYTHON_PATH), "-m", "pip", "install", name]) +def upgrade_package(name): + logging.debug(f"Using {PYTHON_PATH} for update") + subprocess.run([str(PYTHON_PATH), "-m", "pip", "install", name, "--upgrade"]) + def get_ip(): """ Retrieve the main network interface IP. @@ -82,3 +86,5 @@ def setup(dependencies, python_path): if not module_can_be_imported(package_name): install_package(package_name) module_can_be_imported(package_name) + else: + upgrade_package(package_name)