From 5cc32aa8da5e0cf7087ea8dce0f64d9bda2ccb6d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 3 Jun 2024 19:45:24 +0200 Subject: [PATCH 1/2] Adjust Python version check. --- changelogs/fragments/167-python.yml | 2 ++ src/antsibull_changelog/cli.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/167-python.yml diff --git a/changelogs/fragments/167-python.yml b/changelogs/fragments/167-python.yml new file mode 100644 index 0000000..fa6e1a9 --- /dev/null +++ b/changelogs/fragments/167-python.yml @@ -0,0 +1,2 @@ +bugfixes: + - "Adjust the Python version check in ``main()`` to test for Python 3.9 instead of 3.6, which is the minimum required Python version since version 0.18.0 (https://github.com/ansible-community/antsibull-changelog/pull/167)." diff --git a/src/antsibull_changelog/cli.py b/src/antsibull_changelog/cli.py index 908bcec..4744538 100644 --- a/src/antsibull_changelog/cli.py +++ b/src/antsibull_changelog/cli.py @@ -869,8 +869,8 @@ def main() -> int: See constants.py for the return codes. """ - if sys.version_info < (3, 6): - print("Needs Python 3.6 or later") + if sys.version_info < (3, 9): + print("Needs Python 3.9 or later") return C.RC_OLD_PYTHON return run(sys.argv) From 0c50c15efc31d79d433cd45c6bb48ad21cd79ab4 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 4 Jun 2024 21:58:11 +0200 Subject: [PATCH 2/2] Remove Python version check. --- changelogs/fragments/167-python.yml | 6 +++++- src/antsibull_changelog/cli.py | 4 ---- src/antsibull_changelog/constants.py | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/changelogs/fragments/167-python.yml b/changelogs/fragments/167-python.yml index fa6e1a9..9671800 100644 --- a/changelogs/fragments/167-python.yml +++ b/changelogs/fragments/167-python.yml @@ -1,2 +1,6 @@ bugfixes: - - "Adjust the Python version check in ``main()`` to test for Python 3.9 instead of 3.6, which is the minimum required Python version since version 0.18.0 (https://github.com/ansible-community/antsibull-changelog/pull/167)." + - "Remove Python version check that was checking for Python >= 3.6 (instead of >= 3.9). + This check is not really necessary since ``pyproject.toml`` declares ``requires-python``, + and old enough Python versions where pip does not know about ``requires-python`` + will not load antsibull-changelog due to syntax errors anyway + (https://github.com/ansible-community/antsibull-changelog/pull/167)." diff --git a/src/antsibull_changelog/cli.py b/src/antsibull_changelog/cli.py index 4744538..bf50030 100644 --- a/src/antsibull_changelog/cli.py +++ b/src/antsibull_changelog/cli.py @@ -869,8 +869,4 @@ def main() -> int: See constants.py for the return codes. """ - if sys.version_info < (3, 9): - print("Needs Python 3.9 or later") - return C.RC_OLD_PYTHON - return run(sys.argv) diff --git a/src/antsibull_changelog/constants.py b/src/antsibull_changelog/constants.py index dd98f6d..69bf387 100644 --- a/src/antsibull_changelog/constants.py +++ b/src/antsibull_changelog/constants.py @@ -12,5 +12,4 @@ RC_UNHANDLED_ERROR = 1 # Unhandled error. See the Traceback for more information. RC_BAD_CLI_ARG = 2 # There was a problem with the command line arguments. RC_INVALID_FRAGMENT = 3 # Found invalid changelog fragments. -RC_OLD_PYTHON = 4 # Needs to be run on a newer version of Python. RC_COMMAND_FAILED = 5 # Problem occurred which prevented the execution of the command.