From e0bb45929624cd0c699370fe824fb80eb2693c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Fri, 9 Jan 2026 11:03:32 +0100 Subject: [PATCH 1/2] Change: Require Python >= 3.10 and support Python 3.13 and 3.14 Python 3.9 support has ended and two new versions have been released already. --- .github/workflows/ci-python.yml | 6 ++++-- poetry.lock | 9 +++++---- pyproject.toml | 9 +++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index 411ccfb..c6b8166 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -12,10 +12,11 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" + - "3.14" uses: greenbone/workflows/.github/workflows/lint-python.yml@main with: lint-packages: "greenbone tests" @@ -27,10 +28,11 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" + - "3.14" uses: greenbone/workflows/.github/workflows/test-python.yml@main with: python-version: ${{ matrix.python-version }} diff --git a/poetry.lock b/poetry.lock index 8c76382..8a86fd8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -320,7 +320,7 @@ description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["dev"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, @@ -474,6 +474,7 @@ description = "Mypyc runtime library" optional = false python-versions = ">=3.9" groups = ["dev"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "librt-0.7.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4836c5645f40fbdc275e5670819bde5ab5f2e882290d304e3c6ddab1576a6d0"}, {file = "librt-0.7.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6ae8aec43117a645a31e5f60e9e3a0797492e747823b9bda6972d521b436b4e8"}, @@ -1067,7 +1068,7 @@ files = [ {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, ] -markers = {main = "python_version < \"3.11\"", dev = "python_full_version <= \"3.11.0a6\""} +markers = {main = "python_version == \"3.10\"", dev = "python_full_version <= \"3.11.0a6\""} [[package]] name = "tomlkit" @@ -1095,5 +1096,5 @@ files = [ [metadata] lock-version = "2.1" -python-versions = "^3.9" -content-hash = "1ec53b00b1d4d4701813ace35ef3b9d6bb58aaf08b92e96d463811fa18e075b2" +python-versions = "^3.10" +content-hash = "4d9976de5d563a2e2708a144bec9faf51ff0e6098ed812a6516cc87151b3818f" diff --git a/pyproject.toml b/pyproject.toml index d3394ea..fd87d8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,10 +11,11 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", # pylint: disable=line-too-long "Environment :: Console", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Topic :: Utilities", ] @@ -26,7 +27,7 @@ packages = [ ] [tool.poetry.dependencies] -python = "^3.9" +python = "^3.10" rich = ">=13.2.0" tomli = { version = ">=2.0.1", python = "<3.11" } shtab = ">=1.6.5" @@ -51,7 +52,7 @@ build-backend = "poetry.core.masonry.api" [tool.black] line-length = 80 -target-version = ['py39', 'py310', 'py311', 'py312'] +target-version = ['py310', 'py311', 'py312', 'py313', 'py314'] exclude = ''' /( \.git @@ -173,7 +174,7 @@ commit_parsers = [ { message = "^[d|D]oc", group = ":books: Documentation" }, { message = "^[t|T]est", group = ":white_check_mark: Testing" }, { message = "^[c|C]hore", group = ":wrench: Miscellaneous" }, - { message = "^[c|C]i", group = "️:wrench: Miscellaneous" }, + { message = "^[c|C]i", group = ":wrench: Miscellaneous" }, { message = "^[m|M]isc", group = ":wrench: Miscellaneous" }, { message = "^[d|D]eps", group = ":ship: Dependencies" }, ] From 05b7ee59567eb0d45ab51b0746a118ab0f472469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Fri, 9 Jan 2026 11:28:53 +0100 Subject: [PATCH 2/2] test: Fix argument parser tests on Python 3.14 In Python 3.14 the way the program name is parsed in the argparser module has changed. See https://github.com/python/cpython/issues/66436 for details. Therefore the tests did break which mock the pre 3.14 parsing of the program name. Fix this behavior by explicitly passing a program name derived from `sys.argv[0]` (which is the default behavior in Python < 3.14). Despite failing tests this had no influence of the tool. Fixes #325 --- greenbone/feed/sync/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/greenbone/feed/sync/parser.py b/greenbone/feed/sync/parser.py index 05a4239..d236a70 100644 --- a/greenbone/feed/sync/parser.py +++ b/greenbone/feed/sync/parser.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # +import sys from argparse import ArgumentParser, Namespace from pathlib import Path from typing import Any, Optional, Sequence @@ -49,7 +50,7 @@ class CliParser: """ def __init__(self) -> None: - parser = ArgumentParser(add_help=False) + parser = ArgumentParser(prog=Path(sys.argv[0]).name, add_help=False) shtab.add_argument_to(parser) parser.add_argument( "--version",