Skip to content

Commit

Permalink
Merge branch 'master' into feature/shims.lnk_for_exe_files
Browse files Browse the repository at this point in the history
  • Loading branch information
kirankotari authored Feb 16, 2023
2 parents b1a5c57 + 5cf0fa8 commit ba9ef34
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This project was forked from [rbenv-win][3] and modified for [pyenv][1]. It is n
```

2. Reopen PowerShell
3. Run `pyenv --version` to check the installation done
3. Run `pyenv --version` to check if the installation was successful.
4. Run `pyenv install -l` to check a list of Python versions supported by pyenv-win
5. Run `pyenv install <version>` to install the supported version
6. Run `pyenv global <version>` to set a Python version as the global version
Expand Down
3 changes: 3 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@

- **Question:** pyenv-win is not recognised, but I have set the ENV PATH?
- **Answer:** According to Windows, when adding a path under the User variable you need to logout and login again, in order to reflect any change. For the System variable it's not required.

**Question:** How do I configure my company proxy in pyenv for windows?
- **Answer:** Set the `http_proxy` or `https_proxy` environment variable with the hostname or IP address of the proxy server in URL format, for example: `http://username:password@hostname:port/` or `http://hostname:port/`
160 changes: 160 additions & 0 deletions pyenv-win/.versions_cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2745,6 +2745,26 @@
<file>python-3.10.8-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.10.9-win32</code>
<file>python-3.10.9.exe</file>
<URL>https://www.python.org/ftp/python/3.10.9/python-3.10.9.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.10.9</code>
<file>python-3.10.9-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.10.9/python-3.10.9-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.10.10-win32</code>
<file>python-3.10.10.exe</file>
<URL>https://www.python.org/ftp/python/3.10.10/python-3.10.10.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.10.10</code>
<file>python-3.10.10-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.10.10/python-3.10.10-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0a1-win32</code>
<file>python-3.11.0a1.exe</file>
Expand Down Expand Up @@ -2790,6 +2810,11 @@
<file>python-3.11.0a5.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a5.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0a5-arm</code>
<file>python-3.11.0a5-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a5-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0a5</code>
<file>python-3.11.0a5-amd64.exe</file>
Expand All @@ -2800,11 +2825,21 @@
<file>python-3.11.0a6.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a6.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0a6-arm</code>
<file>python-3.11.0a6-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a6-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0a6</code>
<file>python-3.11.0a6-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a6-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0a7-arm</code>
<file>python-3.11.0a7-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a7-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0a7-win32</code>
<file>python-3.11.0a7.exe</file>
Expand All @@ -2815,6 +2850,11 @@
<file>python-3.11.0a7-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a7-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b1-arm</code>
<file>python-3.11.0b1-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b1-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0b1-win32</code>
<file>python-3.11.0b1.exe</file>
Expand All @@ -2825,6 +2865,11 @@
<file>python-3.11.0b1-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b1-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b2-arm</code>
<file>python-3.11.0b2-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b2-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0b2-win32</code>
<file>python-3.11.0b2.exe</file>
Expand All @@ -2840,6 +2885,11 @@
<file>python-3.11.0b3.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b3.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b3-arm</code>
<file>python-3.11.0b3-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b3-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b3</code>
<file>python-3.11.0b3-amd64.exe</file>
Expand All @@ -2850,6 +2900,11 @@
<file>python-3.11.0b4.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b4.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b4-arm</code>
<file>python-3.11.0b4-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b4-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b4</code>
<file>python-3.11.0b4-amd64.exe</file>
Expand All @@ -2860,11 +2915,21 @@
<file>python-3.11.0b5.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b5.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b5-arm</code>
<file>python-3.11.0b5-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b5-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0b5</code>
<file>python-3.11.0b5-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b5-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0rc1-arm</code>
<file>python-3.11.0rc1-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0rc1-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0rc1-win32</code>
<file>python-3.11.0rc1.exe</file>
Expand All @@ -2875,6 +2940,11 @@
<file>python-3.11.0rc1-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0rc1-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0rc2-arm</code>
<file>python-3.11.0rc2-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0rc2-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0rc2-win32</code>
<file>python-3.11.0rc2.exe</file>
Expand All @@ -2885,6 +2955,11 @@
<file>python-3.11.0rc2-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0rc2-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0-arm</code>
<file>python-3.11.0-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0-win32</code>
<file>python-3.11.0.exe</file>
Expand All @@ -2895,16 +2970,56 @@
<file>python-3.11.0-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.1-win32</code>
<file>python-3.11.1.exe</file>
<URL>https://www.python.org/ftp/python/3.11.1/python-3.11.1.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.1-arm</code>
<file>python-3.11.1-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.1/python-3.11.1-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.1</code>
<file>python-3.11.1-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.1/python-3.11.1-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.2-win32</code>
<file>python-3.11.2.exe</file>
<URL>https://www.python.org/ftp/python/3.11.2/python-3.11.2.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.2-arm</code>
<file>python-3.11.2-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.2/python-3.11.2-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.2</code>
<file>python-3.11.2-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.2/python-3.11.2-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a1-win32</code>
<file>python-3.12.0a1.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a1.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a1-arm</code>
<file>python-3.12.0a1-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a1-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a1</code>
<file>python-3.12.0a1-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a1-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a2-arm</code>
<file>python-3.12.0a2-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a2-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a2-win32</code>
<file>python-3.12.0a2.exe</file>
Expand All @@ -2915,4 +3030,49 @@
<file>python-3.12.0a2-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a2-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a3-arm</code>
<file>python-3.12.0a3-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a3-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a3-win32</code>
<file>python-3.12.0a3.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a3.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a3</code>
<file>python-3.12.0a3-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a3-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a4-arm</code>
<file>python-3.12.0a4-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a4-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a4-win32</code>
<file>python-3.12.0a4.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a4.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a4</code>
<file>python-3.12.0a4-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a4-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a5-arm</code>
<file>python-3.12.0a5-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a5-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a5-win32</code>
<file>python-3.12.0a5.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a5.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a5</code>
<file>python-3.12.0a5-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a5-amd64.exe</URL>
</version>
</versions>
17 changes: 12 additions & 5 deletions pyenv-win/libexec/libs/pyenv-install-lib.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ Const VRX_Patch = 2
Const VRX_Release = 3
Const VRX_RelNumber = 4
Const VRX_x64 = 5
Const VRX_Web = 6
Const VRX_Ext = 7
Const VRX_ARM = 6
Const VRX_Web = 7
Const VRX_Ext = 8

' Version definition array from LoadVersionsXML.
Const LV_Code = 0
Expand All @@ -28,6 +29,7 @@ Const LV_x64 = 3
Const LV_Web = 4
Const LV_MSI = 5
Const LV_ZipRootDir = 6
' Const LV_ARM = 7 # need to validate what number is this

' Installation parameters used for clear/extract, extension of LV.
Const IP_InstallPath = 7
Expand All @@ -45,7 +47,7 @@ With regexVer
.IgnoreCase = True
End With
With regexFile
.Pattern = "^python-(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:([a-z]+)(\d*))?([\.-]amd64)?(-webinstall)?\.(exe|msi)$"
.Pattern = "^python-(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:([a-z]+)(\d*))?([\.-]amd64)?([\.-]arm64)?(-webinstall)?\.(exe|msi)$"
.Global = True
.IgnoreCase = True
End With
Expand All @@ -59,7 +61,11 @@ Function JoinWin32String(pieces)
If Len(pieces(VRX_Patch)) Then JoinWin32String = JoinWin32String &"."& pieces(VRX_Patch)
If Len(pieces(VRX_Release)) Then JoinWin32String = JoinWin32String & pieces(VRX_Release)
If Len(pieces(VRX_RelNumber)) Then JoinWin32String = JoinWin32String & pieces(VRX_RelNumber)
If Len(pieces(VRX_x64)) = 0 Then JoinWin32String = JoinWin32String & "-win32"
If Len(pieces(VRX_ARM)) Then
JoinWin32String = JoinWin32String & "-arm"
ElseIf Len(pieces(VRX_x64)) = 0 Then
JoinWin32String = JoinWin32String & "-win32"
End If
End Function

' For x64 Arch
Expand All @@ -72,6 +78,7 @@ Function JoinInstallString(pieces)
If Len(pieces(VRX_Release)) Then JoinInstallString = JoinInstallString & pieces(VRX_Release)
If Len(pieces(VRX_RelNumber)) Then JoinInstallString = JoinInstallString & pieces(VRX_RelNumber)
If Len(pieces(VRX_x64)) Then JoinInstallString = JoinInstallString & pieces(VRX_x64)
If Len(pieces(VRX_ARM)) Then JoinInstallString = JoinInstallString & pieces(VRX_ARM)
If Len(pieces(VRX_Web)) Then JoinInstallString = JoinInstallString & pieces(VRX_Web)
If Len(pieces(VRX_Ext)) Then JoinInstallString = JoinInstallString &"."& pieces(VRX_Ext)
End Function
Expand Down Expand Up @@ -232,7 +239,7 @@ Sub SaveVersionsXML(xmlPath, versArray)
doc.documentElement.appendChild versElem

With versElem
.setAttribute "x64", LocaleIndependantCStr(CBool(Len(versRow(SFV_Version)(VRX_x64))))
.setAttribute "x64", LocaleIndependantCStr(CBool(Len(versRow(SFV_Version)(VRX_x64)) OR Len(versRow(SFV_Version)(VRX_ARM))))
.setAttribute "webInstall", LocaleIndependantCStr(CBool(Len(versRow(SFV_Version)(VRX_Web))))
.setAttribute "msi", LocaleIndependantCStr(LCase(versRow(SFV_Version)(VRX_Ext)) = "msi")
End With
Expand Down
29 changes: 19 additions & 10 deletions pyenv-win/libexec/libs/pyenv-lib.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ Sub SetProxy()
Dim proxyArr

httpProxy = objws.Environment("Process")("http_proxy")
If httpProxy <> "" Then
If InStr(1, httpProxy, "@") > 0 Then
' The http_proxy environment variable is set with basic authentication
' WinHttp seems to work fine without the credentials, so we should be
' okay with just the hostname/port part
proxyArr = Split(httpProxy, "@")
objweb.setProxy 2, proxyArr(1)
Else
objweb.setProxy 2, httpProxy
End If
If httpProxy = "" Then
httpProxy = objws.Environment("Process")("https_proxy")
End If

If httpProxy = "" Then Exit Sub

httpProxy = Replace(Replace(httpProxy, "http://", ""), "https://", "")
If Right(httpProxy, 1) = "/" Then
httpProxy = Left(httpProxy, Len(httpProxy) - 1)
End If

If InStr(1, httpProxy, "@") > 0 Then
' The http_proxy environment variable is set with basic authentication
' WinHttp seems to work fine without the credentials, so we should be
' okay with just the hostname/port part
proxyArr = Split(httpProxy, "@")
objweb.setProxy 2, proxyArr(1)
Else
objweb.setProxy 2, httpProxy
End If
End Sub
SetProxy
Expand Down
3 changes: 2 additions & 1 deletion pyenv-win/libexec/pyenv-install.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ Sub main(arg)
If Not versions.Exists(version) Then
WScript.Echo "pyenv-install: definition not found: "& version
WScript.Echo
WScript.Echo "See all available versions with `pyenv install --list'."
WScript.Echo "See all available versions with `pyenv install --list`."
WScript.Echo "Does the list seem out of date? Update it using `pyenv update`."
WScript.Quit 1
End If
Next
Expand Down
Loading

0 comments on commit ba9ef34

Please sign in to comment.