mhinz / neovim-remote

:ok_hand: Support for --remote and friends.
MIT License
1.75k stars 83 forks source link

684ad23 breaks installation on Arch Linux #131

Closed hexchain closed 4 years ago

hexchain commented 4 years ago

Arch Linux ships pynvim as-is, so pkg_resources failed to find the distribution called neovim.

Traceback (most recent call last):
  File "/usr/bin/nvr", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'neovim' distribution was not found and is required by neovim-remote
mhinz commented 4 years ago

I guess we talk about this package?

The issue is that this won't be good enough:

diff --git i/nvr/nvr.py w/nvr/nvr.py
index 20605b7..748c5b8 100644
--- i/nvr/nvr.py
+++ w/nvr/nvr.py
@@ -24,0 +25,5 @@ THE SOFTWARE.
+try:
+    import pynvim as neovim
+except ModuleNotFoundError:
+    import neovim
+
@@ -26 +30,0 @@ import argparse
-import neovim
@@ -35 +38,0 @@ import traceback
-

The problem is the neovim here. Unfortunately I don't see a good way to specify either one or the other, but some systems only provide neovim (Debian stable) and others only pynvim (Arch).

In the best case, the aur package would just depend on the neovim package for now (in case there is a package for that).

I'll see if I can find a better way in the meanwhile.

@jamessan Any thoughts on this?

hexchain commented 4 years ago

I guess we talk about this package?

Yes :)

The issue is that this won't be good enough:

diff --git i/nvr/nvr.py w/nvr/nvr.py
index 20605b7..748c5b8 100644
--- i/nvr/nvr.py
+++ w/nvr/nvr.py
@@ -24,0 +25,5 @@ THE SOFTWARE.
+try:
+    import pynvim as neovim
+except ModuleNotFoundError:
+    import neovim
+
@@ -26 +30,0 @@ import argparse
-import neovim
@@ -35 +38,0 @@ import traceback
-

The problem is the neovim here. Unfortunately I don't see a good way to specify either one or the other, but some systems only provide neovim (Debian stable) and others only pynvim (Arch).

In the best case, the aur package would just depend on the neovim package for now (in case there is a package for that).

Unfortunately no, in the official repository the name python-neovim is provided by python-pynvim, so there is only one pynvim (egg name, not import name) available in site-packages.

Currently, I'm just modifying setup.py to change the name back.

I'll see if I can find a better way in the meanwhile.

@jamessan Any thoughts on this?

I would actually prefer us to ignore issues that are hard (if not impossible) to solve cleanly due to old dependency versions. At least we should not break in a sane condition.

mhinz commented 4 years ago

Right, if there's a choice between breaking outdated and up-to-date systems, we should probably go for the former. I'm about to just change it back to require pynvim instead.

Systems who only provide the old neovim as package, must fall back to using pip3 directly in that case. Should be no problem, since Debian/Ubuntu doesn't seem to package neovim-remote anyway.

mhinz commented 4 years ago

@hexchain

After some more thinking about it, I'm pretty sure this way is the Right Thing To Do.

Thanks for bringing this up! :sparkles: