From df0934cfb641c4b44c937235bdb9cdb77e6d0479 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Mon, 13 Apr 2026 16:31:09 +0200 Subject: [PATCH 1/2] Dropped python 3.9 and fixed testing for other versions Signed-off-by: Ole Herman Schumacher Elgesem --- .github/workflows/make-check.yml | 10 ++++++++-- Makefile | 4 ++-- src/cfengine_cli/lint.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/make-check.yml b/.github/workflows/make-check.yml index f67e6fc..40efa3f 100644 --- a/.github/workflows/make-check.yml +++ b/.github/workflows/make-check.yml @@ -21,9 +21,9 @@ jobs: check: runs-on: ubuntu-24.04 strategy: - fail-fast: false + fail-fast: true 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@v4 - name: Set up Python ${{ matrix.python-version }} @@ -36,9 +36,15 @@ jobs: python -m pip install uv sudo apt-get install npm npm install --global prettier + - name: Set python version file for uv + run: | + echo "${{ matrix.python-version }}" > .python-version - name: Run make check run: | make check + - name: Reset python version file + run: | + git restore .python-version - name: See if there are changes run: | git diff --exit-code diff --git a/Makefile b/Makefile index 04ac477..195a0de 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,11 @@ venv: uv sync format: venv - uv tool run black . + uv tool run black . --target-version py310 prettier . --write lint: venv - uv tool run black --check . + uv tool run black --check . --fast uv tool run flake8 src/ --ignore=E203,W503,E722,E731 --max-complexity=100 --max-line-length=160 uv tool run pyflakes src/ uv tool run pyright src/ diff --git a/src/cfengine_cli/lint.py b/src/cfengine_cli/lint.py index d293519..2f9559b 100644 --- a/src/cfengine_cli/lint.py +++ b/src/cfengine_cli/lint.py @@ -537,7 +537,7 @@ def _lint_node(node: Node, policy_file: PolicyFile, state: State) -> int: ): _highlight_range(node, lines) print( - f"Error: {"Bundle" if "bundle" in node.type else "Body"} '{_text(node)}' conflicts with built-in function with the same name {location}" + f"Error: {'Bundle' if 'bundle' in node.type else 'Body'} '{_text(node)}' conflicts with built-in function with the same name {location}" ) return 1 if node.type == "calling_identifier": From fc374c6dffc8db03c387db37fa1ef3fbae7b2880 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Mon, 13 Apr 2026 16:52:15 +0200 Subject: [PATCH 2/2] Added support/testing for python 3.14 Signed-off-by: Ole Herman Schumacher Elgesem --- .github/workflows/make-check.yml | 2 +- .python-version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/make-check.yml b/.github/workflows/make-check.yml index 40efa3f..b59382e 100644 --- a/.github/workflows/make-check.yml +++ b/.github/workflows/make-check.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/.python-version b/.python-version index 24ee5b1..6324d40 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.13 +3.14