From f90753c69bc1ab7338b478ac16333f7ebb210196 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Aug 2022 00:32:13 +0530 Subject: [PATCH] Use whatever version of go is available on CI --- .github/workflows/ci.yml | 25 +++---------------------- docs/build.rst | 2 +- test.py | 7 ++++++- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf872b72d..adc140850 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,11 +53,6 @@ jobs: with: python-version: ${{ matrix.pyver }} - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '>=1.19.0' - - name: Build kitty run: python .github/workflows/ci.py build @@ -83,19 +78,14 @@ jobs: with: python-version: "3.10" - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '>=1.19.0' - - name: Install build-only deps - run: pip install -r docs/requirements.txt flake8 mypy types-requests types-docutils + run: python -m pip install -r docs/requirements.txt flake8 mypy types-requests types-docutils - name: Run pyflakes run: python -m flake8 --count . - name: Run gofmt - run: python .github/workflows/ci.py gofmt + run: go version && python .github/workflows/ci.py gofmt - name: Build kitty package run: python .github/workflows/ci.py package @@ -104,7 +94,7 @@ jobs: run: python setup.py build --debug - name: Run mypy - run: ./test.py mypy + run: which python && python -m mypy --version && ./test.py mypy - name: Build man page run: make FAIL_WARN=1 man @@ -126,11 +116,6 @@ jobs: with: fetch-depth: 10 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '>=1.19.0' - - name: Build kitty run: which python3 && python3 .github/workflows/ci.py build @@ -150,10 +135,6 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.10" - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '>=1.19.0' - name: Build kitty run: python3 .github/workflows/ci.py build diff --git a/docs/build.rst b/docs/build.rst index c72050d54..b00d8aa1a 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -46,7 +46,7 @@ Run-time dependencies: Build-time dependencies: * ``gcc`` or ``clang`` -* ``go >= 1.19`` +* ``go >= 1.17`` * ``pkg-config`` * For building on Linux in addition to the above dependencies you might also need to install the following packages, if they are not already installed by diff --git a/test.py b/test.py index 9dc16b745..7c37864bc 100755 --- a/test.py +++ b/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'),