From 1f291eabced7bd11f61f203c454877145b1aba88 Mon Sep 17 00:00:00 2001 From: JP Hutchins Date: Tue, 21 Apr 2026 15:06:37 -0700 Subject: [PATCH] imgtool: python version coverage Drop 3.6 and 3.7 support. Update CI with coverage for all supported versions, including those that are EOL (3.8, 3.9), and near EOL (3.10). Signed-off-by: JP Hutchins --- .github/workflows/imgtool.yaml | 12 ++++++------ scripts/imgtool/keys/general.py | 2 +- scripts/setup.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/imgtool.yaml b/.github/workflows/imgtool.yaml index e3dc804571..5559f6e362 100644 --- a/.github/workflows/imgtool.yaml +++ b/.github/workflows/imgtool.yaml @@ -16,11 +16,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.x", "pypy3.9"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: 'pipenv' @@ -35,7 +35,7 @@ jobs: pipenv run pip install pytest -e . pipenv run pytest --junitxml=../junit/pytest-results-${{ matrix.python-version }}.xml - name: Upload test results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 if: always() with: name: pytest-results-${{ matrix.python-version }} @@ -47,11 +47,11 @@ jobs: if: ${{ github.event_name == 'push' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Cache pip - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ~/.cache/pip key: ${{ runner.os }}-pip diff --git a/scripts/imgtool/keys/general.py b/scripts/imgtool/keys/general.py index fdaab147fc..dfb4e3663f 100644 --- a/scripts/imgtool/keys/general.py +++ b/scripts/imgtool/keys/general.py @@ -17,7 +17,7 @@ def __init__(self, file, *args, **kwargs): self.kwargs = kwargs def __enter__(self): - if isinstance(self.file_in, str | bytes | os.PathLike): + if isinstance(self.file_in, (str, bytes, os.PathLike)): self.file = open(self.file_in, *self.args, **self.kwargs) else: self.file = self.file_in diff --git a/scripts/setup.py b/scripts/setup.py index 02b2666501..3decaaaf23 100644 --- a/scripts/setup.py +++ b/scripts/setup.py @@ -12,7 +12,7 @@ license="Apache Software License", url="http://github.com/mcu-tools/mcuboot", packages=setuptools.find_packages(), - python_requires='>=3.6', + python_requires='>=3.8', install_requires=[ 'cryptography>=40.0.0', 'intelhex>=2.2.1',