Hello community, here is the log from the commit of package python-argcomplete for openSUSE:Factory checked in at 2019-09-27 14:47:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-argcomplete (Old) and /work/SRC/openSUSE:Factory/.python-argcomplete.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-argcomplete" Fri Sep 27 14:47:28 2019 rev:12 rq:730714 version:1.10.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-argcomplete/python-argcomplete.changes 2019-04-08 20:53:00.294544963 +0200 +++ /work/SRC/openSUSE:Factory/.python-argcomplete.new.2352/python-argcomplete.changes 2019-09-27 14:47:29.860913100 +0200 @@ -1,0 +2,7 @@ +Fri Sep 13 12:45:13 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 1.10.0: + * fish support +- Refresh patch skip_tcsh_tests.patch + +------------------------------------------------------------------- Old: ---- argcomplete-1.9.5.tar.gz New: ---- argcomplete-1.10.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-argcomplete.spec ++++++ --- /var/tmp/diff_new_pack.YkjaAZ/_old 2019-09-27 14:47:30.652911040 +0200 +++ /var/tmp/diff_new_pack.YkjaAZ/_new 2019-09-27 14:47:30.664911009 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-argcomplete -Version: 1.9.5 +Version: 1.10.0 Release: 0 Summary: Bash tab completion for argparse License: Apache-2.0 @@ -31,6 +31,7 @@ BuildRequires: %{python_module pexpect} BuildRequires: %{python_module setuptools} BuildRequires: fdupes +BuildRequires: fish BuildRequires: python-rpm-macros BuildArch: noarch %python_subpackages ++++++ argcomplete-1.9.5.tar.gz -> argcomplete-1.10.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/Changes.rst new/argcomplete-1.10.0/Changes.rst --- old/argcomplete-1.9.5/Changes.rst 2019-04-02 15:58:44.000000000 +0200 +++ new/argcomplete-1.10.0/Changes.rst 2019-05-12 19:26:38.000000000 +0200 @@ -1,3 +1,8 @@ +Changes for v1.10.0 (2019-05-12) +================================ + +- Fish support #68 (#260), thanks to @volkov + Changes for v1.9.5 (2019-04-02) =============================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/PKG-INFO new/argcomplete-1.10.0/PKG-INFO --- old/argcomplete-1.9.5/PKG-INFO 2019-04-02 15:59:05.000000000 +0200 +++ new/argcomplete-1.10.0/PKG-INFO 2019-05-12 19:26:48.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: argcomplete -Version: 1.9.5 +Version: 1.10.0 Summary: Bash tab completion for argparse Home-page: https://github.com/kislyuk/argcomplete Author: Andrey Kislyuk @@ -281,6 +281,16 @@ complete my-awesome-script 'p@*@`python-argcomplete-tcsh my-awesome-script`@' + Fish Support + ------------ + To activate completions for fish use:: + + register-python-argcomplete --shell fish my-awesome-script | . + + or create new completion file, e.g:: + + register-python-argcomplete --shell fish ~/.config/fish/completions/my-awesome-script.fish + Python Support -------------- Argcomplete requires Python 2.7 or 3.3+. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/README.rst new/argcomplete-1.10.0/README.rst --- old/argcomplete-1.9.5/README.rst 2019-04-02 15:57:32.000000000 +0200 +++ new/argcomplete-1.10.0/README.rst 2019-05-12 19:16:02.000000000 +0200 @@ -273,6 +273,16 @@ complete my-awesome-script 'p@*@`python-argcomplete-tcsh my-awesome-script`@' +Fish Support +------------ +To activate completions for fish use:: + + register-python-argcomplete --shell fish my-awesome-script | . + +or create new completion file, e.g:: + + register-python-argcomplete --shell fish ~/.config/fish/completions/my-awesome-script.fish + Python Support -------------- Argcomplete requires Python 2.7 or 3.3+. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/argcomplete/__init__.py new/argcomplete-1.10.0/argcomplete/__init__.py --- old/argcomplete-1.9.5/argcomplete/__init__.py 2018-02-13 16:43:58.000000000 +0100 +++ new/argcomplete-1.10.0/argcomplete/__init__.py 2019-05-12 19:16:02.000000000 +0200 @@ -537,8 +537,8 @@ elif cword_prequote == '"': special_chars += '"`$!' - if os.environ.get("_ARGCOMPLETE_SHELL") == "tcsh": - # tcsh escapes special characters itself. + if os.environ.get("_ARGCOMPLETE_SHELL") in ("tcsh", "fish"): + # tcsh and fish escapes special characters itself. special_chars = "" elif cword_prequote == "'": # Nothing can be escaped in single quotes, so we need to close diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/argcomplete/shellintegration.py new/argcomplete-1.10.0/argcomplete/shellintegration.py --- old/argcomplete-1.9.5/argcomplete/shellintegration.py 2019-01-11 18:35:14.000000000 +0100 +++ new/argcomplete-1.10.0/argcomplete/shellintegration.py 2019-05-12 19:16:02.000000000 +0200 @@ -43,6 +43,25 @@ complete "%(executable)s" 'p@*@`python-argcomplete-tcsh "%(executable)s"`@' ; ''' +fishcode = r''' +function __fish_%(executable)s_complete + set -x _ARGCOMPLETE 1 + set -x _ARGCOMPLETE_IFS \n + set -x _ARGCOMPLETE_SUPPRESS_SPACE 1 + set -x _ARGCOMPLETE_SHELL fish + set -x COMP_LINE (commandline -p) + set -x COMP_POINT (string length (commandline -cp)) + set -x COMP_TYPE + if set -q _ARC_DEBUG + %(executable)s 8>&1 9>&2 1>/dev/null 2>&1 + else + %(executable)s 8>&1 9>&2 1>&9 2>&1 + end +end +complete -c %(executable)s -f -a '(__fish_%(executable)s_complete)' +''' + + 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. @@ -63,6 +82,10 @@ quoted_executables = [quote(i) for i in executables] executables_list = " ".join(quoted_executables) code = bashcode % dict(complete_opts=complete_options, executables=executables_list) + elif shell == 'fish': + code = "" + for executable in executables: + code += fishcode % dict(executable=executable) else: code = "" for executable in executables: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/argcomplete.egg-info/PKG-INFO new/argcomplete-1.10.0/argcomplete.egg-info/PKG-INFO --- old/argcomplete-1.9.5/argcomplete.egg-info/PKG-INFO 2019-04-02 15:59:05.000000000 +0200 +++ new/argcomplete-1.10.0/argcomplete.egg-info/PKG-INFO 2019-05-12 19:26:47.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: argcomplete -Version: 1.9.5 +Version: 1.10.0 Summary: Bash tab completion for argparse Home-page: https://github.com/kislyuk/argcomplete Author: Andrey Kislyuk @@ -281,6 +281,16 @@ complete my-awesome-script 'p@*@`python-argcomplete-tcsh my-awesome-script`@' + Fish Support + ------------ + To activate completions for fish use:: + + register-python-argcomplete --shell fish my-awesome-script | . + + or create new completion file, e.g:: + + register-python-argcomplete --shell fish ~/.config/fish/completions/my-awesome-script.fish + Python Support -------------- Argcomplete requires Python 2.7 or 3.3+. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/scripts/register-python-argcomplete new/argcomplete-1.10.0/scripts/register-python-argcomplete --- old/argcomplete-1.9.5/scripts/register-python-argcomplete 2019-01-11 18:35:14.000000000 +0100 +++ new/argcomplete-1.10.0/scripts/register-python-argcomplete 2019-05-12 19:16:02.000000000 +0200 @@ -16,6 +16,10 @@ For Tcsh $ eval `register-python-argcomplete --shell tcsh my-favorite-script.py` + +For Fish + + $ register-python-argcomplete --shell fish my-favourite-script.py > ~/.config/fish/my-favourite-script.py.fish ''' import sys @@ -36,7 +40,7 @@ help='arguments to call complete with; use of this option discards default options') parser.add_argument( '-s', '--shell', - choices=('bash', 'tcsh'), default='bash', + choices=('bash', 'tcsh', 'fish'), default='bash', help='output code for the specified shell') parser.add_argument( @@ -44,6 +48,8 @@ nargs='+', help='executable to completed (when invoked by exactly this name)') +argcomplete.autocomplete(parser) + if len(sys.argv) == 1: parser.print_help() sys.exit(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argcomplete-1.9.5/setup.py new/argcomplete-1.10.0/setup.py --- old/argcomplete-1.9.5/setup.py 2019-04-02 15:57:40.000000000 +0200 +++ new/argcomplete-1.10.0/setup.py 2019-05-12 19:26:00.000000000 +0200 @@ -8,7 +8,7 @@ setup( name='argcomplete', - version='1.9.5', + version='1.10.0', 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.5/test/test.py new/argcomplete-1.10.0/test/test.py --- old/argcomplete-1.9.5/test/test.py 2019-01-11 18:35:14.000000000 +0100 +++ new/argcomplete-1.10.0/test/test.py 2019-05-12 19:16:02.000000000 +0200 @@ -751,6 +751,7 @@ 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"], shell="fish") class TestArgcompleteREPL(unittest.TestCase): def setUp(self): @@ -992,6 +993,7 @@ """ sh = None expected_failures = [] + skipped = [] @classmethod def setUpClass(cls, *args, **kwargs): @@ -1002,6 +1004,13 @@ def wrapped(self, test=test): test(self) setattr(cls, name, wrapped) + for name in cls.skipped: + test = getattr(cls, name) + + @unittest.skip('skip') + def wrapped(self, test=test): + pass + setattr(cls, name, wrapped) super(_TestSh, cls).setUpClass(*args, **kwargs) def setUp(self): @@ -1190,6 +1199,36 @@ self.assertEqual(output, '') self.sh = sh + def tearDown(self): + # The shell wrapper is fragile; exactly which exception is raised + # differs depending on environment. + with self.assertRaises((pexpect.EOF, OSError)): + self.sh.run_command('exit') + self.sh.run_command('') + + +class TestFish(_TestSh, unittest.TestCase): + expected_failures = [ + 'test_parse_special_characters', + 'test_comp_point', + 'test_special_characters_double_quoted' + ] + + skipped = [ + 'test_single_quotes_in_single_quotes', + 'test_parse_special_characters_dollar' + ] + + def setUp(self): + + sh = Shell('fish') + path = ' '.join([os.path.join(BASE_DIR, 'scripts'), TEST_DIR, '$PATH']) + sh.run_command('set -x PATH {0}'.format(path)) + sh.run_command('set -x PYTHONPATH {0}'.format(BASE_DIR)) + output = sh.run_command('register-python-argcomplete --shell fish prog | .') + self.assertEqual(output, '') + self.sh = sh + def tearDown(self): # The shell wrapper is fragile; exactly which exception is raised # differs depending on environment. ++++++ skip_tcsh_tests.patch ++++++ --- /var/tmp/diff_new_pack.YkjaAZ/_old 2019-09-27 14:47:30.824910593 +0200 +++ /var/tmp/diff_new_pack.YkjaAZ/_new 2019-09-27 14:47:30.828910582 +0200 @@ -1,7 +1,8 @@ -diff -ur argcomplete-1.9.4.orig/test/test.py argcomplete-1.9.4/test/test.py ---- argcomplete-1.9.4.orig/test/test.py 2018-02-13 22:40:04.000000000 +0700 -+++ argcomplete-1.9.4/test/test.py 2019-02-10 21:45:44.370237665 +0700 -@@ -1170,34 +1170,6 @@ +Index: argcomplete-1.10.0/test/test.py +=================================================================== +--- argcomplete-1.10.0.orig/test/test.py ++++ argcomplete-1.10.0/test/test.py +@@ -1179,34 +1179,6 @@ class TestBashGlobal(TestBash): self.assertEqual(self.sh.run_command('python -m package.prog basic f\t'), 'foo\r\n') @@ -33,6 +34,6 @@ - self.sh.run_command('') - - - class Shell(object): - def __init__(self, shell): - self.child = pexpect.spawn(shell, encoding='utf-8') + class TestFish(_TestSh, unittest.TestCase): + expected_failures = [ + 'test_parse_special_characters',
