fix: use current python executable if deploy.yaml one does not exist

This commit is contained in:
2026-07-05 23:29:37 +08:00
parent d6e52d7720
commit 38b6ce50c6
+10 -3
View File
@@ -1,6 +1,7 @@
import copy
import os
import subprocess
import sys
from typing import Optional, Union
from deploy.Windows.logger import logger
@@ -147,7 +148,7 @@ class DeployConfig(ConfigModel):
if os.path.exists(exe):
return exe
logger.warning(f'AdbExecutable: {exe} does not exists, use `adb` instead')
logger.warning(f'AdbExecutable: {exe} does not exist, use `adb` instead')
return 'adb'
@cached_property
@@ -156,12 +157,18 @@ class DeployConfig(ConfigModel):
if os.path.exists(exe):
return exe
logger.warning(f'GitExecutable: {exe} does not exists, use `git` instead')
logger.warning(f'GitExecutable: {exe} does not exist, use `git` instead')
return 'git'
@cached_property
def python(self) -> str:
return self.filepath(self.PythonExecutable)
exe = self.filepath(self.PythonExecutable)
if os.path.exists(exe):
return exe
current = sys.executable.replace("\\", "/")
logger.warning(f'PythonExecutable: {exe} does not exist, use current python instead: {current}')
return current
@cached_property
def requirements_file(self) -> str: