Sync from SUSE:SLFO:Main python-argcomplete revision b70c3273c688df579addfd5ddd5b696c

This commit is contained in:
2025-03-28 16:35:06 +01:00
parent 6841d888a4
commit 38584c6cf3
6 changed files with 54 additions and 35 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

BIN
argcomplete-3.4.0.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
argcomplete-3.5.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,22 +0,0 @@
From 480d112ba488fa6825db877201577270053dacce Mon Sep 17 00:00:00 2001
From: Eggry Ran <eggry@live.cn>
Date: Sun, 6 Oct 2024 16:16:49 +0800
Subject: [PATCH] Fix issue #507
---
argcomplete/packages/_argparse.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/argcomplete/packages/_argparse.py b/argcomplete/packages/_argparse.py
index 2a064f9..d10cf01 100644
--- a/argcomplete/packages/_argparse.py
+++ b/argcomplete/packages/_argparse.py
@@ -162,6 +162,8 @@ def take_action(action, argument_strings, option_string=None):
def consume_optional(start_index):
# get the optional identified at this index
option_tuple = option_string_indices[start_index]
+ if isinstance(option_tuple, list): # Python 3.12.7+
+ option_tuple = option_tuple[0]
if len(option_tuple) == 3:
action, option_string, explicit_arg = option_tuple
else: # Python 3.11.9+, 3.12.3+, 3.13+

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Tue Dec 10 11:12:48 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Update to version 3.5.2
* Fix _parse_known_args monkeypatching. This fix is required to restore
compatibility with Python 3.12.8 and 3.13.1.
-------------------------------------------------------------------
Tue Oct 29 17:07:05 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Update to the version 3.5.1:
- Restore compatibility with argparse in Python 3.12.7+
- Use project.scripts instead of setuptools scripts
- Test infrastructure improvements
- Remove upstreamed patches:
- argparse-3_12_7.patch
- Add _multibuild (to make testing against fully installed package)
-------------------------------------------------------------------
Sun Oct 6 21:27:22 UTC 2024 - Matej Cepl <mcepl@cepl.eu>

View File

@@ -18,27 +18,36 @@
%{?sle15_python_module_pythons}
Name: python-argcomplete
Version: 3.4.0
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-argcomplete%{psuffix}
Version: 3.5.2
Release: 0
Summary: Bash tab completion for argparse
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/kislyuk/argcomplete
Source: https://files.pythonhosted.org/packages/source/a/argcomplete/argcomplete-%{version}.tar.gz
# PATCH-FIX-OPENSUSE argparse-3_12_7.patch gh#kislyuk/argcomplete#507 mcepl@suse.com
# fix the incompatibility with Python 3.12.7+
Patch0: argparse-3_12_7.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 67.2}
BuildRequires: %{python_module setuptools_scm >= 6.2}
BuildRequires: %{python_module wheel}
BuildRequires: ca-certificates-mozilla
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module argcomplete == %{version}}
BuildRequires: %{python_module pexpect}
BuildRequires: ca-certificates-mozilla
BuildRequires: fish
BuildRequires: zsh
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
@@ -62,31 +71,40 @@ resources over the network).
%autosetup -p1 -n argcomplete-%{version}
%build
%if %{without test}
%pyproject_wheel
%endif
%install
%if %{without test}
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/activate-global-python-argcomplete
%python_clone -a %{buildroot}%{_bindir}/register-python-argcomplete
%python_clone -a %{buildroot}%{_bindir}/python-argcomplete-check-easy-install-script
rm %{buildroot}%{_bindir}/activate-global-python-argcomplete
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
export LANG=en_US.UTF-8
export TERM=xterm-mono
%{python_expand \
# https://github.com/kislyuk/argcomplete/issues/255
# https://github.com/kislyuk/argcomplete/issues/299
sed -i -e "1s|#!.*python.*|#!%{__$python}|" test/prog test/*.py scripts/*
sed -i -e "1s|#!.*python.*|#!%{__$python}|" test/prog test/*.py
sed -i -e "s|python3 |$python |g" test/test.py
PYTHONPATH=%{buildroot}%{$python_sitelib} $python ./test/test.py -v
$python ./test/test.py -v
}
%endif
%if %{without test}
%post
%python_install_alternative activate-global-python-argcomplete
%python_install_alternative register-python-argcomplete
%python_install_alternative python-argcomplete-check-easy-install-script
%postun
%python_uninstall_alternative activate-global-python-argcomplete
%python_uninstall_alternative register-python-argcomplete
%python_uninstall_alternative python-argcomplete-check-easy-install-script
@@ -95,7 +113,9 @@ export TERM=xterm-mono
%license LICENSE.rst
%{python_sitelib}/argcomplete-%{version}.dist-info
%{python_sitelib}/argcomplete
%python_alternative %{_bindir}/activate-global-python-argcomplete
%python_alternative %{_bindir}/python-argcomplete-check-easy-install-script
%python_alternative %{_bindir}/register-python-argcomplete
%endif
%changelog