Page MenuHomeFreeBSD

New port: editors/py-pynvim: Python client and plugin host for Neovim
ClosedPublic

Authored by 0mp on Mar 15 2019, 4:32 PM.

Details

Summary
New port: editors/py-pynvim: Python client and plugin host for Neovim


Pynvim implements support for python plugins in Nvim. It also works as a
library for connecting to and scripting Nvim processes through its msgpack-rpc
API.

WWW: https://pynvim.readthedocs.io/en/latest/
Test Plan
  • portlint
  • poudriere testport 11.2 (i386), 12.0 (amd64) with make test for both py36 and py27
  • manual testing on 13.0 amd64: Neovim plugins work as expected

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

editors/py-pynvim/Makefile
29–33 ↗(On Diff #55110)

That will not work. If FLAVOR is not set in the environment (user or build tool), it will still be empty here as FLAVORS is only set after including bsd.port.pre.mk, which happens here in the last line of the Makefile.

38 ↗(On Diff #55110)

If all you need is get a 3 when it is Python 3, it would be easier to just write:

SUFFIX_FOR_PYTHON_3=${PYTHON_MAJOR_VER:M3}

Simplify SUFFIX_FOR_PYTHON_3

0mp marked 2 inline comments as done.Mar 17 2019, 8:29 PM
0mp added inline comments.
editors/py-pynvim/Makefile
29–33 ↗(On Diff #55110)

Ah this is that corner case that we talked about when I was adding examples to ports(7).

Thanks for clarification!

38 ↗(On Diff #55110)

Great idea! I forgot about this approach

editors/py-pynvim/Makefile
29–33 ↗(On Diff #55110)

Mmmm, no, this is different, it is an evaluation order problem.

Here, FLAVORS is set by the framework in Mk/Uses/pythoh.mk, which happens when bsd.port.mk is parsed at the end of the Makefile.

When you set FLAVOR?=${FLAVORS:[1]} it's ok because make does lazy evaluation and will only look for the value of the variable when used.

But then, you use FLAVOR in the .if ${FLAVOR... before FLAVORS is set. So if you are building the default flavor, FLAVOR is still empty, and the :Mxxx does not work correctly.

0mp marked 3 inline comments as done.Mar 17 2019, 10:44 PM
0mp added inline comments.
editors/py-pynvim/Makefile
29–33 ↗(On Diff #55110)

Alright. Makes sense.

I've tested the current revision with both the default flavor and py36 and it works.

This revision is now accepted and ready to land.Mar 18 2019, 1:13 PM
This revision was automatically updated to reflect the committed changes.
0mp marked an inline comment as done.