mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 15:35:03 +02:00
Use whatever version of go is available on CI
This commit is contained in:
7
test.py
7
test.py
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user