Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-awx-cli for openSUSE:Factory checked in at 2026-11-03 17:58:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-awx-cli (Old) and /work/SRC/openSUSE:Factory/.python-awx-cli.new.1257 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-awx-cli" Tue Nov 3 17:58:53 2026 rev:7 rq:1394623 version:24.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-awx-cli/python-awx-cli.changes 2024-07-04 16:26:22.210294180 +0200 +++ /work/SRC/openSUSE:Factory/.python-awx-cli.new.1257/python-awx-cli.changes 2026-11-03 18:02:27.124688068 +0100 @@ -1,0 +2,12 @@ +Tue Oct 13 21:14:35 UTC 2026 - Harshvardhan Sharma <[email protected]> + +- Add awxkit-drop-distutils-pkg_resources.patch from upstream + (gh#ansible/awx#15441, gh#ansible/awx#16208): the awx CLI failed + to start on Python 3.12+ (no distutils) and with setuptools that + no longer ships pkg_resources +- Add awxkit-argparse-python313.patch from upstream + (gh#ansible/awx#15692): every awx command failed with a TypeError + in HelpfulArgumentParser on Python 3.12.8+ / 3.13.1+ +- Add Requires: python-packaging and an import check + +------------------------------------------------------------------- New: ---- awxkit-argparse-python313.patch awxkit-drop-distutils-pkg_resources.patch ----------(New B)---------- New: no longer ships pkg_resources - Add awxkit-argparse-python313.patch from upstream (gh#ansible/awx#15692): every awx command failed with a TypeError New: - Add awxkit-drop-distutils-pkg_resources.patch from upstream (gh#ansible/awx#15441, gh#ansible/awx#16208): the awx CLI failed ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-awx-cli.spec ++++++ --- /var/tmp/diff_new_pack.V9Y09p/_old 2026-11-03 18:02:33.681970395 +0100 +++ /var/tmp/diff_new_pack.V9Y09p/_new 2026-11-03 18:02:33.687970646 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-awx-cli # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,18 +25,24 @@ URL: https://github.com/ansible/awx/tree/devel/awxkit Source: awx-%{version}.tar.gz Source1: LICENSE.md +# PATCH-FIX-UPSTREAM awxkit-drop-distutils-pkg_resources.patch gh#ansible/awx#15441 gh#ansible/awx#16208 +Patch0: awxkit-drop-distutils-pkg_resources.patch +# PATCH-FIX-UPSTREAM awxkit-argparse-python313.patch gh#ansible/awx#15692 +Patch1: awxkit-argparse-python313.patch BuildRequires: %{python_module base} BuildRequires: %{python_module pip} BuildRequires: %{python_module wheel} # SECTION -BuildRequires: %{python_module pytest} +BuildRequires: %{python_module packaging} BuildRequires: %{python_module PyYAML} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} BuildRequires: %{python_module websocket-client} # SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-PyYAML +Requires: python-packaging Requires: python-requests Requires(post): update-alternatives Requires(postun): update-alternatives @@ -48,7 +54,7 @@ CLI to manage the AWX Ansible web platform %prep -%autosetup -n awx-%{version} +%autosetup -p1 -n awx-%{version} cp %{SOURCE1} . echo %{version} > VERSION @@ -61,6 +67,10 @@ %python_clone -a %{buildroot}%{_bindir}/awx %python_expand %fdupes %{buildroot}%{$python_sitelib} +%check +# the CLI must start: no distutils / pkg_resources, argparse on python >= 3.12.8 +%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -c 'import awxkit.awx, awxkit.cli.options; from awxkit.cli import run; run(argv=["awx", "--version"])' + %post %python_install_alternative akit %python_install_alternative awx ++++++ awxkit-argparse-python313.patch ++++++ cli: fix TypeError in HelpfulArgumentParser for python 3.12.8 and 3.13.1 Backport of upstream ansible/awx commit 3eb809696aaf: drop the _parse_known_args() override, whose private argparse signature changed. Upstream: https://github.com/ansible/awx/pull/15692 --- diff --git a/awxkit/cli/utils.py b/awxkit/cli/utils.py index 61c2fe8f5e9e..9e6b5d38ff0f 100644 --- a/awxkit/cli/utils.py +++ b/awxkit/cli/utils.py @@ -40,14 +40,6 @@ def error(self, message): # pragma: nocover self._print_message('\n') self.exit(2, '%s: %s\n' % (self.prog, message)) - def _parse_known_args(self, args, ns): - for arg in ('-h', '--help'): - # the -h argument is extraneous; if you leave it off, - # awx-cli will just print usage info - if arg in args: - args.remove(arg) - return super(HelpfulArgumentParser, self)._parse_known_args(args, ns) - def color_enabled(): return _color.enabled ++++++ awxkit-drop-distutils-pkg_resources.patch ++++++ Drop distutils and pkg_resources (Python 3.12+, setuptools without pkg_resources) Backport of upstream ansible/awx commits, limited to awxkit runtime code: - e68370f2aa2d "Replace `pkg_resources` with `importlib.metadata`" (#15441) - de86b93690bd "AAP-59874: Update to Python 3.12" (#16208): strtobool and LooseVersion replacements Upstream: https://github.com/ansible/awx/pull/15441 Upstream: https://github.com/ansible/awx/pull/16208 --- diff --git a/awxkit/cli/client.py b/awxkit/cli/client.py index 46dc4fa3330d..de790e184e78 100755 --- a/awxkit/cli/client.py +++ b/awxkit/cli/client.py @@ -2,8 +2,8 @@ import logging import os -import pkg_resources import sys +from importlib.metadata import version as _get_version from requests.exceptions import RequestException @@ -16,7 +16,7 @@ from awxkit.awx.utils import uses_sessions # noqa -__version__ = pkg_resources.get_distribution('awxkit').version +__version__ = _get_version('awxkit') class CLI(object): diff --git a/awxkit/awx/__init__.py b/awxkit/awx/__init__.py index 16fb42da3891..02350adf8810 100644 --- a/awxkit/awx/__init__.py +++ b/awxkit/awx/__init__.py @@ -1,5 +1,15 @@ -from distutils.version import LooseVersion +from packaging.version import Version def version_cmp(x, y): - return LooseVersion(x)._cmp(y) + """Compare two version strings. + Returns -1 if x < y, 0 if x == y, 1 if x > y + """ + vx = Version(x) + vy = Version(y) + if vx < vy: + return -1 + elif vx > vy: + return 1 + else: + return 0 diff --git a/awxkit/cli/format.py b/awxkit/cli/format.py index f294a9e04565..5e81e3295c57 100644 --- a/awxkit/cli/format.py +++ b/awxkit/cli/format.py @@ -1,13 +1,29 @@ import locale import json -from distutils.util import strtobool - import yaml from awxkit.cli.utils import colored from awxkit import config +def strtobool(val): + """Convert a string representation of truth to true (1) or false (0). + + True values are 'y', 'yes', 't', 'true', 'on', and '1'. + False values are 'n', 'no', 'f', 'false', 'off', and '0'. + Raises ValueError if 'val' is anything else. + + This replaces the deprecated distutils.util.strtobool removed in Python 3.12. + """ + val = val.lower() + if val in ('y', 'yes', 't', 'true', 'on', '1'): + return 1 + elif val in ('n', 'no', 'f', 'false', 'off', '0'): + return 0 + else: + raise ValueError(f"invalid truth value {val!r}") + + def get_config_credentials(): """Load username and password from config.credentials.default. diff --git a/awxkit/cli/options.py b/awxkit/cli/options.py index ecedf3918d23..a6dcbe9dedca 100644 --- a/awxkit/cli/options.py +++ b/awxkit/cli/options.py @@ -6,10 +6,8 @@ import sys import yaml -from distutils.util import strtobool - from .custom import CustomAction -from .format import add_output_formatting_arguments +from .format import add_output_formatting_arguments, strtobool from .resource import DEPRECATED_RESOURCES_REVERSE
