Hello community, here is the log from the commit of package python-neovim for openSUSE:Factory checked in at 2017-11-18 00:20:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-neovim (Old) and /work/SRC/openSUSE:Factory/.python-neovim.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-neovim" Sat Nov 18 00:20:37 2017 rev:9 rq:541604 version:0.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-neovim/python-neovim.changes 2017-09-09 20:26:39.769007340 +0200 +++ /work/SRC/openSUSE:Factory/.python-neovim.new/python-neovim.changes 2017-11-18 00:20:38.596534910 +0100 @@ -1,0 +2,15 @@ +Mon Nov 13 15:39:05 UTC 2017 - roni...@gmail.com + +- Run spec-cleaner. +- Version bump to 0.2.0. + Upstream changelog: + * a2e1169 Fix tests on windows (#201) + * 9a0e729 Fix an indexing bug when setting lines in a Range + object (#270) + * 4abd5d0 Documentation update (#272) + * a703b47 Make sure logging always uses UTF-8 regardless of + locale (#276) + * 68aa352 Add argument to allow nested notification handlers + (#262) + +------------------------------------------------------------------- Old: ---- python-client-0.1.13.tar.gz New: ---- python-client-0.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-neovim.spec ++++++ --- /var/tmp/diff_new_pack.b6TpGc/_old 2017-11-18 00:20:40.452467336 +0100 +++ /var/tmp/diff_new_pack.b6TpGc/_new 2017-11-18 00:20:40.456467191 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-neovim -Version: 0.1.13 +Version: 0.2.0 Release: 0 Summary: Python 2 client to Neovim License: Apache-2.0 @@ -32,11 +32,10 @@ Requires: neovim >= 0.1.6 Requires: python-greenlet Requires: python-msgpack-python +BuildArch: noarch %ifpython2 Requires: python-trollius %endif -BuildArch: noarch - %python_subpackages %description @@ -53,7 +52,6 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %files %{python_files} -%defattr(-,root,root) %doc README.md LICENSE %{python_sitelib}/neovim/ %{python_sitelib}/neovim-%{version}-*.egg-info/ ++++++ python-client-0.1.13.tar.gz -> python-client-0.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/README.md new/python-client-0.2.0/README.md --- old/python-client-0.1.13/README.md 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/README.md 2017-11-08 19:29:13.000000000 +0100 @@ -42,26 +42,44 @@ below. * `vim.funcs` exposes vimscript functions (both builtin and global user defined - functions) as a python namespace. For instance to set the value of the value - of a register - - `vim.funcs.setreg('0', ["some", "text"], 'l')` + functions) as a python namespace. For instance to set the value of a register + ``` + vim.funcs.setreg('0', ["some", "text"], 'l') + ``` + +* `vim.api` exposes nvim API methods. For instance to call `nvim_strwidth`, + ``` + result = vim.api.strwidth("some text") + ``` + Note the initial `nvim_` is not included. Also, object methods can be called + directly on their object, + ``` + buf = vim.current.buffer + len = buf.api.line_count() + ``` + calls `nvim_buf_line_count`. Alternatively msgpack requests can be invoked + directly, + ``` + result = vim.request("nvim_strwith", "some text") + len = vim.request("nvim_buf_line_count", buf) + ``` * The API is not thread-safe in general. However, `vim.async_call` allows a spawned thread to schedule code to be executed on the main thread. This method could also be called from `:python` or a synchronous request handler, to defer some execution that shouldn't block nvim. + ``` + :python vim.async_call(myfunc, args...) - `:python vim.async_call(myfunc, args...)` - + ``` Note that this code will still block the plugin host if it does long-running computations. Intensive computations should be done in a separate thread (or process), and `vim.async_call` can be used to send results back to nvim. -* Some methods accept an extra keyword-only argument `async`: `vim.eval`, - `vim.command` as well as the `vim.funcs` wrappers. The python host will not - wait for nvim to complete the request, which also means that the return value - is unavailable. +* Some methods accept an `async` keyword argument: `vim.eval`, `vim.command`, + `vim.request` as well as the `vim.funcs` and `vim.api` wrappers. When + `async=True` is passed the client will not wait for nvim to complete the + request (which also means that the return value is unavailable). #### Remote (new-style) plugins @@ -96,6 +114,14 @@ required for function return values), but by default handlers are executed asynchronously. +Normally async handlers (`sync=False`, the default) are blocked while a +synchronous handler is running. This ensures that async handlers can call +requests without nvim confusing these requests with requests from a synchronous +handler. To execute an asynchronous handler even when other handlers are +running, add `allow_nested=True` to the decorator. The handler must then not +make synchronous nvim requests, but it can make asynchronous requests, i e +passing `async=True`. + You need to run `:UpdateRemotePlugins` in nvim for changes in the specifications to have effect. For details see `:help remote-plugin` in nvim. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/neovim/__init__.py new/python-client-0.2.0/neovim/__init__.py --- old/python-client-0.1.13/neovim/__init__.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/neovim/__init__.py 2017-11-08 19:29:13.000000000 +0100 @@ -21,7 +21,7 @@ 'shutdown_hook', 'attach', 'setup_logging', 'ErrorResponse') -VERSION = Version(major=0, minor=1, patch=13, prerelease="") +VERSION = Version(major=0, minor=2, patch=0, prerelease='') def start_host(session=None): @@ -119,18 +119,18 @@ prefix = os.environ['NVIM_PYTHON_LOG_FILE'].strip() major_version = sys.version_info[0] logfile = '{}_py{}_{}'.format(prefix, major_version, name) - handler = logging.FileHandler(logfile, 'w') + handler = logging.FileHandler(logfile, 'w', 'utf-8') handler.formatter = logging.Formatter( '%(asctime)s [%(levelname)s @ ' '%(filename)s:%(funcName)s:%(lineno)s] %(process)s - %(message)s') logging.root.addHandler(handler) level = logging.INFO if 'NVIM_PYTHON_LOG_LEVEL' in os.environ: - l = getattr(logging, - os.environ['NVIM_PYTHON_LOG_LEVEL'].strip(), - level) - if isinstance(l, int): - level = l + lvl = getattr(logging, + os.environ['NVIM_PYTHON_LOG_LEVEL'].strip(), + level) + if isinstance(lvl, int): + level = lvl logger.setLevel(level) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/neovim/api/buffer.py new/python-client-0.2.0/neovim/api/buffer.py --- old/python-client-0.1.13/neovim/api/buffer.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/neovim/api/buffer.py 2017-11-08 19:29:13.000000000 +0100 @@ -28,7 +28,7 @@ def __len__(self): """Return the number of lines contained in a Buffer.""" - return self.request('buffer_line_count') + return self.request('nvim_buf_line_count') def __getitem__(self, idx): """Get a buffer line or slice by integer index. @@ -62,7 +62,7 @@ lines = item if item is not None else [] start = adjust_index(idx.start, 0) end = adjust_index(idx.stop, -1) - return self.request('buffer_set_lines', start, end, False, lines) + return self.request('nvim_buf_set_lines', start, end, False, lines) def __iter__(self): """Iterate lines of a buffer. @@ -160,8 +160,8 @@ if start is None: start = self.start if end is None: - end = self.end + 1 - self._buffer[start:end] = lines + end = self.end + self._buffer[start:end + 1] = lines def __iter__(self): for i in range(self.start, self.end + 1): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/neovim/api/nvim.py new/python-client-0.2.0/neovim/api/nvim.py --- old/python-client-0.1.13/neovim/api/nvim.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/neovim/api/nvim.py 2017-11-08 19:29:13.000000000 +0100 @@ -2,7 +2,6 @@ import functools import os import sys - from traceback import format_stack from msgpack import ExtType @@ -79,7 +78,7 @@ self.types = types self.api = RemoteApi(self, 'nvim_') self.vars = RemoteMap(self, 'nvim_get_var', 'nvim_set_var') - self.vvars = RemoteMap(self, 'vim_get_vvar', None) + self.vvars = RemoteMap(self, 'nvim_get_vvar', None) self.options = RemoteMap(self, 'nvim_get_option', 'nvim_set_option') self.buffers = Buffers(self) self.windows = RemoteSequence(self, 'nvim_list_wins') @@ -295,12 +294,12 @@ The returned sequences can be used as input to `feedkeys`. """ - return self.request('vim_replace_termcodes', string, + return self.request('nvim_replace_termcodes', string, from_part, do_lt, special) - def out_write(self, msg): + def out_write(self, msg, **kwargs): """Print `msg` as a normal message.""" - return self.request('nvim_out_write', msg) + return self.request('nvim_out_write', msg, **kwargs) def err_write(self, msg, **kwargs): """Print `msg` as an error message.""" @@ -353,7 +352,7 @@ """Remote NVim buffers. Currently the interface for interacting with remote NVim buffers is the - `vim_get_buffers` msgpack-rpc function. Most methods fetch the list of + `nvim_list_bufs` msgpack-rpc function. Most methods fetch the list of buffers from NVim. Conforms to *python-buffers*. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/neovim/msgpack_rpc/session.py new/python-client-0.2.0/neovim/msgpack_rpc/session.py --- old/python-client-0.1.13/neovim/msgpack_rpc/session.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/neovim/msgpack_rpc/session.py 2017-11-08 19:29:13.000000000 +0100 @@ -1,7 +1,6 @@ """Synchronous msgpack-rpc session layer.""" import logging from collections import deque - from traceback import format_exc import greenlet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/neovim/plugin/decorators.py new/python-client-0.2.0/neovim/plugin/decorators.py --- old/python-client-0.1.13/neovim/plugin/decorators.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/neovim/plugin/decorators.py 2017-11-08 19:29:13.000000000 +0100 @@ -43,7 +43,7 @@ def command(name, nargs=0, complete=None, range=None, count=None, bang=False, - register=False, sync=False, eval=None): + register=False, sync=False, allow_nested=False, eval=None): """Tag a function or plugin method as a Nvim command handler.""" def dec(f): f._nvim_rpc_method_name = 'command:{}'.format(name) @@ -73,17 +73,22 @@ if eval: opts['eval'] = eval + if not sync and allow_nested: + rpc_sync = "urgent" + else: + rpc_sync = sync + f._nvim_rpc_spec = { 'type': 'command', 'name': name, - 'sync': sync, + 'sync': rpc_sync, 'opts': opts } return f return dec -def autocmd(name, pattern='*', sync=False, eval=None): +def autocmd(name, pattern='*', sync=False, allow_nested=False, eval=None): """Tag a function or plugin method as a Nvim autocommand handler.""" def dec(f): f._nvim_rpc_method_name = 'autocmd:{}:{}'.format(name, pattern) @@ -98,17 +103,22 @@ if eval: opts['eval'] = eval + if not sync and allow_nested: + rpc_sync = "urgent" + else: + rpc_sync = sync + f._nvim_rpc_spec = { 'type': 'autocmd', 'name': name, - 'sync': sync, + 'sync': rpc_sync, 'opts': opts } return f return dec -def function(name, range=False, sync=False, eval=None): +def function(name, range=False, sync=False, allow_nested=False, eval=None): """Tag a function or plugin method as a Nvim function handler.""" def dec(f): f._nvim_rpc_method_name = 'function:{}'.format(name) @@ -124,10 +134,15 @@ if eval: opts['eval'] = eval + if not sync and allow_nested: + rpc_sync = "urgent" + else: + rpc_sync = sync + f._nvim_rpc_spec = { 'type': 'function', 'name': name, - 'sync': sync, + 'sync': rpc_sync, 'opts': opts } return f diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/neovim/plugin/host.py new/python-client-0.2.0/neovim/plugin/host.py --- old/python-client-0.1.13/neovim/plugin/host.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/neovim/plugin/host.py 2017-11-08 19:29:13.000000000 +0100 @@ -1,12 +1,11 @@ """Implements a Nvim host for python plugins.""" -import functools import imp import inspect import logging import os import os.path import re - +from functools import partial from traceback import format_exc from . import script_host @@ -181,8 +180,8 @@ if fn._nvim_prefix_plugin_path: method = '{}:{}'.format(plugin_path, method) - fn_wrapped = functools.partial(self._wrap_function, fn, - sync, decode, nvim_bind, method) + fn_wrapped = partial(self._wrap_function, fn, + sync, decode, nvim_bind, method) self._copy_attributes(fn, fn_wrapped) # register in the rpc handler dict if sync: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/setup.cfg new/python-client-0.2.0/setup.cfg --- old/python-client-0.1.13/setup.cfg 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/setup.cfg 2017-11-08 19:29:13.000000000 +0100 @@ -1,2 +1,2 @@ [flake8] -ignore = D211,E731,F821 +ignore = D211,E731,F821,D401 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/setup.py new/python-client-0.2.0/setup.py --- old/python-client-0.1.13/setup.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/setup.py 2017-11-08 19:29:13.000000000 +0100 @@ -22,10 +22,10 @@ install_requires.append('greenlet') setup(name='neovim', - version='0.1.13', + version='0.2.0', description='Python client to neovim', url='http://github.com/neovim/python-client', - download_url='https://github.com/neovim/python-client/archive/0.1.13.tar.gz', + download_url='https://github.com/neovim/python-client/archive/0.2.0.tar.gz', author='Thiago de Arruda', author_email='tpadilh...@gmail.com', license='Apache', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/test/test_buffer.py new/python-client-0.2.0/test/test_buffer.py --- old/python-client-0.1.13/test/test_buffer.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/test/test_buffer.py 2017-11-08 19:29:13.000000000 +0100 @@ -172,3 +172,10 @@ @with_setup(setup=cleanup) def test_contains(): ok(vim.current.buffer in vim.buffers) + +@with_setup(setup=cleanup) +def test_set_items_for_range(): + vim.current.buffer[:] = ['a', 'b', 'c', 'd', 'e'] + r = vim.current.buffer.range(1, 3) + r[1:3] = ['foo']*3 + eq(vim.current.buffer[:], ['a', 'foo', 'foo', 'foo', 'd', 'e']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-client-0.1.13/test/test_vim.py new/python-client-0.2.0/test/test_vim.py --- old/python-client-0.1.13/test/test_vim.py 2017-01-12 15:04:10.000000000 +0100 +++ new/python-client-0.2.0/test/test_vim.py 2017-11-08 19:29:13.000000000 +0100 @@ -21,7 +21,8 @@ vim.command('normal itesting\npython\napi') vim.command('w') ok(os.path.isfile(fname)) - eq(open(fname).read(), 'testing\npython\napi\n') + with open(fname) as f: + eq(f.read(), 'testing\npython\napi\n') os.unlink(fname) @@ -63,8 +64,10 @@ @with_setup(setup=cleanup) def test_chdir(): pwd = vim.eval('getcwd()') + root = os.path.abspath(os.sep) + # We can chdir to '/' on Windows, but then the pwd will be the root drive vim.chdir('/') - eq(vim.eval('getcwd()'), '/') + eq(vim.eval('getcwd()'), root) vim.chdir(pwd) eq(vim.eval('getcwd()'), pwd)