Skip to content

Commit 6820e6d

Browse files
feat: update python-pynvim to 0.5.2-2
1 parent 9135c3e commit 6820e6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1873
-1002
lines changed

PKG-INFO

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
Metadata-Version: 2.1
22
Name: pynvim
3-
Version: 0.4.2
4-
Summary: Python client to neovim
3+
Version: 0.5.2
4+
Summary: Python client for Neovim
55
Home-page: http://github.com/neovim/pynvim
6-
Author: Thiago de Arruda
7-
Author-email: [email protected]
6+
Download-URL: https://github.com/neovim/pynvim/archive/0.5.2.tar.gz
7+
Author: Neovim Authors
88
License: Apache
9-
Download-URL: https://github.com/neovim/pynvim/archive/0.4.2.tar.gz
10-
Description: UNKNOWN
11-
Platform: UNKNOWN
12-
Provides-Extra: pyuv
9+
Requires-Python: >=3.7
10+
License-File: LICENSE
11+
Requires-Dist: msgpack>=0.5.0
12+
Requires-Dist: greenlet>=3.0; platform_python_implementation != "PyPy"
13+
Requires-Dist: typing-extensions>=4.5; python_version < "3.12"
1314
Provides-Extra: test
15+
Requires-Dist: pytest; extra == "test"
16+
Requires-Dist: pytest_timeout; extra == "test"
17+
Provides-Extra: docs
18+
Requires-Dist: sphinx; extra == "docs"
19+
Requires-Dist: sphinx-rtd-theme; extra == "docs"

README.md

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Pynvim: Python client to [Neovim](https://github.com/neovim/neovim)
22
===================================================================
33

4-
[![Build Status](https://travis-ci.org/neovim/pynvim.svg?branch=master)](https://travis-ci.org/neovim/pynvim)
5-
[![Documentation Status](https://readthedocs.org/projects/pynvim/badge/?version=latest)](http://pynvim.readthedocs.io/en/latest/?badge=latest)
4+
[![Documentation Status](https://readthedocs.org/projects/pynvim/badge/?version=latest)](https://readthedocs.org/projects/pynvim/builds/)
65
[![Code coverage](https://codecov.io/gh/neovim/pynvim/branch/master/graph/badge.svg)](https://codecov.io/gh/neovim/pynvim)
76

87
Pynvim implements support for python plugins in Nvim. It also works as a library for
@@ -11,40 +10,30 @@ connecting to and scripting Nvim processes through its msgpack-rpc API.
1110
Install
1211
-------
1312

14-
Supports python 2.7, and 3.4 or later.
13+
Supports python 3.7 or later.
1514

16-
```sh
17-
pip2 install pynvim
18-
pip3 install pynvim
19-
```
20-
21-
If you only use one of python2 or python3, it is enough to install that
22-
version. You can install the package without being root by adding the `--user`
23-
flag.
15+
pip3 install pynvim
2416

17+
You can install the package without being root by adding the `--user` flag.
2518
Anytime you upgrade Neovim, make sure to upgrade pynvim as well:
26-
```sh
27-
pip2 install --upgrade pynvim
28-
pip3 install --upgrade pynvim
29-
```
3019

31-
Alternatively, the master version could be installed by executing the following
32-
in the root of this repository:
33-
```sh
34-
pip2 install .
35-
pip3 install .
36-
```
20+
pip3 install --upgrade pynvim
21+
22+
Alternatively, you can install the development version by cloning this
23+
repository and executing the following at the top level:
24+
25+
pip3 install .
3726

3827
Python Plugin API
3928
-----------------
4029

4130
Pynvim supports python _remote plugins_ (via the language-agnostic Nvim rplugin
42-
interface), as well as _Vim plugins_ (via the `:python[3]` interface). Thus when
43-
pynvim is installed Neovim will report support for the `+python[3]` Vim feature.
31+
interface), as well as _Vim plugins_ (via the `:python3` interface). Thus when
32+
pynvim is installed Neovim will report support for the `+python3` Vim feature.
4433

4534
The rplugin interface allows plugins to handle vimL function calls as well as
4635
defining commands and autocommands, and such plugins can operate asynchronously
47-
without blocking nvim. For details on the new rplugin interface,
36+
without blocking nvim. For details on the new rplugin interface,
4837
see the [Remote Plugin](http://pynvim.readthedocs.io/en/latest/usage/remote-plugins.html) documentation.
4938

5039
Pynvim defines some extensions over the vim python API:
@@ -56,13 +45,16 @@ Pynvim defines some extensions over the vim python API:
5645

5746
See the [Python Plugin API](http://pynvim.readthedocs.io/en/latest/usage/python-plugin-api.html) documentation for usage of this new functionality.
5847

48+
### Known Issues
49+
- Vim evaluates `'v:<bool>'` to `<class 'bool'>`, whereas neovim evaluates to `<class 'str'>`. This is expected behaviour due to the way booleans are implemented in python as explained [here](https://github.com/neovim/pynvim/issues/523#issuecomment-1495502011).
50+
5951
Development
6052
-----------
6153

62-
Use (and activate) a local virtualenv.
54+
Use (and activate) a local virtualenv, for example:
6355

64-
python3 -m venv env36
65-
source env36/bin/activate
56+
python3 -m virtualenv venv
57+
source venv/bin/activate
6658

6759
If you change the code, you must reinstall for the changes to take effect:
6860

@@ -80,22 +72,23 @@ documentation.
8072
### Usage from the Python REPL
8173

8274
A number of different transports are supported, but the simplest way to get
83-
started is with the python REPL. First, start Nvim with a known address (or use
84-
the `$NVIM_LISTEN_ADDRESS` of a running instance):
75+
started is with the python REPL. First, start Nvim with a known address:
8576

8677
```sh
87-
$ NVIM_LISTEN_ADDRESS=/tmp/nvim nvim
78+
$ nvim --listen /tmp/nvim.sock
8879
```
8980

81+
Or alternatively, note the `v:servername` address of a running Nvim instance.
82+
9083
In another terminal, connect a python REPL to Nvim (note that the API is similar
9184
to the one exposed by the [python-vim
9285
bridge](http://vimdoc.sourceforge.net/htmldoc/if_pyth.html#python-vim)):
9386

9487
```python
95-
>>> from pynvim import attach
96-
# Create a python API session attached to unix domain socket created above:
97-
>>> nvim = attach('socket', path='/tmp/nvim')
98-
# Now do some work.
88+
>>> import pynvim
89+
# Create a session attached to Nvim's address (`v:servername`).
90+
>>> nvim = pynvim.attach('socket', path='/tmp/nvim.sock')
91+
# Now do some work.
9992
>>> buffer = nvim.current.buffer # Get the current buffer
10093
>>> buffer[0] = 'replace first line'
10194
>>> buffer[:] = ['replace whole buffer']
@@ -110,27 +103,33 @@ You can embed Neovim into your python application instead of connecting to
110103
a running Neovim instance.
111104

112105
```python
113-
>>> from pynvim import attach
114-
>>> nvim = attach('child', argv=["/bin/env", "nvim", "--embed", "--headless"])
106+
>>> import pynvim
107+
>>> nvim = pynvim.attach('child', argv=["/usr/bin/env", "nvim", "--embed", "--headless"])
115108
```
116109

117-
- The ` --headless` argument tells `nvim` not to wait for a UI to connect.
110+
- The `--headless` argument tells `nvim` not to wait for a UI to connect.
118111
- Alternatively, use `--embed` _without_ `--headless` if your client is a UI
119112
and you want `nvim` to wait for your client to `nvim_ui_attach` before
120113
continuing startup.
121114

122-
See the tests for more examples.
115+
See the [tests](https://github.com/neovim/pynvim/tree/master/test) for more examples.
123116

124117
Release
125118
-------
126119

127120
1. Create a release commit with title `Pynvim x.y.z`
128121
- list significant changes in the commit message
129-
- bump the version in `pynvim/util.py` and `setup.py` (3 places in total)
122+
- bump the version in `pynvim/_version.py`
130123
2. Make a release on GitHub with the same commit/version tag and copy the message.
131124
3. Run `scripts/disable_log_statements.sh`
132-
4. Run `python setup.py sdist`
125+
4. Run `python -m build`
133126
- diff the release tarball `dist/pynvim-x.y.z.tar.gz` against the previous one.
134-
5. Run `twine upload -r pypi dist/pynvim-x.y.z.tar.gz`
127+
5. Run `twine upload -r pypi dist/*`
135128
- Assumes you have a pypi account with permissions.
136129
6. Run `scripts/enable_log_statements.sh` or `git reset --hard` to restore the working dir.
130+
7. Bump up to the next development version in `pynvim/_version.py`, with `prerelease` suffix `dev0`.
131+
132+
License
133+
-------
134+
135+
[Apache License 2.0](https://github.com/neovim/pynvim/blob/master/LICENSE)

debian/changelog

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
python-pynvim (0.5.2-2) unstable; urgency=medium
2+
3+
* Add python3-greenlet to Depends since dh_python3 did not detect it
4+
* test_attach: Increase timeout for jobwait to fix test on riscv64
5+
* Use "Testsuite: autopkgtest-pkg-pybuild" instead of manually defining autopkgtests
6+
7+
-- James McCoy <[email protected]> Mon, 17 Mar 2025 22:28:42 -0400
8+
9+
python-pynvim (0.5.2-1) unstable; urgency=medium
10+
11+
* New upstream release
12+
+ Replace test use of provider#python3#Prog with neovim's new Lua function
13+
(Closes: #1100281)
14+
* Add python3-greenlet, python3-pytest-timeout, and
15+
python3-typing-extensions to test (Build-)Depends
16+
* Backport upstream patch to skip test_broadcast for neovim < 0.11
17+
* Bump neovim Build-Depends / test Depends to >= 0.10
18+
* Backport upstream patch to invoke python3 instead of python in test_connect_stdio
19+
20+
-- James McCoy <[email protected]> Thu, 13 Mar 2025 13:15:58 -0400
21+
22+
python-pynvim (0.5.0-2) unstable; urgency=medium
23+
24+
* Backport upstream fix for test failure with Python 3.13 (Closes: #1082401)
25+
* Update all URLs to reference pynvim
26+
* Declare compliance with Policy 4.7.0, no changes needed
27+
* Mark test Build-Depends with <!nocheck> profile
28+
29+
-- James McCoy <[email protected]> Sun, 03 Nov 2024 00:20:57 -0400
30+
31+
python-pynvim (0.5.0-1) unstable; urgency=medium
32+
33+
[ Debian Janitor ]
34+
* Update standards version to 4.6.2, no changes needed.
35+
36+
[ James McCoy ]
37+
* Remove obsolete transitional package and Breaks/Replaces for
38+
python3-neovim (Closes: #1038308)
39+
* Remove obsolete Breaks on neovim < 0.2.1
40+
* Remove mention of non-existent python2 package in long description
41+
* New upstream release
42+
+ Python 3.12 support (Closes: #1056498)
43+
* Add pybuild-plugin-pyproject to Build-Depends
44+
45+
-- James McCoy <[email protected]> Wed, 06 Dec 2023 11:03:30 -0500
46+
147
python-pynvim (0.4.2-2) unstable; urgency=medium
248

349
* Bump debhelper from old 12 to 13.

debian/control

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,36 @@ Rules-Requires-Root: no
99
Build-Depends:
1010
debhelper-compat (= 13),
1111
dh-python,
12+
pybuild-plugin-pyproject,
1213
python3-all,
1314
python3-setuptools,
1415
# dependencies for python3:
1516
python3-msgpack (>= 0.5.0),
16-
python3-greenlet,
17+
python3-greenlet (>= 3.0),
18+
python3-typing-extensions | python3 (>= 3.12),
1719
# dependencies for tests:
18-
neovim (>= 0.2.1),
19-
python3-pytest (>= 3.4.0),
20+
neovim (>= 0.10) <!nocheck>,
21+
python3-pytest (>= 3.4.0) <!nocheck>,
22+
python3-pytest-timeout <!nocheck>,
2023
# dependencies for setup:
2124
python3-pytest-runner,
22-
Standards-Version: 4.5.1
23-
Homepage: https://github.com/neovim/python-client
25+
Standards-Version: 4.7.0
26+
Testsuite: autopkgtest-pkg-pybuild
27+
Homepage: https://github.com/neovim/pynvim
2428
Vcs-Git: https://salsa.debian.org/python-team/packages/python-pynvim.git
2529
Vcs-Browser: https://salsa.debian.org/python-team/packages/python-pynvim
2630

27-
Package: python3-neovim
28-
Architecture: all
29-
Depends:
30-
python3-pynvim,
31-
${misc:Depends}
32-
Section: oldlibs
33-
Description: transitional dummy package
34-
This is a transitional dummy package. It can safely be removed.
35-
3631
Package: python3-pynvim
3732
Architecture: all
3833
Depends:
3934
${misc:Depends},
40-
${python3:Depends}
35+
${python3:Depends},
36+
python3-greenlet (>= 3.0),
4137
Provides:
4238
python3-neovim (= ${source:Version}),
4339
${python3:Provides},
4440
vim-python3,
45-
Breaks: neovim (<< 0.2.1), python3-neovim (<< 0.4.0~)
46-
Replaces: python3-neovim (<< 0.4.0~)
4741
Recommends: neovim
4842
Description: Python3 library for scripting Neovim processes through its msgpack-rpc API
4943
Neovim is a Vim fork that focuses on refactoring, extensibility and
5044
simplification of the original code base.
51-
.
52-
This is the Python3 version of the package (If you only use one of python2 or
53-
python3, it is enough to install that version.)

debian/copyright

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
22
Upstream-Name: pynvim
3-
Source: https://github.com/neovim/python-client
3+
Source: https://github.com/neovim/pynvim
44
Upstream-Contact: Thiago de Arruda <[email protected]>
55

66

@@ -18,7 +18,9 @@ License: Apache-2.0
1818

1919

2020
Files: debian/*
21-
Copyright: 2015-2016 Víctor Cuadrado Juan <[email protected]>
21+
Copyright:
22+
2015-2016 Víctor Cuadrado Juan <[email protected]>
23+
2019-2024 James McCoy <[email protected]>
2224
License: Apache-2.0
2325

2426

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From e94d68acb888daed31f79c61fb9bca052727e537 Mon Sep 17 00:00:00 2001
2+
From: James McCoy <[email protected]>
3+
Date: Wed, 12 Mar 2025 17:18:57 -0400
4+
Subject: [PATCH] fix(test_connect_stdio): invoke python3 instead of python
5+
6+
"python" is the name for Python 2's interpreter. Since pynvim is now
7+
Python 3 only, there's no reason to expect the legacy interpreter to be
8+
available.
9+
---
10+
test/test_attach.py | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/test/test_attach.py b/test/test_attach.py
14+
index c1588ca..25d0822 100644
15+
--- a/test/test_attach.py
16+
+++ b/test/test_attach.py
17+
@@ -125,7 +125,7 @@ def test_connect_stdio(vim: Nvim) -> None:
18+
])
19+
# see :help jobstart(), *jobstart-options* |msgpack-rpc|
20+
jobid = vim.funcs.jobstart([
21+
- 'python', '-c', remote_py_code,
22+
+ 'python3', '-c', remote_py_code,
23+
], {'rpc': True, 'on_stderr': 'OutputHandler'})
24+
assert jobid > 0
25+
exitcode = vim.funcs.jobwait([jobid], 500)[0]
26+
--
27+
2.47.2
28+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From c3fe99344d1c3f788b160fffc9e019f6b7bf3eca Mon Sep 17 00:00:00 2001
2+
From: Jongwook Choi <[email protected]>
3+
Date: Sun, 5 Jan 2025 22:20:38 -0500
4+
Subject: [PATCH] fix(tests): skip failing test_broadcast on neovim < 0.11
5+
6+
The fix made in #570 actually works for Nvim 0.11+, depending on the
7+
behavior change neovim/neovim#28487.
8+
9+
We should just skip test_broadcast on older Nvim versions (see #585).
10+
---
11+
test/test_events.py | 7 ++++++-
12+
1 file changed, 6 insertions(+), 1 deletion(-)
13+
14+
diff --git a/test/test_events.py b/test/test_events.py
15+
index c978293..ee481d9 100644
16+
--- a/test/test_events.py
17+
+++ b/test/test_events.py
18+
@@ -1,4 +1,5 @@
19+
-# -*- coding: utf-8 -*-
20+
+import pytest
21+
+
22+
from pynvim.api import Nvim
23+
24+
25+
@@ -37,6 +38,10 @@ def test_async_error(vim: Nvim) -> None:
26+
27+
28+
def test_broadcast(vim: Nvim) -> None:
29+
+ if (vim.version.major, vim.version.minor) < (0, 11):
30+
+ # see #570, neovim/neovim#28487
31+
+ pytest.skip("neovim/neovim#28487")
32+
+
33+
vim.command('call rpcnotify(0, "event1", 1, 2, 3)')
34+
vim.command('call rpcnotify(0, "event2", 4, 5, 6)')
35+
vim.command('call rpcnotify(0, "event2", 7, 8, 9)')
36+
--
37+
2.47.2
38+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Description: test_attach: Increase jobwait timeout
2+
Slower architectures, like riscv64, aren't completing the job
3+
in 500ms and therefore the test fails.
4+
Author: James McCoy <[email protected]>
5+
---
6+
diff --git i/test/test_attach.py w/test/test_attach.py
7+
index 25d0822..e64fc81 100644
8+
--- i/test/test_attach.py
9+
+++ w/test/test_attach.py
10+
@@ -128,7 +128,7 @@ def test_connect_stdio(vim: Nvim) -> None:
11+
'python3', '-c', remote_py_code,
12+
], {'rpc': True, 'on_stderr': 'OutputHandler'})
13+
assert jobid > 0
14+
- exitcode = vim.funcs.jobwait([jobid], 500)[0]
15+
+ exitcode = vim.funcs.jobwait([jobid], 5000)[0]
16+
messages = vim.command_output('messages')
17+
assert exitcode == 0, ("the python process failed, :messages =>\n\n" +
18+
messages)

debian/patches/series

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fix-tests-skip-failing-test_broadcast-on-neovim-0.11.patch
2+
fix-test_connect_stdio-invoke-python3-instead-of-pyt.patch
3+
increase-jobwait-timeout.patch

0 commit comments

Comments
 (0)