Hello community,
here is the log from the commit of package python-argcomplete for openSUSE:Factory checked in at 2019-04-08 20:52:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-argcomplete (Old)
and /work/SRC/openSUSE:Factory/.python-argcomplete.new.3908 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-argcomplete"
Mon Apr 8 20:52:57 2019 rev:11 rq:691783 version:1.9.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-argcomplete/python-argcomplete.changes 2019-02-25 17:57:30.582282336 +0100
+++ /work/SRC/openSUSE:Factory/.python-argcomplete.new.3908/python-argcomplete.changes 2019-04-08 20:53:00.294544963 +0200
@@ -1,0 +2,7 @@
+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)
+
+-------------------------------------------------------------------
Old:
----
argcomplete-1.9.4.tar.gz
New:
----
argcomplete-1.9.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-argcomplete.spec ++++++
--- /var/tmp/diff_new_pack.AnJIyr/_old 2019-04-08 20:53:00.966545456 +0200
+++ /var/tmp/diff_new_pack.AnJIyr/_new 2019-04-08 20:53:00.974545462 +0200
@@ -17,23 +17,21 @@
#
-%{!?license: %global license %doc}
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-argcomplete
-Version: 1.9.4
+Version: 1.9.5
Release: 0
Summary: Bash tab completion for argparse
License: Apache-2.0
Group: Development/Languages/Python
-Url: https://github.com/kislyuk/argcomplete
+URL: https://github.com/kislyuk/argcomplete
Source: https://files.pythonhosted.org/packages/source/a/argcomplete/argcomplete-%{version}.tar.gz
Patch0: skip_tcsh_tests.patch
Patch1: trim-test-deps.patch
+BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module setuptools}
+BuildRequires: fdupes
BuildRequires: python-rpm-macros
-# SECTION tests
-BuildRequires: %{python_module pexpect}
-# END SECTIONS tests
BuildArch: noarch
%python_subpackages
@@ -63,10 +61,8 @@
%python_install
rm -rf %{buildroot}%{python_sitelib}/test
rm %{buildroot}%{_bindir}/activate-global-python-argcomplete
-%python_clone %{buildroot}%{_bindir}/python-argcomplete-check-easy-install-script
-%python_clone %{buildroot}%{_bindir}/register-python-argcomplete
-install -DTm644 %{buildroot}%{python_sitelib}/argcomplete/bash_completion.d/python-argcomplete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/python-argcomplete.sh
-%python_clone %{buildroot}%{_sysconfdir}/bash_completion.d/python-argcomplete.sh
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+install -DTm644 %{buildroot}%{python_sitelib}/argcomplete/bash_completion.d/python-argcomplete.sh %{buildroot}%{_datadir}/bash-completion/completions/python-argcomplete.sh
# tcsh support is broken
rm %{buildroot}%{_bindir}/python-argcomplete-tcsh
@@ -81,9 +77,6 @@
%{python_sitelib}/argcomplete
%python3_only %{_bindir}/python-argcomplete-check-easy-install-script
%python3_only %{_bindir}/register-python-argcomplete
-%python3_only %{_sysconfdir}/bash_completion.d/python-argcomplete.sh
-%{_bindir}/python-argcomplete-check-easy-install-script-%{python_version}
-%{_bindir}/register-python-argcomplete-%{python_version}
-%{_sysconfdir}/bash_completion.d/python-argcomplete.sh-%{python_version}
+%python3_only %{_datadir}/bash-completion/completions/python-argcomplete.sh
%changelog
++++++ argcomplete-1.9.4.tar.gz -> argcomplete-1.9.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/Changes.rst new/argcomplete-1.9.5/Changes.rst
--- old/argcomplete-1.9.4/Changes.rst 2018-02-13 16:40:50.000000000 +0100
+++ new/argcomplete-1.9.5/Changes.rst 2019-04-02 15:58:44.000000000 +0200
@@ -1,3 +1,10 @@
+Changes for v1.9.5 (2019-04-02)
+===============================
+
+- check_module: Don’t crash, exit with error instead (#261)
+
+- Register completion for multiple commands (#246)
+
Changes for v1.9.4 (2018-02-13)
===============================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/PKG-INFO new/argcomplete-1.9.5/PKG-INFO
--- old/argcomplete-1.9.4/PKG-INFO 2018-02-13 16:41:04.000000000 +0100
+++ new/argcomplete-1.9.5/PKG-INFO 2019-04-02 15:59:05.000000000 +0200
@@ -1,12 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: argcomplete
-Version: 1.9.4
+Version: 1.9.5
Summary: Bash tab completion for argparse
Home-page: https://github.com/kislyuk/argcomplete
Author: Andrey Kislyuk
Author-email: kislyuk@gmail.com
License: Apache Software License
-Description-Content-Type: UNKNOWN
Description: argcomplete - Bash tab completion for argparse
==============================================
*Tab complete all the things!*
@@ -16,7 +15,7 @@
It makes two assumptions:
* You're using bash as your shell (limited support for zsh and tcsh is available)
- * You're using `argparse http://docs.python.org/2.7/library/argparse.html`_ to manage your command line arguments/options
+ * You're using `argparse http://docs.python.org/3/library/argparse.html`_ 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
@@ -172,8 +171,8 @@
command line. For example, you can use the readline-style completer provided by IPython_ to get introspective
completions like you would get in the IPython shell:
- .. _readline: http://docs.python.org/2/library/readline.html
- .. _rlcompleter: http://docs.python.org/2/library/rlcompleter.html#completer-objects
+ .. _readline: http://docs.python.org/3/library/readline.html
+ .. _rlcompleter: http://docs.python.org/3/library/rlcompleter.html#completer-objects
.. _IPython: http://ipython.org/
.. code-block:: python
@@ -259,6 +258,17 @@
.. _`see on GitHub`: https://github.com/kislyuk/argcomplete/blob/master/argcomplete/bash_completi...
+ Zsh Support
+ ------------
+ To activate completions for zsh you need to have ``bashcompinit`` enabled in zsh::
+
+ autoload -U bashcompinit
+ bashcompinit
+
+ Afterwards you can enable completion for your scripts with ``register-python-argcomplete``::
+
+ eval "$(register-python-argcomplete my-awesome-script)"
+
Tcsh Support
------------
To activate completions for tcsh use::
@@ -346,3 +356,4 @@
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Shells
Classifier: Topic :: Terminals
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/README.rst new/argcomplete-1.9.5/README.rst
--- old/argcomplete-1.9.4/README.rst 2018-01-15 01:59:16.000000000 +0100
+++ new/argcomplete-1.9.5/README.rst 2019-04-02 15:57:32.000000000 +0200
@@ -7,7 +7,7 @@
It makes two assumptions:
* You're using bash as your shell (limited support for zsh and tcsh is available)
-* You're using `argparse http://docs.python.org/2.7/library/argparse.html`_ to manage your command line arguments/options
+* You're using `argparse http://docs.python.org/3/library/argparse.html`_ 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
@@ -163,8 +163,8 @@
command line. For example, you can use the readline-style completer provided by IPython_ to get introspective
completions like you would get in the IPython shell:
-.. _readline: http://docs.python.org/2/library/readline.html
-.. _rlcompleter: http://docs.python.org/2/library/rlcompleter.html#completer-objects
+.. _readline: http://docs.python.org/3/library/readline.html
+.. _rlcompleter: http://docs.python.org/3/library/rlcompleter.html#completer-objects
.. _IPython: http://ipython.org/
.. code-block:: python
@@ -250,6 +250,17 @@
.. _`see on GitHub`: https://github.com/kislyuk/argcomplete/blob/master/argcomplete/bash_completi...
+Zsh Support
+------------
+To activate completions for zsh you need to have ``bashcompinit`` enabled in zsh::
+
+ autoload -U bashcompinit
+ bashcompinit
+
+Afterwards you can enable completion for your scripts with ``register-python-argcomplete``::
+
+ eval "$(register-python-argcomplete my-awesome-script)"
+
Tcsh Support
------------
To activate completions for tcsh use::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/argcomplete/__init__.py new/argcomplete-1.9.5/argcomplete/__init__.py
--- old/argcomplete-1.9.4/argcomplete/__init__.py 2017-11-21 17:06:21.000000000 +0100
+++ new/argcomplete-1.9.5/argcomplete/__init__.py 2018-02-13 16:43:58.000000000 +0100
@@ -8,7 +8,7 @@
from .compat import USING_PYTHON2, str, sys_encoding, ensure_str, ensure_bytes
from .completers import FilesCompleter, SuppressCompleter
from .my_argparse import IntrospectiveArgumentParser, action_is_satisfied, action_is_open, action_is_greedy
-from .shellintegration import shellcode # noqa
+from .shellintegration import shellcode
_DEBUG = "_ARC_DEBUG" in os.environ
@@ -100,7 +100,9 @@
if lexer.instream.tell() >= point:
return split_word(lexer.token)
else:
- raise ArgcompleteException("Unexpected internal state. Please report this bug at https://github.com/kislyuk/argcomplete/issues.") # noqa
+ msg = ("Unexpected internal state. "
+ "Please report this bug at https://github.com/kislyuk/argcomplete/issues.")
+ raise ArgcompleteException(msg)
def default_validator(completion, prefix):
return completion.startswith(prefix)
@@ -343,7 +345,8 @@
def _get_option_completions(self, parser, cword_prefix):
self._display_completions.update(
- [[" ".join(ensure_str(x) for x in action.option_strings if ensure_str(x).startswith(cword_prefix)), action.help] # noqa
+ [[" ".join(ensure_str(x) for x in action.option_strings
+ if ensure_str(x).startswith(cword_prefix)), action.help]
for action in parser._actions
if action.option_strings])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/argcomplete/_check_module.py new/argcomplete-1.9.5/argcomplete/_check_module.py
--- old/argcomplete-1.9.4/argcomplete/_check_module.py 2017-03-15 23:47:27.000000000 +0100
+++ new/argcomplete-1.9.5/argcomplete/_check_module.py 2019-04-02 15:57:32.000000000 +0200
@@ -12,7 +12,10 @@
def find_spec(name):
"""Minimal implementation as required by `find`."""
- f, path, _ = find_module(name)
+ try:
+ f, path, _ = find_module(name)
+ except ImportError:
+ return None
has_location = path is not None
if f is None:
return ModuleSpec(None, has_location, [path])
@@ -20,17 +23,25 @@
return ModuleSpec(path, has_location, None)
+class ArgcompleteMarkerNotFound(RuntimeError):
+ pass
+
+
def find(name):
names = name.split('.')
spec = find_spec(names[0])
+ if spec is None:
+ raise ArgcompleteMarkerNotFound(
+ 'no module named "{}"'.format(names[0]))
if not spec.has_location:
- raise Exception('cannot locate file')
+ raise ArgcompleteMarkerNotFound('cannot locate file')
if spec.submodule_search_locations is None:
if len(names) != 1:
- raise Exception('{} is not a package'.format(names[0]))
+ raise ArgcompleteMarkerNotFound(
+ '{} is not a package'.format(names[0]))
return spec.origin
if len(spec.submodule_search_locations) != 1:
- raise Exception('expecting one search location')
+ raise ArgcompleteMarkerNotFound('expecting one search location')
path = os.path.join(spec.submodule_search_locations[0], *names[1:])
if os.path.isdir(path):
return os.path.join(path, '__main__.py')
@@ -42,8 +53,11 @@
with open(find(sys.argv[1])) as f:
head = f.read(1024)
if 'PYTHON_ARGCOMPLETE_OK' not in head:
- raise Exception('marker not found')
+ raise ArgcompleteMarkerNotFound('marker not found')
if __name__ == '__main__':
- main()
+ try:
+ main()
+ except ArgcompleteMarkerNotFound as e:
+ sys.exit(e)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/argcomplete/shellintegration.py new/argcomplete-1.9.5/argcomplete/shellintegration.py
--- old/argcomplete-1.9.4/argcomplete/shellintegration.py 2017-11-21 17:06:21.000000000 +0100
+++ new/argcomplete-1.9.5/argcomplete/shellintegration.py 2019-01-11 18:35:14.000000000 +0100
@@ -1,5 +1,10 @@
#!/usr/bin/env python
+try:
+ from shlex import quote
+except ImportError:
+ from pipes import quote
+
bashcode = r'''
# Run something, muting output or redirecting it to the debug stream
# depending on the value of _ARC_DEBUG.
@@ -31,18 +36,18 @@
compopt -o nospace
fi
}
-complete %(complete_opts)s -F _python_argcomplete "%(executable)s"
+complete %(complete_opts)s -F _python_argcomplete %(executables)s
'''
tcshcode = '''\
-complete "%(executable)s" 'p@*@`python-argcomplete-tcsh "%(executable)s"`@'
+complete "%(executable)s" 'p@*@`python-argcomplete-tcsh "%(executable)s"`@' ;
'''
-def shellcode(executable, use_defaults=True, shell='bash', complete_arguments=None):
+def shellcode(executables, use_defaults=True, shell='bash', complete_arguments=None):
'''
Provide the shell code required to register a python executable for use with the argcomplete module.
- :param str executable: Executable to be completed (when invoked exactly with this name
+ :param str executables: Executables to be completed (when invoked exactly with this name
:param bool use_defaults: Whether to fallback to readline's default completion when no matches are generated.
:param str shell: Name of the shell to output code for (bash or tcsh)
:param complete_arguments: Arguments to call complete with
@@ -55,8 +60,12 @@
complete_options = " ".join(complete_arguments)
if shell == 'bash':
- code = bashcode
+ quoted_executables = [quote(i) for i in executables]
+ executables_list = " ".join(quoted_executables)
+ code = bashcode % dict(complete_opts=complete_options, executables=executables_list)
else:
- code = tcshcode
+ code = ""
+ for executable in executables:
+ code += tcshcode % dict(executable=executable)
- return code % dict(complete_opts=complete_options, executable=executable)
+ return code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/argcomplete.egg-info/PKG-INFO new/argcomplete-1.9.5/argcomplete.egg-info/PKG-INFO
--- old/argcomplete-1.9.4/argcomplete.egg-info/PKG-INFO 2018-02-13 16:41:04.000000000 +0100
+++ new/argcomplete-1.9.5/argcomplete.egg-info/PKG-INFO 2019-04-02 15:59:05.000000000 +0200
@@ -1,12 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: argcomplete
-Version: 1.9.4
+Version: 1.9.5
Summary: Bash tab completion for argparse
Home-page: https://github.com/kislyuk/argcomplete
Author: Andrey Kislyuk
Author-email: kislyuk@gmail.com
License: Apache Software License
-Description-Content-Type: UNKNOWN
Description: argcomplete - Bash tab completion for argparse
==============================================
*Tab complete all the things!*
@@ -16,7 +15,7 @@
It makes two assumptions:
* You're using bash as your shell (limited support for zsh and tcsh is available)
- * You're using `argparse http://docs.python.org/2.7/library/argparse.html`_ to manage your command line arguments/options
+ * You're using `argparse http://docs.python.org/3/library/argparse.html`_ 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
@@ -172,8 +171,8 @@
command line. For example, you can use the readline-style completer provided by IPython_ to get introspective
completions like you would get in the IPython shell:
- .. _readline: http://docs.python.org/2/library/readline.html
- .. _rlcompleter: http://docs.python.org/2/library/rlcompleter.html#completer-objects
+ .. _readline: http://docs.python.org/3/library/readline.html
+ .. _rlcompleter: http://docs.python.org/3/library/rlcompleter.html#completer-objects
.. _IPython: http://ipython.org/
.. code-block:: python
@@ -259,6 +258,17 @@
.. _`see on GitHub`: https://github.com/kislyuk/argcomplete/blob/master/argcomplete/bash_completi...
+ Zsh Support
+ ------------
+ To activate completions for zsh you need to have ``bashcompinit`` enabled in zsh::
+
+ autoload -U bashcompinit
+ bashcompinit
+
+ Afterwards you can enable completion for your scripts with ``register-python-argcomplete``::
+
+ eval "$(register-python-argcomplete my-awesome-script)"
+
Tcsh Support
------------
To activate completions for tcsh use::
@@ -346,3 +356,4 @@
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Shells
Classifier: Topic :: Terminals
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/scripts/register-python-argcomplete new/argcomplete-1.9.5/scripts/register-python-argcomplete
--- old/argcomplete-1.9.4/scripts/register-python-argcomplete 2017-11-21 17:06:21.000000000 +0100
+++ new/argcomplete-1.9.5/scripts/register-python-argcomplete 2019-01-11 18:35:14.000000000 +0100
@@ -41,6 +41,7 @@
parser.add_argument(
'executable',
+ nargs='+',
help='executable to completed (when invoked by exactly this name)')
if len(sys.argv) == 1:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/setup.cfg new/argcomplete-1.9.5/setup.cfg
--- old/argcomplete-1.9.4/setup.cfg 2018-02-13 16:41:04.000000000 +0100
+++ new/argcomplete-1.9.5/setup.cfg 2019-04-02 15:59:05.000000000 +0200
@@ -10,7 +10,7 @@
[flake8]
max-line-length = 120
-ignore = E301, E302, E305, E401, E722, E741
+ignore = E301, E302, E305, E401, F401, E722, E741
exclude = my_shlex.py
[egg_info]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/setup.py new/argcomplete-1.9.5/setup.py
--- old/argcomplete-1.9.4/setup.py 2018-02-13 16:40:23.000000000 +0100
+++ new/argcomplete-1.9.5/setup.py 2019-04-02 15:57:40.000000000 +0200
@@ -8,7 +8,7 @@
setup(
name='argcomplete',
- version='1.9.4',
+ version='1.9.5',
url='https://github.com/kislyuk/argcomplete',
license='Apache Software License',
author='Andrey Kislyuk',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.4/test/test.py new/argcomplete-1.9.5/test/test.py
--- old/argcomplete-1.9.4/test/test.py 2018-02-13 16:40:04.000000000 +0100
+++ new/argcomplete-1.9.5/test/test.py 2019-01-11 18:35:14.000000000 +0100
@@ -740,17 +740,17 @@
def test_shellcode_utility(self):
with NamedTemporaryFile() as fh:
- sc = shellcode("prog", use_defaults=True, shell="bash", complete_arguments=None)
+ sc = shellcode(["prog"], use_defaults=True, shell="bash", complete_arguments=None)
fh.write(sc.encode())
fh.flush()
subprocess.check_call(['bash', '-n', fh.name])
with NamedTemporaryFile() as fh:
- sc = shellcode("prog", use_defaults=False, shell="bash", complete_arguments=["-o", "nospace"])
+ sc = shellcode(["prog", "prog2"], use_defaults=False, shell="bash", complete_arguments=["-o", "nospace"])
fh.write(sc.encode())
fh.flush()
subprocess.check_call(['bash', '-n', fh.name])
- sc = shellcode("prog", use_defaults=False, shell="tcsh", complete_arguments=["-o", "nospace"])
- sc = shellcode("prog", use_defaults=False, shell="woosh", complete_arguments=["-o", "nospace"])
+ sc = shellcode(["prog"], use_defaults=False, shell="tcsh", complete_arguments=["-o", "nospace"])
+ sc = shellcode(["prog"], use_defaults=False, shell="woosh", complete_arguments=["-o", "nospace"])
class TestArgcompleteREPL(unittest.TestCase):
def setUp(self):