From b42ab177a8caa85e023080219484385ff3ae8472 Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Tue, 10 Jan 2023 20:38:19 +0100 Subject: [PATCH] CI: fighting with Poetry PATH on Windows Disabling the Windows CI for now because Poetry has issues: https://github.com/python-poetry/poetry/issues/7158 --- .github/workflows/ci-linux.yml | 4 ++-- .github/workflows/ci-mac.yml | 4 ++-- .github/workflows/ci-windows.yml | 33 +++++++++++++++++++++----------- poetry.lock | 2 +- pyproject.toml | 2 +- tasks.py | 11 +++++++++-- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 78c7f99..6b093c3 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -11,10 +11,10 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index 47cfde0..6589573 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -11,10 +11,10 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 4135e3b..54fd743 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -1,6 +1,10 @@ name: "FileCheck.py on Windows" -on: [pull_request] +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "**" ] jobs: build: @@ -8,16 +12,23 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: "Print Debug info" + run: | + python --version + echo $env:USERPROFILE + echo $env:PATH + echo "$PWD" + - name: Upgrade pip run: | python -m pip install --upgrade pip @@ -28,13 +39,9 @@ jobs: - name: "Poetry: add to %PATH%" run: | - echo "%APPDATA%\pypoetry" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: "Print Debug info" - run: | - echo $env:USERPROFILE - echo $env:PATH - echo "$PWD" + # Either of these should work. + echo "$env:APPDATA\pypoetry" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "$env:APPDATA\Python\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: "Poetry: print version" run: | @@ -42,10 +49,14 @@ jobs: - name: "Poetry: configure settings" run: | + # https://github.com/python-poetry/poetry/issues/6098 + poetry config virtualenvs.create true poetry config virtualenvs.in-project true + poetry config virtualenvs.prefer-active-python - name: "Poetry: Install dependencies" run: | + poetry run python --version poetry install - name: Run tests diff --git a/poetry.lock b/poetry.lock index 5f8cd11..42a9ced 100644 --- a/poetry.lock +++ b/poetry.lock @@ -381,7 +381,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black ( [metadata] lock-version = "1.1" python-versions = ">=3.6.2,<4.0" -content-hash = "31b1904a7a1bba768dc6646e78dec6699b8bfe6bda55da1d6bd188fd80b9e3d2" +content-hash = "64d31c4973727f067499ac62644344a409a725f37c6950f0b54870d652fb5859" [metadata.files] astroid = [ diff --git a/pyproject.toml b/pyproject.toml index e5a40e2..46f72bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ black = ">=21.9b0" bump2version = ">=0.5.11" coverage = ">=5.4" flake8 = ">=3.9.2" -invoke = ">=1.3.0" +invoke = ">=1.4.1" lit = ">=0.9" pylint = ">=2.12.2" pytest = ">=6.2.2" diff --git a/tasks.py b/tasks.py index 4e94552..21a2415 100644 --- a/tasks.py +++ b/tasks.py @@ -3,8 +3,15 @@ import re from typing import Optional -import invoke -from invoke import task +# Ugly but works: +# https://github.com/pyinvoke/invoke/issues/833#issuecomment-1293148106 +import inspect + +if not hasattr(inspect, "getargspec"): + inspect.getargspec = inspect.getfullargspec + +from invoke import task # pylint: disable=wrong-import-position +import invoke # pylint: disable=wrong-import-position FILECHECK_LLVM_8_EXEC = "FileCheck-8.0.1" FILECHECK_LLVM_9_EXEC = "FileCheck-9.0.1"