GCBallesteros / jupytext.nvim

Jupyter notebooks on neovim powered by Jupytext
77 stars 14 forks source link

Checkhealth reports an error on Windows, even if the jupytext executable is accessible #13

Closed dacid44 closed 8 months ago

dacid44 commented 8 months ago

Windows doesn't have a which executable. Powershell uses Get-Command (alias gcm), or there is the where program. Because of this, the which jupytext that jupytext.nvim executes during its checkhealth will always return an error on Windows (as it can't find the which program, regardless of whether the jupytext program is available.) Could the checkhealth maybe instead try to execute something like jupytext --version? I think this would be a decent cross-platform solution.

Here's the offending line: https://github.com/GCBallesteros/jupytext.nvim/blob/6c9a8721bb24ffc3845632f22aa32b4cfe7ac814/lua/jupytext/health.lua#L5

Even better would be if jupytext.nvim could execute the equivalent of python -m jupytext for the active neovim python provider, so jupytext doesn't have to be installed globally, but I'd guess that's probably a bit more complicated.

I'm not the best with Lua, but I could probably submit a quick PR for this.

GCBallesteros commented 8 months ago

Hi @dacid44 thanks for bringing this up. Please feel free to open a PR for this.