From bcecabbe396198056f4b7c13db4a7f4caea52166 Mon Sep 17 00:00:00 2001 From: frack113 <62423083+frack113@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:40:25 +0100 Subject: [PATCH 1/2] Update dependency --- .../.github/workflows/release.yml | 8 ++++---- .../.github/workflows/test.yml | 10 +++++----- {{ cookiecutter.package_name }}/pyproject.toml | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/{{ cookiecutter.package_name }}/.github/workflows/release.yml b/{{ cookiecutter.package_name }}/.github/workflows/release.yml index 071c41d..9316cd1 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/release.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/release.yml @@ -8,15 +8,15 @@ on: jobs: build-and-publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Poetry run: pipx install poetry - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Verify versioning run: | [ "$(poetry version -s)" == "${GITHUB_REF#refs/tags/v}" ] diff --git a/{{ cookiecutter.package_name }}/.github/workflows/test.yml b/{{ cookiecutter.package_name }}/.github/workflows/test.yml index c703506..2debab6 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/test.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/test.yml @@ -10,15 +10,15 @@ jobs: test: strategy: matrix: - os: [ 'ubuntu-20.04' ] - python-version: [ '3.8', '3.9', '3.10', '3.11' ] + os: ["ubuntu-24.04", "windows-2022", "macos-14"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] runs-on: {{ '${{ matrix.os }}' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Poetry run: pipx install poetry - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: {{ '${{ matrix.python-version }}' }} - name: Install dependencies @@ -30,7 +30,7 @@ jobs: run: poetry run python print-coverage.py >> $GITHUB_ENV - name: Create coverage badge if: {{ '${{' }} github.repository == '{{ cookiecutter.github_account }}/{{ cookiecutter.package_name }}' && github.event_name == 'push' && runner.os == 'Linux' }} - uses: schneegans/dynamic-badges-action@v1.1.0 + uses: schneegans/dynamic-badges-action@1.7.0 with: auth: {{ '${{ secrets.GIST_SECRET }}' }} gistID: {{ cookiecutter.coverage_gist }} diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index 0bc7884..b1fce39 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -10,10 +10,10 @@ packages = [ ] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.9" [tool.poetry.dev-dependencies] [build-system] -requires = ["poetry-core>=1.0.0"] +requires = ["poetry-core>=1.8.1"] build-backend = "poetry.core.masonry.api" From 942a5dbe5a4e849612ed5e6767914ffee7b6b58e Mon Sep 17 00:00:00 2001 From: frack113 <62423083+frack113@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:43:27 +0100 Subject: [PATCH 2/2] Update print-coverage.py --- {{ cookiecutter.package_name }}/print-coverage.py | 4 ++-- {{ cookiecutter.package_name }}/pyproject.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.package_name }}/print-coverage.py b/{{ cookiecutter.package_name }}/print-coverage.py index 65667a0..503adfe 100644 --- a/{{ cookiecutter.package_name }}/print-coverage.py +++ b/{{ cookiecutter.package_name }}/print-coverage.py @@ -1,7 +1,7 @@ # Prints code testing coverage as percentage for badge generation. -import xml.etree.ElementTree as et +from defusedxml.ElementTree import parse -tree = et.parse("cov.xml") +tree = parse("cov.xml") root = tree.getroot() coverage = float(root.attrib["line-rate"]) * 100 print(f"COVERAGE={coverage:3.4}%") diff --git a/{{ cookiecutter.package_name }}/pyproject.toml b/{{ cookiecutter.package_name }}/pyproject.toml index b1fce39..a0cae05 100644 --- a/{{ cookiecutter.package_name }}/pyproject.toml +++ b/{{ cookiecutter.package_name }}/pyproject.toml @@ -13,6 +13,7 @@ packages = [ python = "^3.9" [tool.poetry.dev-dependencies] +defusedxml = "^0.7" [build-system] requires = ["poetry-core>=1.8.1"]