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
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 10 additions and 24 deletions

View File

@ -53,11 +53,6 @@ jobs:
with: with:
python-version: ${{ matrix.pyver }} python-version: ${{ matrix.pyver }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'
- name: Build kitty - name: Build kitty
run: python .github/workflows/ci.py build run: python .github/workflows/ci.py build
@ -83,19 +78,14 @@ jobs:
with: with:
python-version: "3.10" python-version: "3.10"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'
- name: Install build-only deps - 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 - name: Run pyflakes
run: python -m flake8 --count . run: python -m flake8 --count .
- name: Run gofmt - name: Run gofmt
run: python .github/workflows/ci.py gofmt run: go version && python .github/workflows/ci.py gofmt
- name: Build kitty package - name: Build kitty package
run: python .github/workflows/ci.py package run: python .github/workflows/ci.py package
@ -104,7 +94,7 @@ jobs:
run: python setup.py build --debug run: python setup.py build --debug
- name: Run mypy - name: Run mypy
run: ./test.py mypy run: which python && python -m mypy --version && ./test.py mypy
- name: Build man page - name: Build man page
run: make FAIL_WARN=1 man run: make FAIL_WARN=1 man
@ -126,11 +116,6 @@ jobs:
with: with:
fetch-depth: 10 fetch-depth: 10
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'
- name: Build kitty - name: Build kitty
run: which python3 && python3 .github/workflows/ci.py build run: which python3 && python3 .github/workflows/ci.py build
@ -150,10 +135,6 @@ jobs:
uses: actions/setup-python@v3 uses: actions/setup-python@v3
with: with:
python-version: "3.10" python-version: "3.10"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'
- name: Build kitty - name: Build kitty
run: python3 .github/workflows/ci.py build run: python3 .github/workflows/ci.py build

View File

@ -46,7 +46,7 @@ Run-time dependencies:
Build-time dependencies: Build-time dependencies:
* ``gcc`` or ``clang`` * ``gcc`` or ``clang``
* ``go >= 1.19`` * ``go >= 1.17``
* ``pkg-config`` * ``pkg-config``
* For building on Linux in addition to the above dependencies you might also * 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 need to install the following packages, if they are not already installed by

View File

@ -28,15 +28,20 @@ def main() -> None:
warnings.simplefilter('error') warnings.simplefilter('error')
gohome = os.path.expanduser('~/go') gohome = os.path.expanduser('~/go')
go = shutil.which('go') go = shutil.which('go')
python = shutil.which('python') or shutil.which('python3')
current_home = os.path.expanduser('~') + os.sep current_home = os.path.expanduser('~') + os.sep
paths = os.environ.get('PATH', '/usr/local/sbin:/usr/local/bin:/usr/bin').split(os.pathsep) 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)) 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') 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}' 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}' path = f'{launcher_dir}{os.pathsep}{path}'
PYTHON_FOR_TYPE_CHECK = shutil.which('python') or shutil.which('python3') or '' PYTHON_FOR_TYPE_CHECK = shutil.which('python') or shutil.which('python3') or ''
gohome = os.path.expanduser('~/go') 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( with TemporaryDirectory() as tdir, env_vars(
PYTHONWARNINGS='error', HOME=tdir, USERPROFILE=tdir, PATH=path, PYTHONWARNINGS='error', HOME=tdir, USERPROFILE=tdir, PATH=path,
XDG_CONFIG_HOME=os.path.join(tdir, '.config'), XDG_CONFIG_HOME=os.path.join(tdir, '.config'),