From bd3668f37585c04ccbdf6046061e82df865ea22fed62596158ca5f3de5d04ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 20:05:31 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-argcomplete revision 40acd6a918bd1c8d9f9c42dc2ef28421 --- .gitattributes | 23 +++ argcomplete-3.0.8.tar.gz | 3 + python-argcomplete.changes | 299 +++++++++++++++++++++++++++++++++++++ python-argcomplete.spec | 101 +++++++++++++ trim-test-deps.patch | 13 ++ without_zsh.patch | 27 ++++ 6 files changed, 466 insertions(+) create mode 100644 .gitattributes create mode 100644 argcomplete-3.0.8.tar.gz create mode 100644 python-argcomplete.changes create mode 100644 python-argcomplete.spec create mode 100644 trim-test-deps.patch create mode 100644 without_zsh.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/argcomplete-3.0.8.tar.gz b/argcomplete-3.0.8.tar.gz new file mode 100644 index 0000000..1918894 --- /dev/null +++ b/argcomplete-3.0.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9ca96448e14fa459d7450a4ab5a22bbf9cee4ba7adddf03e65c398b5daeea28 +size 56035 diff --git a/python-argcomplete.changes b/python-argcomplete.changes new file mode 100644 index 0000000..f4f7e07 --- /dev/null +++ b/python-argcomplete.changes @@ -0,0 +1,299 @@ +------------------------------------------------------------------- +Fri May 5 11:23:29 UTC 2023 - Daniel Garcia + +- Add without_zsh.patch +- Delete skip_tcsh_tests.patch +- Delete without_fish.patch +- Update to 3.0.8: + * Test suite shell wrapper: Accept OSError on exit +- 3.0.7: + * Test suite: Use general regex to cut zsh reset ANSI sequences (#425) +- 3.0.6: + * Allow importlib-metadata 6.x; skip test failures on Python 3.7 (#420, #424) + * Note completers can return iterables of strings, not just lists (#422) + * Documentation and test improvements +- 3.0.5: + * Call _default as fallback in zsh global completion hook + * Begin support for mapping-emitting completers +- 3.0.4: + * activate-global-python-argcomplete: do not overwrite existing dotfile in user directory + * Add NOTICE file + * Establish long term name for split_line as argcomplete.lexers.split_line +- 3.0.3: + * Re-add split_line to API (#419) +- 3.0.2: + * Fix zsh default completion issues +- 3.0.1: + * Fix zsh autoload issues +- 3.0.0: + * Fully support zsh. Argcomplete now supports completion + descriptions and global completion in zsh. + * Clean up top level namespace. + * Documentation and test improvements. +- 2.1.2: + * Test infrastructure improvements + * Indicate that there is no support commitment for fish and tcsh shells +- 2.1.1: + * Documentation and test improvements +- 2.1.0: + * Remove scripts for contrib-supported shells from global namespace +- 2.0.6: + * setup.py: exclude test.* subpackages from find_packages (#406) + * Support PowerShell (#405) + * CI updates +- 2.0.5: + * Revert "Support powershell (#392)" + +------------------------------------------------------------------- +Fri Apr 21 12:21:56 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:39:57 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Fri Mar 24 10:47:53 UTC 2023 - Daniel Garcia + +- Remove importlib-metadata requirement, it's not needed for python > 3.7 + +------------------------------------------------------------------- +Thu Mar 16 09:32:50 UTC 2023 - Matej Cepl + +- Add without_fish.patch which makes fish only optional + BuildRequires (gh#kislyuk/argcomplete!410). + +------------------------------------------------------------------- +Tue Jan 31 23:49:21 UTC 2023 - Dirk Müller + +- fix substitution on tests/test.py to test the current python flavor + +------------------------------------------------------------------- +Wed Jul 6 10:04:40 UTC 2022 - Dirk Müller + +- update to 2.0.0: + * Truncate input after cursor. + * Support of path completion in fish + * Drop support for Python 2.7 and 3.5 + * Add support for Python 3.10 + * Test, documentation, and release infrastructure improvements + +------------------------------------------------------------------- +Sun Jun 6 11:43:24 UTC 2021 - Dirk Müller + +- update to 1.12.3: + * Update importlib-metadata version pin + * Display script debug output in tcsh + * Fish support improvements + * Print ``warn()`` message from beginning of line + * Test infrastructure improvements + +------------------------------------------------------------------- +Sun Dec 20 09:17:00 UTC 2020 - Dirk Müller + +- update to 1.12.2: + - Update importlib-metadata dependency pin (#332) + - Add change log project URL (#312) + - Replace Travis CI with GitHub Actions (#323) + - Update importlib-metadata dependency version range + - Bash nounset mode fixes (#313) +- remove 0001-Remove-expected-test-failure-for-new-versions-of-fish.patch (upstream) + +------------------------------------------------------------------- +Wed May 27 13:01:18 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Thu Apr 30 06:05:59 UTC 2020 - Tomáš Chvátal + +- Fix test execution without /usr/bin/python + +------------------------------------------------------------------- +Thu Mar 26 09:44:38 UTC 2020 - Antonio Larrosa + +- Add patch from upstream to fix tests with latest fish version: + * 0001-Remove-expected-test-failure-for-new-versions-of-fish.patch + +------------------------------------------------------------------- +Fri Jan 17 10:42:58 UTC 2020 - Marketa Calabkova + +- update to 1.11.1 + * Add -o bashdefault to register-python-argcomplete’s output command + * Use shell builtins where possible + * Switch from pkg_resources to importlib + * Remove .sh extension by bash-completion convention + * Do not suggest options after – + * Include all test directory contents in source distribution + * Trigger completers on –optional=PARTIAL_VALUE + * Documentation and test improvements + +------------------------------------------------------------------- +Fri Sep 13 12:45:13 UTC 2019 - Tomáš Chvátal + +- Update to 1.10.0: + * fish support +- Refresh patch skip_tcsh_tests.patch + +------------------------------------------------------------------- +Fri Apr 5 11:02:52 UTC 2019 - Tomáš Chvátal + +- Update to 1.9.5: + * check_module: Don’t crash, exit with error instead (#261) + * Register completion for multiple commands (#246) + +------------------------------------------------------------------- +Mon Feb 25 05:52:03 UTC 2019 - John Vandenberg + +- Trim unnecessary build dependencies using trim-test-deps.patch +- Simplify skip_tcsh_tests.patch so it is easier to read and update +- Update to v1.9.4 + * Use the correct interpreter when checking wrappers + * Provide shellcode as a module function (#237) +- from v1.9.3 + * Fix handling of COMP\_POINT + * Fix crash when writing unicode to debug\_stream in Python 2 + +------------------------------------------------------------------- +Tue Dec 4 12:45:38 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Fri Sep 15 13:49:08 UTC 2017 - adrian.glaubitz@suse.com + +- New upstream release + + Version 1.9.2 +- Update patch to skip broken tcsh tests + + skip_tcsh_tests.patch +- Fix issues with singlespec auto-conversion + + Install %{python_sitelib}/bash_completion.d/python-argcomplete.sh + into %{_sysconfdir}/bash_completion.d/ + + Use %python_clone to create both Python 2 and Python 3 versions + of all scripts below /usr/bin and /etc/bash_completion.d + with the %{python_version} suffix; also install the Python 3 + versions without the suffix + +------------------------------------------------------------------- +Thu Aug 24 13:32:49 UTC 2017 - jmatejek@suse.com + +- singlespec auto-conversion + +------------------------------------------------------------------- +Thu Jul 20 09:48:53 UTC 2017 - sebix+novell.com@sebix.at + +- update to 1.8.2 +- add patch skip_tcsh_tests.patch to skip broken tcsh tests + +------------------------------------------------------------------- +Tue Nov 02 20:50:53 UTC 2016 - achim.herwig@wodca.de + +- ported back from python3 package including + introduced update-alternatives to coexist with corresponding python3 package + +------------------------------------------------------------------- +Sat Dec 12 17:49:43 UTC 2015 - mimi.vx@gmail.com + +- update to 1.0.0 +* Don't print args with suppressed help by default; add + argcomplete.autocomplete(print_suppressed=True) to control this behavior +* Fix always_complete_options=False support. +* Correct doc filename in setup.cfg +* Make context managers exception-safe. +* Fix issue with non-string choices for arguments. +* Improve non-ascii argparse argument support on Python 2.7. + +------------------------------------------------------------------- +Sun Apr 19 16:08:50 UTC 2015 - benoit.monin@gmx.fr + +- update to 0.8.7: + * register-python-argcomplete: add option to avoid default + readline completion. Thanks to @drmalex07 (pull request #99). +- additional changes from 0.8.6: + * Expand tilde in script name, allowing argcomplete to work + when invoking scripts from one's home directory. Thanks to + @VorpalBlade (Issue 104). +- additional changes from 0.8.5: + * Fix issues related to using argcomplete in a REPL + environement. + * New helper method for custom completion display. + * Expand test suite; formatting cleanup. +- additional changes from 0.8.4: + * Fix issue related to using argcomplete in a REPL + environement. Thanks to @wapiflapi (pull request #91). +- additional changes from 0.8.3: + * Fix multiple issues related to using argcomplete in a REPL + environement. Thanks to @wapiflapi (pull request #90). +- additional changes from 0.8.2: + * Don't strip colon prefix in completion results if + COMP_WORDBREAKS does not contain a colon. Thanks to @berezv + (pull request #88). +- additional changes from 0.8.1: + * Use complete --nospace to avoid issues with directory + completion. +- additional changes from 0.8.0: + * Refactor main body of code into a class to enable + subclassing and overriding of functionality (Issue #78). +- additional changes from 0.7.1: + * New keyword option "argcomplete.autocomplete(validator=...)" + to supply a custom validator or bypass default validation. + Thanks to @thijsdezoete (Issue #77). + * Document debug options. +- additional changes from 0.7.0: + * New keyword option "argcomplete.autocomplete(exclude=[...])" + to suppress options (Issue #74). + * More speedups to code path for global completion hook negative + result. +- additional changes from 0.6.9: + * Fix handling of development mode script wrappers. Thanks to + @jmlopez-rod and @dcosson (Issue #69). + * Speed up code path for global completion hook negative + result by loading pkg_resources on demand. +- additional changes from 0.6.8: + * Begin tracking changes in changelog. + * Add completion support for PBR installed scripts (PR #71). + * Detect easy-install shims with shebang lines that contain + Py instead of py (Issue #69). + +------------------------------------------------------------------- +Fri Jan 17 15:50:53 UTC 2014 - speilicke@suse.com + +- Update to version 0.6.7: + + Upstream provides no changelog +- Don't install testsuite globally + +------------------------------------------------------------------- +Mon Nov 18 11:18:02 UTC 2013 - speilicke@suse.com + +- Update to version 0.6.3: + + No changelog + +------------------------------------------------------------------- +Thu Oct 24 10:58:50 UTC 2013 - speilicke@suse.com + +- Require python-setuptools instead of distribute (upstreams merged) + +------------------------------------------------------------------- +Thu May 2 14:04:51 UTC 2013 - speilicke@suse.com + +- Fix SLE builds +- Add LICENSE.rst and README.rst +- Run testsuite + +------------------------------------------------------------------- +Mon Apr 29 11:10:08 UTC 2013 - darin@darins.net + +- fixed license, set noarch for build + +------------------------------------------------------------------- +Fri Apr 26 20:49:09 UTC 2013 - darin@darins.net + +- add files in _bindir +- add python-distribute + +------------------------------------------------------------------- +Fri Apr 26 20:44:08 UTC 2013 - darin@darins.net + +- Initial packaging diff --git a/python-argcomplete.spec b/python-argcomplete.spec new file mode 100644 index 0000000..035cd12 --- /dev/null +++ b/python-argcomplete.spec @@ -0,0 +1,101 @@ +# +# spec file for package python-argcomplete +# +# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2013 Darin Perusich. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global skip_python2 1 +%{?sle15_python_module_pythons} +Name: python-argcomplete +Version: 3.0.8 +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 +Patch1: trim-test-deps.patch +# Don't fail the test suite when zsh is not available +Patch2: without_zsh.patch +BuildRequires: %{python_module coverage} +BuildRequires: %{python_module pexpect} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: ca-certificates +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun):update-alternatives +BuildArch: noarch +%python_subpackages + +%description +Argcomplete provides easy, extensible command line tab completion of +arguments for your Python script. + +It makes two assumptions: + +* You're using bash as your shell +* You're using argparse to manage your command line arguments/options + +Argcomplete is particularly useful if your program has lots of options +or subparsers, and if your program can dynamically suggest completions +for your argument/option values (for example, if the user is browsing +resources over the network). + +%prep +%autosetup -p1 -n argcomplete-%{version} + +%build +%python_build + +%install +%python_install +%python_clone -a %{buildroot}%{_bindir}/register-python-argcomplete +%python_clone -a %{buildroot}%{_bindir}/python-argcomplete-check-easy-install-script +rm -rf %{buildroot}%{python_sitelib}/test +rm %{buildroot}%{_bindir}/activate-global-python-argcomplete +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export LANG=en_US.UTF-8 +%{python_expand \ + # https://github.com/kislyuk/argcomplete/issues/255 + # https://github.com/kislyuk/argcomplete/issues/256 + # https://github.com/kislyuk/argcomplete/issues/299 + sed -i -e "1s|#!.*python.*|#!%{_bindir}/$python|" test/prog scripts/* + sed -i -e "s|python3 |$python |g" test/test.py + PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m coverage run --source=argcomplete --omit=argcomplete/packages/_shlex.py ./test/test.py -v +} + +%post +%python_install_alternative register-python-argcomplete +%python_install_alternative python-argcomplete-check-easy-install-script + +%postun +%python_uninstall_alternative register-python-argcomplete +%python_uninstall_alternative python-argcomplete-check-easy-install-script + +%files %{python_files} +%doc README.rst +%license LICENSE.rst +%{python_sitelib}/argcomplete-%{version}*-info +%{python_sitelib}/argcomplete +%python_alternative %{_bindir}/python-argcomplete-check-easy-install-script +%python_alternative %{_bindir}/register-python-argcomplete + +%changelog diff --git a/trim-test-deps.patch b/trim-test-deps.patch new file mode 100644 index 0000000..ff01026 --- /dev/null +++ b/trim-test-deps.patch @@ -0,0 +1,13 @@ +Index: argcomplete-3.0.8/setup.py +=================================================================== +--- argcomplete-3.0.8.orig/setup.py ++++ argcomplete-3.0.8/setup.py +@@ -5,7 +5,7 @@ import glob + from setuptools import find_packages, setup + + install_requires = [] +-tests_require = ["coverage", "pexpect", "wheel", "ruff", "mypy"] ++tests_require = ["pexpect"] + importlib_backport_requires = ["importlib-metadata >= 0.23, < 7"] + + setup( diff --git a/without_zsh.patch b/without_zsh.patch new file mode 100644 index 0000000..bab1836 --- /dev/null +++ b/without_zsh.patch @@ -0,0 +1,27 @@ +Index: argcomplete-3.0.8/test/test.py +=================================================================== +--- argcomplete-3.0.8.orig/test/test.py ++++ argcomplete-3.0.8/test/test.py +@@ -1299,22 +1299,6 @@ class TestBash(TestBashZshBase, unittest + self.test_simple_completion() + + +-class TestZsh(TestBashZshBase, unittest.TestCase): +- expected_failures = [ +- "test_parse_special_characters_dollar", +- "test_comp_point", # FIXME +- "test_completion_environment", # FIXME +- "test_continuation", # FIXME +- "test_wordbreak_chars", # FIXME +- ] +- +- def test_parse_special_characters(self): +- pass # FIXME: test crashes in teardown +- +- def repl_provider(self): +- return zsh_repl() +- +- + @unittest.skipIf(BASH_MAJOR_VERSION < 4, "complete -D not supported") + class TestBashGlobal(TestBash): + install_cmd = 'eval "$(activate-global-python-argcomplete --dest=-)"'