Python: Dismiss local python installation if pip is not present (#1627)

* Python: Dismiss local python installation if pip is not present

* Update xmake.lua
pull/1629/head
Jérôme Leclercq 2 years ago committed by GitHub
parent 9c5059214a
commit da7167c03a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      packages/p/python/xmake.lua

@ -87,11 +87,23 @@ package("python")
if not result then
result = package:find_tool("python", opt)
end
if result then
-- check if pip, setuptools and wheel are installed
local ok = try { function ()
os.vrunv(result.program, {"-c", "import pip"})
os.vrunv(result.program, {"-c", "import setuptools"})
os.vrunv(result.program, {"-c", "import wheel"})
return true
end}
if not ok then
return false
end
end
return result
end
end)
on_install("@windows", "@msys", "@cygwin", function (package)
on_install("@windows|x86", "@windows|x64", "@msys", "@cygwin", function (package)
if package:version():ge("3.0") then
os.cp("python.exe", path.join(package:installdir("bin"), "python3.exe"))
else

Loading…
Cancel
Save