diff options
| author | William Boman <william@redwill.se> | 2024-01-21 18:47:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-21 18:47:59 +0100 |
| commit | bce96d2fd483e71826728c6f9ac721fc9dd7d2cf (patch) | |
| tree | f5e819529129791740c855c47c1b0675c15bfd63 /lua | |
| parent | fix(ui): don't indent empty lines (#1597) (diff) | |
| download | mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.gz mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.bz2 mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.lz mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.xz mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.zst mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.zip | |
feat: don't use vim.g.python3_host_prog as a candidate for python (#1606)
This is inconsistent with how other system dependencies are resolved and is not
documented anywhere.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/mason-core/installer/managers/pypi.lua | 8 | ||||
| -rw-r--r-- | lua/mason-core/managers/pip3/init.lua | 4 | ||||
| -rw-r--r-- | lua/mason/health.lua | 18 |
3 files changed, 2 insertions, 28 deletions
diff --git a/lua/mason-core/installer/managers/pypi.lua b/lua/mason-core/installer/managers/pypi.lua index 0f3de1fb..7c0e5bb9 100644 --- a/lua/mason-core/installer/managers/pypi.lua +++ b/lua/mason-core/installer/managers/pypi.lua @@ -72,13 +72,7 @@ function M.init(opts) a.scheduler() - local executables = platform.is.win - and _.list_not_nil( - vim.g.python3_host_prog and vim.fn.expand(vim.g.python3_host_prog), - "python", - "python3" - ) - or _.list_not_nil(vim.g.python3_host_prog and vim.fn.expand(vim.g.python3_host_prog), "python3", "python") + local executables = platform.is.win and { "python", "python3" } or { "python3", "python" } -- pip3 will hardcode the full path to venv executables, so we need to promote cwd to make sure pip uses the final destination path. ctx:promote_cwd() diff --git a/lua/mason-core/managers/pip3/init.lua b/lua/mason-core/managers/pip3/init.lua index 36ad6fc7..813bc9ea 100644 --- a/lua/mason-core/managers/pip3/init.lua +++ b/lua/mason-core/managers/pip3/init.lua @@ -48,9 +48,7 @@ function M.install(packages) a.scheduler() - local executables = platform.is.win - and _.list_not_nil(vim.g.python3_host_prog and vim.fn.expand(vim.g.python3_host_prog), "python", "python3") - or _.list_not_nil(vim.g.python3_host_prog and vim.fn.expand(vim.g.python3_host_prog), "python3", "python") + local executables = platform.is.win and { "python", "python3" } or { "python3", "python" } -- pip3 will hardcode the full path to venv executables, so we need to promote cwd to make sure pip uses the final destination path. ctx:promote_cwd() diff --git a/lua/mason/health.lua b/lua/mason/health.lua index 190a6972..1f8a225f 100644 --- a/lua/mason/health.lua +++ b/lua/mason/health.lua @@ -280,24 +280,6 @@ local function check_languages() } end end, - function() - a.scheduler() - if vim.g.python3_host_prog then - check { - cmd = vim.fn.expand(vim.g.python3_host_prog), - args = { "--version" }, - name = "python3_host_prog", - relaxed = true, - } - a.scheduler() - check { - cmd = vim.fn.expand(vim.g.python3_host_prog), - args = { "-m", "pip", "--version" }, - name = "python3_host_prog pip", - relaxed = true, - } - end - end, } end |
