Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5b06661
Update action.yml
Harvester57 Jul 10, 2025
09b9891
Update ci.yml
Harvester57 Jul 10, 2025
639a38f
Update action.yml
Harvester57 Jul 10, 2025
5b70d31
Update action.yml
Harvester57 Jul 10, 2025
57c447f
Update action.yml
Harvester57 Jul 10, 2025
a6d3e64
Update action.yml
Harvester57 Jul 10, 2025
6ec294d
Update ci.yml
Harvester57 Jul 10, 2025
aca4495
Test all Python versions
Harvester57 Jul 10, 2025
3ccc6a4
Don't test Python 3.9
Harvester57 Jul 10, 2025
c3d578d
Upload artifact for latest version only
Harvester57 Jul 10, 2025
cbe6f67
Wait for Windows build
Harvester57 Jul 10, 2025
f9b41fc
Fix version check
Harvester57 Jul 10, 2025
acbed63
Merge branch 'Wenzel:master' into windows-caching
Harvester57 Jul 25, 2025
fdf00dc
Build on master only
Harvester57 Jul 30, 2025
960f4d0
Fix if condition for Poetry dependencies
Harvester57 Jul 30, 2025
bfbed10
Remove redundant step handled by setup-python
Harvester57 Jul 30, 2025
41d8759
Add comment
Harvester57 Jul 30, 2025
054698f
Install poetry after Python setup
Harvester57 Aug 3, 2025
eb4ec98
Revert Poetry installation change
Harvester57 Aug 3, 2025
2008f00
Manually handle Poetry cache
Harvester57 Aug 3, 2025
acef5df
Revert Poetry changes
Harvester57 Aug 3, 2025
16adb1f
Update Python Action
Harvester57 Jan 12, 2026
fe6a706
Test CI on all branches
Harvester57 Jan 12, 2026
fb49d99
Manually cache Poetry env
Harvester57 Jan 12, 2026
ad58ac0
Test and build for Python v3.13 only
Harvester57 Jan 12, 2026
472df0e
Cache per Python version
Harvester57 Jan 12, 2026
178914e
Define cache per shell env
Harvester57 Jan 12, 2026
92a4e9c
Typo
Harvester57 Jan 12, 2026
5764f77
Update to Python v3.14
Harvester57 Jan 12, 2026
cb61b7d
Revert to v3.13 and upgrade Flake8
Harvester57 Jan 12, 2026
b75224d
Update poetry.lock
Harvester57 Jan 12, 2026
48540f9
Fix Flake8 warning
Harvester57 Jan 12, 2026
edab5dc
Update bugbear
Harvester57 Jan 12, 2026
13f197b
Flake8: ignore E501
Harvester57 Jan 12, 2026
e65cfbe
Flake8: only check local project
Harvester57 Jan 12, 2026
b7b951f
Flake8: ignore venv and dist
Harvester57 Jan 12, 2026
12c0ba6
Do not fail on error
Harvester57 Jan 12, 2026
52edc5a
Try to cache pip
Harvester57 Jan 12, 2026
331415b
Test and build on all stable versions
Harvester57 Jan 12, 2026
ad37280
Remove poetry_version variable (unused)
Harvester57 Jan 12, 2026
7f14034
Remove comment
Harvester57 Jan 12, 2026
c117199
Revert global variable suppression
Harvester57 Jan 12, 2026
0cfe277
Update checkout Action
Harvester57 Jan 12, 2026
535c57f
Remove blank line
Harvester57 Jan 12, 2026
f6914e2
Revert flake8 upgrade
Harvester57 Jan 12, 2026
6ae386d
Restore --no-interaction
Harvester57 Jan 12, 2026
5688676
Skip Poetry project installation on cache hits
Harvester57 Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 34 additions & 38 deletions .github/actions/common-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,42 @@ inputs:
runs:
using: "composite"
steps:
- name: Set up Python 🐍
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ inputs.python_version }}
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- 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: Set up Python 🐍
id: setup-python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ inputs.python_version }}
pip-install: poetry
cache: 'pip'

- name: Install Poetry
uses: abatilo/actions-poetry@65c61eae400c65c9510a584af85138c1ae19bbc0 # v3.0.2
with:
poetry-version: 2.1.3
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
shell: bash

# 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') }}
- 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'
- uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
id: cache-venv
name: Cache definition for Poetry (Python ${{ inputs.python_version }}, ${{ env.shellos }})
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}-py${{ inputs.python_version }}-${{ env.shellos }}

- name: Install project
run: poetry install --no-interaction
shell: ${{ env.shellos }}
- name: Install project
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction
shell: ${{ env.shellos }}
37 changes: 27 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,49 @@ jobs:
strategy:
matrix:
task: ["fmt", "lint"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- uses: ./.github/actions/common-setup
with:
python_version: ${{ matrix.python-version }}

- name: check code
- name: Check code (${{ matrix.task }})
continue-on-error: true
run: poetry run poe ${{ matrix.task }}

build:
needs: code_checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- uses: ./.github/actions/common-setup
with:
python_version: ${{ matrix.python-version }}

- name: Build 🔨
run: poetry build

build_windows:
needs: code_checks
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- uses: ./.github/actions/common-setup
with:
python_version: 3.13
python_version: ${{ matrix.python-version }}

- 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'
Expand All @@ -56,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
Expand All @@ -67,21 +80,25 @@ jobs:
shell: bash

test:
needs: build
needs: ['build', 'build_windows']

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: true

- uses: ./.github/actions/common-setup
with:
python_version: ${{ matrix.python-version }}

- name: Run tests
run: poetry run poe test_e2e
Expand All @@ -97,7 +114,7 @@ jobs:
# push on master and tag is 'v*'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand All @@ -122,7 +139,7 @@ jobs:
# the deploy action below depends on a checkout of the repo
# otherwise it fails trying to remote the 'origin' remote
# https://github.com/JamesIves/github-pages-deploy-action/issues/335
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

# download artifacts
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
Expand All @@ -144,7 +161,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- uses: ./.github/actions/common-setup

Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ branch = true

[tool.poe.tasks]
fmt = "black ."
flake8 = "flake8 --show-source --statistics"
flake8 = "flake8 --show-source --statistics --extend-exclude .venv,dist ."
isort = "isort --line-length 120 --profile black ."
lint = ["flake8", "isort"]
mypy = "mypy ."
Expand Down