From f1656ee6787f2459c191f3c42ecb328491c545cd Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Thu, 26 Dec 2019 00:00:37 +0900 Subject: Windows native python3(python.exe) and MSYS2 python3 support --- installer/pip_install.cmd | 25 +++++++++++++++++++++++++ settings.json | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/installer/pip_install.cmd b/installer/pip_install.cmd index 9b8a0b1..c551b7b 100644 --- a/installer/pip_install.cmd +++ b/installer/pip_install.cmd @@ -8,6 +8,30 @@ rd /Q /S "%server_dir%" 2>NUL md "%server_dir%" cd "%server_dir%" +where python && goto :python +:python_fail +where python3 && goto :python3 +:python3_fail +goto :EOF + +:python +python -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)" +if errorlevel 1 goto :python_fail + +python -m venv ./venv +venv\Scripts\pip3 install %2 + +echo @echo off ^ + +%%~dp0\venv\Scripts\%1.exe %%* ^ + +> %1.cmd +goto :EOF + +:python3 +python3 -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)" +if errorlevel 1 goto :python3_fail + python3 -m venv ./venv venv\bin\pip3 install %2 @@ -16,3 +40,4 @@ echo @echo off ^ %%~dp0\venv\bin\%1.cmd %%* ^ > %1.cmd +goto :EOF diff --git a/settings.json b/settings.json index 992d02d..27d76d6 100644 --- a/settings.json +++ b/settings.json @@ -40,6 +40,12 @@ } ], "python": [ + { + "command": "pyls", + "requires": [ + "py" + ] + }, { "command": "pyls", "requires": [ -- cgit v1.2.3-54-g00ecf