update_manager: resolve pip location issues
If the supplied python executable is a symbolic link attempt to read the location at which it points. If this is a virtualenv this should give us the correct pip location. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
c24fd7d11c
commit
b5e7a5ba5a
|
@ -5,6 +5,7 @@
|
||||||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -72,9 +73,14 @@ class AppDeploy(BaseDeploy):
|
||||||
self.executable = pathlib.Path(executable).expanduser()
|
self.executable = pathlib.Path(executable).expanduser()
|
||||||
self.pip_exe = self.executable.parent.joinpath("pip")
|
self.pip_exe = self.executable.parent.joinpath("pip")
|
||||||
if not self.pip_exe.exists():
|
if not self.pip_exe.exists():
|
||||||
self.server.add_warning(
|
if self.executable.is_symlink():
|
||||||
f"Update Manger {self.name}: Unable to locate pip "
|
self.executable = pathlib.Path(os.readlink(self.executable))
|
||||||
"executable")
|
self.pip_exe = self.executable.parent.joinpath("pip")
|
||||||
|
if not self.pip_exe.exists():
|
||||||
|
logging.info(
|
||||||
|
f"Update Manger {self.name}: Unable to locate pip "
|
||||||
|
"executable")
|
||||||
|
self.pip_exe = None
|
||||||
self._verify_path(config, 'env', self.executable)
|
self._verify_path(config, 'env', self.executable)
|
||||||
self.venv_args = config.get('venv_args', None)
|
self.venv_args = config.get('venv_args', None)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue