From 2a2fc4b2589bf4d5c853c0a8f4b7dd970219ed2d Mon Sep 17 00:00:00 2001 From: doyle Date: Mon, 2 Nov 2020 23:33:46 +1100 Subject: [PATCH] python: Download and install pip --- Installer/_vimrc | 4 ++-- Installer/win32_cmder_user_profile.cmd | 4 ++-- Installer/win32_python36._pth | 5 +++++ win32_install.bat | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 Installer/win32_python36._pth diff --git a/Installer/_vimrc b/Installer/_vimrc index 41a28a3..c76a900 100644 --- a/Installer/_vimrc +++ b/Installer/_vimrc @@ -211,8 +211,8 @@ noremap :=printf("Leaderf! rg -e %s ", expand("")) " Clang Format " ============================================================================== if s:running_windows - map :pyf $home\.vim\clang-format.py - imap :pyf $home\.vim\clang-format.pyi + map :py3f $home\.vim\clang-format.py + imap :py3f $home\.vim\clang-format.pyi else map :py3f ~/.vim/clang-format.py imap :py3f ~/.vim/clang-format.pyi diff --git a/Installer/win32_cmder_user_profile.cmd b/Installer/win32_cmder_user_profile.cmd index ec12f11..bc27e8a 100644 --- a/Installer/win32_cmder_user_profile.cmd +++ b/Installer/win32_cmder_user_profile.cmd @@ -17,8 +17,8 @@ :: %ccall% "/customOption" "command/program" @echo off -set PATH=%cmder_root%\bin\python;%PATH% +set PATH=%cmder_root%\bin\python;%cmder_root%\bin\python\Scripts;%PATH% set HOME=%cmder_root%\..\Home set HOMEPATH=%cmder_root%\..\Home set USERPROFILE=%cmder_root%\..\Home -alias gvim=%cmder_root%\..\GVim\gVimPortable.exe $* \ No newline at end of file +alias gvim=%cmder_root%\..\GVim\gVimPortable.exe $* diff --git a/Installer/win32_python36._pth b/Installer/win32_python36._pth new file mode 100644 index 0000000..0f9f7d1 --- /dev/null +++ b/Installer/win32_python36._pth @@ -0,0 +1,5 @@ +python36.zip +. + +# Uncomment to run site.main() automatically +import site diff --git a/win32_install.bat b/win32_install.bat index cd75c6e..7d62ba7 100644 --- a/win32_install.bat +++ b/win32_install.bat @@ -84,12 +84,26 @@ set python_zip=python-%python_version%-embed-win32.zip set python_url=https://www.python.org/ftp/python/%python_version%/%python_zip% set python_zip_dest=Installer\%python_zip% set python_dest=%cmder_root%\bin\python + echo - Downloading from %python_url% to %python_zip_dest% if not exist "%python_zip_dest%" powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %python_url% -OutFile %python_zip_dest%" echo - Unzip %python_zip_dest% to %python_dest% if not exist "%python_dest%" Installer\win32_7za.exe x -y -o%python_dest% %python_zip_dest% > NUL +REM Python Pip Setup +set python_pth_file=Installer\win32_python36._pth +set python_pth_dest_file=%python_dest%\python36._pth +echo - Copy %python_pth_file% to %python_pth_dest_file% +copy /Y %python_pth_file% %python_pth_dest_file% > NUL + +REM Python Pip +set python_pip_url=https://bootstrap.pypa.io/get-pip.py +set python_pip_file=%python_dest%\get-pip.py +echo - Downloading from %python_pip_url% to %python_pip_file% +if not exist "%python_pip_file%" powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %python_pip_url% -OutFile %python_pip_file%" +if not exist "%python_dest%\Scripts\pip.exe" %python_dest%\python %python_pip_file% + REM REM ctags, scanmapset (bind capslock to escape via registry), uncap (bind capslock to escape whilst program running shim) REM