Hello,

Here is an update to py-neovim.  Upstream switched from nose to pytest
for unit tests, but forgot to include the file defining their test
fixtures in the release tarball.  So that file is included as a patch
from the upstream source tree at the time of the tag.  The tests may
need increased file descriptor limits to succeed, depending on your
environment.

OK?

-- 
Jon
Index: Makefile
===================================================================
RCS file: /cvs/ports/editors/py-neovim/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile    2 Dec 2017 12:30:56 -0000       1.2
+++ Makefile    21 Jun 2018 18:56:57 -0000
@@ -2,7 +2,7 @@
 
 COMMENT =      Python plugin support for Neovim
 
-MODPY_EGG_VERSION =    0.2.0
+MODPY_EGG_VERSION =    0.2.6
 DISTNAME =             py-neovim-${MODPY_EGG_VERSION}
 
 CATEGORIES =   editors devel
@@ -26,11 +26,13 @@ RUN_DEPENDS =               net/py-msgpack${MODPY_FLA
                        devel/py-uv${MODPY_FLAVOR} \
                        devel/py-greenlet${MODPY_FLAVOR}
 TEST_DEPENDS =         ${RUN_DEPENDS} \
-                       devel/py-nose${MODPY_FLAVOR}
+                       devel/py-test${MODPY_FLAVOR} \
+                       ${BASE_PKGPATH}=${MODPY_EGG_VERSION}
 
 WRKDIST =              ${WRKDIR}/neovim-${MODPY_EGG_VERSION}
 
+# You may need to increase the file descriptor ulimits to run tests.
 do-test:
-       cd ${WRKSRC} && ${LOCALBASE}/bin/nosetests${MODPY_BIN_SUFFIX}
+       cd ${WRKSRC} && ${LOCALBASE}/bin/py.test${MODPY_BIN_SUFFIX}
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/editors/py-neovim/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo    2 Dec 2017 12:30:56 -0000       1.2
+++ distinfo    21 Jun 2018 18:32:54 -0000
@@ -1,2 +1,2 @@
-SHA256 (py-neovim-0.2.0.tar.gz) = 1gvgS6ND9+qZxUqYYqJUognOnKvNw0gf5ayk1vN6k/s=
-SIZE (py-neovim-0.2.0.tar.gz) = 35957
+SHA256 (py-neovim-0.2.6.tar.gz) = bOWKdC4EJ0kcDhyBCFVu5yujOEQgm9niJrjalTgpknY=
+SIZE (py-neovim-0.2.6.tar.gz) = 36574
Index: patches/patch-test_conftest_py
===================================================================
RCS file: patches/patch-test_conftest_py
diff -N patches/patch-test_conftest_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-test_conftest_py      21 Jun 2018 18:32:54 -0000
@@ -0,0 +1,78 @@
+$OpenBSD$
+
+Although this file is present in the upstream source tree, it was not
+included when the release tarball was created.  This file is needed to
+run unit tests and was copied from the release tag matching this
+version.
+
+Index: test/conftest.py
+--- test/conftest.py.orig
++++ test/conftest.py
+@@ -0,0 +1,67 @@
++import json
++import os
++import textwrap
++
++import neovim
++import pytest
++
++neovim.setup_logging("test")
++
++
++@pytest.fixture(autouse=True)
++def cleanup_func(vim):
++    fun = textwrap.dedent(''':function BeforeEachTest()
++        set all&
++        redir => groups
++        silent augroup
++        redir END
++        for group in split(groups)
++            exe 'augroup '.group
++            autocmd!
++            augroup END
++        endfor
++        autocmd!
++        tabnew
++        let curbufnum = eval(bufnr('%'))
++        redir => buflist
++        silent ls!
++        redir END
++        let bufnums = []
++        for buf in split(buflist, '\\n')
++            let bufnum = eval(split(buf, '[ u]')[0])
++            if bufnum != curbufnum
++            call add(bufnums, bufnum)
++            endif
++        endfor
++        if len(bufnums) > 0
++            exe 'silent bwipeout! '.join(bufnums, ' ')
++        endif
++        silent tabonly
++        for k in keys(g:)
++            exe 'unlet g:'.k
++        endfor
++        filetype plugin indent off
++        mapclear
++        mapclear!
++        abclear
++        comclear
++        endfunction
++    ''')
++    vim.input(fun)
++    vim.command('call BeforeEachTest()')
++    assert len(vim.tabpages) == len(vim.windows) == len(vim.buffers) == 1
++
++
++@pytest.fixture
++def vim():
++    child_argv = os.environ.get('NVIM_CHILD_ARGV')
++    listen_address = os.environ.get('NVIM_LISTEN_ADDRESS')
++    if child_argv is None and listen_address is None:
++        child_argv = '["nvim", "-u", "NONE", "--embed"]'
++
++    if child_argv is not None:
++        editor = neovim.attach('child', argv=json.loads(child_argv))
++    else:
++        editor = neovim.attach('socket', path=listen_address)
++
++    return editor
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/editors/py-neovim/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   2 Dec 2017 12:30:56 -0000       1.2
+++ pkg/PLIST   21 Jun 2018 18:58:25 -0000
@@ -12,7 +12,6 @@ ${MODPY_COMMENT}lib/python${MODPY_VERSIO
 
lib/python${MODPY_VERSION}/site-packages/neovim/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/neovim/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/neovim/${MODPY_PYCACHE}util.${MODPY_PYC_MAGIC_TAG}pyc
-lib/python${MODPY_VERSION}/site-packages/neovim/${MODPY_PYCACHE}version.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/neovim/api/
 lib/python${MODPY_VERSION}/site-packages/neovim/api/__init__.py
 
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/neovim/api/${MODPY_PYCACHE}/
@@ -59,4 +58,3 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/neovim/plugin/host.py
 lib/python${MODPY_VERSION}/site-packages/neovim/plugin/script_host.py
 lib/python${MODPY_VERSION}/site-packages/neovim/util.py
-lib/python${MODPY_VERSION}/site-packages/neovim/version.py

Reply via email to