Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add Lua Rocks for rocks.nvim #180

Open
EmDash00 opened this issue Apr 6, 2024 · 7 comments
Open

[Feature Request] Add Lua Rocks for rocks.nvim #180

EmDash00 opened this issue Apr 6, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@EmDash00
Copy link

EmDash00 commented Apr 6, 2024

Would be great if we could get a Lua rock up with the new rocks.nvim package manager.

@EmDash00 EmDash00 added the enhancement New feature or request label Apr 6, 2024
@EmDash00 EmDash00 changed the title [Feature Request] <Your title here> Add Lua Rocks for rocks.nvim Apr 6, 2024
@EmDash00 EmDash00 changed the title Add Lua Rocks for rocks.nvim [Feature Request] Add Lua Rocks for rocks.nvim Apr 6, 2024
@benlubas
Copy link
Owner

benlubas commented Apr 7, 2024

Yeah, but how? this is a plugin built with python, it has python dependencies which rocks cannot install.

I've seen there are some tools to package python applications (and their deps) into a single binary but I haven't spent too much time looking into them b/c I just don't think that it's worth it (not to mention that I'm not sure it will work b/c it needs to (should) use neovim's python3 path). Rocks.nvim folks can still install this plugin from git.

If you have any suggestions or want to look into it I'm happy to start a conversation and help out if you find a way to do it.

@EmDash00
Copy link
Author

I know poetry exists and I use that. I can look into the process to see if it's possible. Would greatly simplify the install process for most people since you can include image.nvim as a dependency. I'll go ask the rocks.nvim folks to see if they have thoughts.

@benlubas
Copy link
Owner

Thanks for looking into it. Ping me when you ask so I can keep an eye on it, simplifying the install process would make my life a lot easier

@mrcjkb
Copy link

mrcjkb commented Jul 27, 2024

Hey 👋

one of the rocks.nvim maintainers here. I've been browsing through this plugin's docs.
Here are my thoughts so far:

  • The recommended way to install the python dependencies is into a virtualenv.
    Something like a luarocks-build-poetry-nvim build backend for luarocks could potentially solve this.
    We have similar build backends for tree-sitter parsers and for Rust/mlua projects.
  • However, it looks like Neovim would need to be configured to use the venv.
    This is a manual step that I don't see as being possible to automate with luarocks.
  • Another issue: Installing a luarocks package shouldn't pollute anything outside of the install tree.
    • Creating a ~/.virtualenv/neovim violates this principle.
    • Installing python packages globally also violates this principle.
    • Creating a ~/.local/share/nvim/rocks/.virtualenv doesn't.
  • An option might be to for the build backend to create a virtualenv in the luarocks install tree.
    And rocks.nvim could configure Neovim to use that virtualenv.
    I'm not sure yet if this is a good idea. And there's still the open question about how or whether to clean up the python dependencies on removal.
  • As of today, it appears that this plugin requires a manual installation of the python dependencies, regardless of which plugin manager is used to install it.
    So maybe it makes sense to publish it to luarocks first, with only Lua dependencies, and then to worry about the python dependencies later?

@benlubas
Copy link
Owner

idk, I don't see any real advantage to using luarocks. This plugins only lua dependencies are optional. The python deps are the only required ones, and luarocks provides nothing there. Publishing on luarocks might just lead to confusion.

I'm considering a rewrite of this plugin to use rust with mlua to avoid python and remote plugins as a whole, at which point I will absolutely publish on luarocks.

@mrcjkb
Copy link

mrcjkb commented Jul 28, 2024

Does any functionality not work without any of the image providers being installed?
If so, then adding one of them to the luarocks dependencies as a default provider can improve the user experience (as long as it's possible to override the setting).

rocks.nvim installs dependencies as libraries, not plugins. So adding an optional dependency as a default isn't a big deal like it is for conventional plugin managers.

@benlubas
Copy link
Owner

Images don't render in this plugin by default b/c they're really janky. But yeah, without image.nvim or the wezterm plugin, images can't render in the terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants