Use whatever version of go is available on CI

This commit is contained in:
Kovid Goyal
2022-08-17 00:32:13 +05:30
parent bab914c497
commit f90753c69b
3 changed files with 10 additions and 24 deletions

View File

@@ -28,15 +28,20 @@ def main() -> None:
warnings.simplefilter('error')
gohome = os.path.expanduser('~/go')
go = shutil.which('go')
python = shutil.which('python') or shutil.which('python3')
current_home = os.path.expanduser('~') + os.sep
paths = os.environ.get('PATH', '/usr/local/sbin:/usr/local/bin:/usr/bin').split(os.pathsep)
path = os.pathsep.join(x for x in paths if not x.startswith(current_home))
launcher_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kitty', 'launcher')
if go:
if go and go.startswith(current_home):
path = f'{os.path.dirname(go)}{os.pathsep}{path}'
if python and python.startswith(current_home):
path = f'{os.path.dirname(python)}{os.pathsep}{path}'
path = f'{launcher_dir}{os.pathsep}{path}'
PYTHON_FOR_TYPE_CHECK = shutil.which('python') or shutil.which('python3') or ''
gohome = os.path.expanduser('~/go')
if os.environ.get('CI') == 'true':
print('Using PATH in test environment:', path, flush=True)
with TemporaryDirectory() as tdir, env_vars(
PYTHONWARNINGS='error', HOME=tdir, USERPROFILE=tdir, PATH=path,
XDG_CONFIG_HOME=os.path.join(tdir, '.config'),