From 5b066618f3f83f8ca2cace26bebb7167e3a0482c Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:00:32 +0200 Subject: [PATCH 01/16] Update action.yml --- .github/actions/common-setup/action.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 36e9a98..5dff60b 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -13,6 +13,7 @@ runs: uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ inputs.python_version }} + cache: poetry - name: Default shell run: | @@ -30,17 +31,7 @@ runs: uses: abatilo/actions-poetry@65c61eae400c65c9510a584af85138c1ae19bbc0 # v3.0.2 with: poetry-version: 2.1.3 - - # Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache - # key: if you're using multiple Python versions, or multiple OSes, you'd need to include - # them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. - - name: cache deps - id: cache-deps - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 - with: - path: ~/.cache/pypoetry - key: pydeps-${{ inputs.python_version }}-${{ env.shellos }}-${{ hashFiles('**/poetry.lock') }} - + # Install dependencies. `--no-root` means "install all dependencies but not the project # itself", which is what you want to avoid caching _your_ code. The `if` statement # ensures this only runs on a cache miss. From 09b9891217cf4227afbc4d0919a82cc2e91397bd Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:01:30 +0200 Subject: [PATCH 02/16] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab48636..5cfbaff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ name: CI on: push: branches: - - master + - '*' tags: - '*' pull_request: From 639a38f3e8b203cc6b11431618f86486ab86246e Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:06:39 +0200 Subject: [PATCH 03/16] Update action.yml --- .github/actions/common-setup/action.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 5dff60b..7010dbc 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -9,6 +9,9 @@ inputs: runs: using: "composite" steps: + - name: Install Poetry + run: | + pipx install poetry==2.1.3 - name: Set up Python 🐍 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: @@ -26,11 +29,6 @@ runs: exit 1 fi shell: bash - - - name: Install Poetry - uses: abatilo/actions-poetry@65c61eae400c65c9510a584af85138c1ae19bbc0 # v3.0.2 - with: - poetry-version: 2.1.3 # Install dependencies. `--no-root` means "install all dependencies but not the project # itself", which is what you want to avoid caching _your_ code. The `if` statement From 5b70d31d0929aa3b407661fe6d397f8476700e29 Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:07:43 +0200 Subject: [PATCH 04/16] Update action.yml --- .github/actions/common-setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 7010dbc..df3ef72 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -10,7 +10,7 @@ runs: using: "composite" steps: - name: Install Poetry - run: | + run: | pipx install poetry==2.1.3 - name: Set up Python 🐍 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 From 57c447ff329c15768240efa38cf169cd604a5309 Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:08:43 +0200 Subject: [PATCH 05/16] Update action.yml --- .github/actions/common-setup/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index df3ef72..dfd3630 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -12,6 +12,7 @@ runs: - name: Install Poetry run: | pipx install poetry==2.1.3 + shell: bash - name: Set up Python 🐍 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: From a6d3e647941341f2fa8c51ddc7e9281cf9f182b1 Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:15:05 +0200 Subject: [PATCH 06/16] Update action.yml --- .github/actions/common-setup/action.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index dfd3630..0755ab7 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -6,18 +6,27 @@ inputs: description: "Python version to setup" required: true default: "3.13" + poetry_version: + description: "Poetry version to setup" + required: true + default: "2.1.3" runs: using: "composite" steps: - name: Install Poetry - run: | - pipx install poetry==2.1.3 + run: pipx install poetry==${{ inputs.poetry_version }} shell: bash + - name: Set up Python 🐍 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ inputs.python_version }} cache: poetry + cache-dependency-path: poetry.lock + + - name: Set Poetry environment + run: poetry env use ${{ inputs.python_version }} + shell: bash - name: Default shell run: | From 6ec294d3604b6bc351f3396afed3e688660f620d Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 12:15:57 +0200 Subject: [PATCH 07/16] Update ci.yml --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cfbaff..5609ab0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: - uses: ./.github/actions/common-setup with: python_version: 3.13 + poetry_version: 2.1.3 - name: Add entrypoint to bypass issue with relative imports in PyInstaller run: powershell -Command 'Invoke-WebRequest https://gist.githubusercontent.com/Wenzel/e38d227d94f16e026b3aed03ea6a6661/raw/383ec56d62c58e444f6c5962ee6940a5c583d341/stub.py -OutFile stub.py' From aca449551b01c4b4b3f261be4598eef975104fdc Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 14:05:58 +0200 Subject: [PATCH 08/16] Test all Python versions --- .github/workflows/ci.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5609ab0..306c221 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,14 @@ jobs: strategy: matrix: task: ["fmt", "lint"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/common-setup + with: + python_version: ${{ matrix.python-version }} - name: check code run: poetry run poe ${{ matrix.task }} @@ -28,11 +31,16 @@ jobs: build: needs: code_checks runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/common-setup + with: + python_version: ${{ matrix.python-version }} - name: Build 🔨 run: poetry build @@ -40,13 +48,16 @@ jobs: build_windows: needs: code_checks runs-on: windows-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/common-setup with: - python_version: 3.13 + python_version: ${{ matrix.python-version }} poetry_version: 2.1.3 - name: Add entrypoint to bypass issue with relative imports in PyInstaller @@ -72,6 +83,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} defaults: run: @@ -83,6 +95,8 @@ jobs: submodules: true - uses: ./.github/actions/common-setup + with: + python_version: ${{ matrix.python-version }} - name: Run tests run: poetry run poe test_e2e From 3ccc6a4455d50df12df36f65f9305e059493ea25 Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 14:08:03 +0200 Subject: [PATCH 09/16] Don't test Python 3.9 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 306c221..15b0160 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: task: ["fmt", "lint"] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -50,7 +50,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -83,7 +83,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} defaults: run: From c3d578d891f788259d88730db50e44521db92a5a Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 14:14:57 +0200 Subject: [PATCH 10/16] Upload artifact for latest version only --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15b0160..ac64fa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,7 @@ jobs: shell: bash - name: Upload Windows release artefact + if: ${{ matrix.python-version }} == 3.13 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: checksec.exe From cbe6f67e3f3ee803f03bb2a78f528af43fbd85ea Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 14:19:11 +0200 Subject: [PATCH 11/16] Wait for Windows build --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac64fa6..c39a783 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,8 @@ jobs: shell: bash test: - needs: build + needs: ['build', 'build_windows'] + strategy: matrix: os: [ubuntu-latest, windows-latest] From f9b41fc71c2d5b44382eb08135a246f0e9e84f23 Mon Sep 17 00:00:00 2001 From: Florian Stosse Date: Thu, 10 Jul 2025 14:20:33 +0200 Subject: [PATCH 12/16] Fix version check --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c39a783..2c02ff8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: shell: bash - name: Upload Windows release artefact - if: ${{ matrix.python-version }} == 3.13 + if: ${{ matrix.python-version == 3.13 }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: checksec.exe From fdf00dc1d36d74f1a97cffa64d07e0e2e1aab451 Mon Sep 17 00:00:00 2001 From: Harvester57 Date: Wed, 30 Jul 2025 10:29:15 +0200 Subject: [PATCH 13/16] Build on master only --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c02ff8..2f31f39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ name: CI on: push: branches: - - '*' + - master tags: - '*' pull_request: From 960f4d08b5b44ed1a364b6965c3f0f863c228d0c Mon Sep 17 00:00:00 2001 From: Harvester57 Date: Wed, 30 Jul 2025 10:38:50 +0200 Subject: [PATCH 14/16] Fix if condition for Poetry dependencies --- .github/actions/common-setup/action.yml | 69 +++++++++++++------------ 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 0755ab7..27a7c4c 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -13,41 +13,42 @@ inputs: runs: using: "composite" steps: - - name: Install Poetry - run: pipx install poetry==${{ inputs.poetry_version }} - shell: bash + - name: Install Poetry + run: pipx install poetry==${{ inputs.poetry_version }} + shell: bash - - name: Set up Python 🐍 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 - with: - python-version: ${{ inputs.python_version }} - cache: poetry - cache-dependency-path: poetry.lock + - name: Set up Python 🐍 + id: setup-python + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: ${{ inputs.python_version }} + cache: poetry + cache-dependency-path: poetry.lock - - name: Set Poetry environment - run: poetry env use ${{ inputs.python_version }} - shell: bash + - name: Set Poetry environment + run: poetry env use ${{ inputs.python_version }} + shell: bash - - name: Default shell - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - echo shellos=bash >> $GITHUB_ENV - elif [ "$RUNNER_OS" == "Windows" ]; then - echo shellos=powershell >> $GITHUB_ENV - else - echo "$RUNNER_OS not supported" - exit 1 - fi - shell: bash - - # Install dependencies. `--no-root` means "install all dependencies but not the project - # itself", which is what you want to avoid caching _your_ code. The `if` statement - # ensures this only runs on a cache miss. - - name: Install dependencies - run: poetry install --no-interaction --no-root - shell: ${{ env.shellos }} - if: steps.cache-deps.outputs.cache-hit != 'true' + - name: Default shell + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + echo shellos=bash >> $GITHUB_ENV + elif [ "$RUNNER_OS" == "Windows" ]; then + echo shellos=powershell >> $GITHUB_ENV + else + echo "$RUNNER_OS not supported" + exit 1 + fi + shell: bash - - name: Install project - run: poetry install --no-interaction - shell: ${{ env.shellos }} + # Install dependencies. `--no-root` means "install all dependencies but not the project + # itself", which is what you want to avoid caching _your_ code. The `if` statement + # ensures this only runs on a cache miss. + - name: Install dependencies + run: poetry install --no-interaction --no-root + shell: ${{ env.shellos }} + if: steps.setup-python.outputs.cache-hit != 'true' + + - name: Install project + run: poetry install --no-interaction + shell: ${{ env.shellos }} From bfbed104d7c3bf84a50adbb622a6be073cb1e1a2 Mon Sep 17 00:00:00 2001 From: Harvester57 Date: Wed, 30 Jul 2025 11:01:33 +0200 Subject: [PATCH 15/16] Remove redundant step handled by setup-python --- .github/actions/common-setup/action.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 27a7c4c..7bca159 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -41,14 +41,6 @@ runs: fi shell: bash - # Install dependencies. `--no-root` means "install all dependencies but not the project - # itself", which is what you want to avoid caching _your_ code. The `if` statement - # ensures this only runs on a cache miss. - - name: Install dependencies - run: poetry install --no-interaction --no-root - shell: ${{ env.shellos }} - if: steps.setup-python.outputs.cache-hit != 'true' - - name: Install project run: poetry install --no-interaction shell: ${{ env.shellos }} From 41d8759021d2c9b3303c61100b38202fd8944b30 Mon Sep 17 00:00:00 2001 From: Harvester57 Date: Wed, 30 Jul 2025 11:08:27 +0200 Subject: [PATCH 16/16] Add comment --- .github/actions/common-setup/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/common-setup/action.yml b/.github/actions/common-setup/action.yml index 7bca159..280be94 100644 --- a/.github/actions/common-setup/action.yml +++ b/.github/actions/common-setup/action.yml @@ -41,6 +41,8 @@ runs: fi shell: bash + # The 'setup-python' action with 'cache: poetry' installs dependencies but not the project + # itself. This step installs the project package into the created virtual environment. - name: Install project run: poetry install --no-interaction shell: ${{ env.shellos }}