From e2a583cda7f29710845e4d8072d150ab47699c9d Mon Sep 17 00:00:00 2001 From: Platy Date: Thu, 4 Jul 2024 08:40:45 +0800 Subject: [PATCH 1/3] fix: jupytext ignoring python3_host_prog Signed-off-by: Platy --- lua/jupytext/commands.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/jupytext/commands.lua b/lua/jupytext/commands.lua index b445e63..fd36a23 100644 --- a/lua/jupytext/commands.lua +++ b/lua/jupytext/commands.lua @@ -1,7 +1,12 @@ local M = {} M.run_jupytext_command = function(input_file, options) - local cmd = "jupytext " .. input_file .. " " + local cmd = "" + if vim.g.python3_host_prog ~= nil then + cmd = vim.g.python3_host_prog .. " -m " + end + + cmd = cmd .. "jupytext " .. input_file .. " " for option_name, option_value in pairs(options) do if option_value ~= "" then cmd = cmd .. option_name .. "=" .. option_value .. " " From 0683edb63bfb560a5c82f89f9ab9cbf5ca907fd6 Mon Sep 17 00:00:00 2001 From: Platy Date: Fri, 21 Feb 2025 11:03:16 +0800 Subject: [PATCH 2/3] fix: prioritise jupytext in PATH over python3_host_prog Prevents existing configurations from breaking. --- lua/jupytext/commands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/jupytext/commands.lua b/lua/jupytext/commands.lua index fd36a23..4a2ce90 100644 --- a/lua/jupytext/commands.lua +++ b/lua/jupytext/commands.lua @@ -2,7 +2,7 @@ local M = {} M.run_jupytext_command = function(input_file, options) local cmd = "" - if vim.g.python3_host_prog ~= nil then + if vim.g.python3_host_prog ~= nil and vim.fn.executable "jupytext" == 0 then cmd = vim.g.python3_host_prog .. " -m " end From d4a82c584f5f3f37cad18061bca746e23afe9e69 Mon Sep 17 00:00:00 2001 From: Platy Date: Fri, 21 Feb 2025 11:06:50 +0800 Subject: [PATCH 3/3] fix: healthcheck --- lua/jupytext/health.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/jupytext/health.lua b/lua/jupytext/health.lua index 7a8f45d..ff6fa0e 100644 --- a/lua/jupytext/health.lua +++ b/lua/jupytext/health.lua @@ -2,7 +2,13 @@ local M = {} M.check = function() vim.health.report_start "jupytext.nvim" - vim.fn.system "jupytext --version" + + local cmd = "" + if vim.g.python3_host_prog ~= nil and vim.fn.executable "jupytext" == 0 then + cmd = vim.g.python3_host_prog .. " -m " + end + + vim.fn.system(cmd .. "jupytext --version") if vim.v.shell_error == 0 then vim.health.report_ok "Jupytext is available"