Skip to content

Commit

Permalink
Merge branch 'master' into bug/check-web-deepExtract
Browse files Browse the repository at this point in the history
  • Loading branch information
kirankotari authored May 3, 2023
2 parents 4cfba98 + 8698a2e commit 006cb9c
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 62 deletions.
140 changes: 90 additions & 50 deletions pyenv-win/.versions_cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2765,6 +2765,16 @@
<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.10.11-win32</code>
<file>python-3.10.11.exe</file>
<URL>https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.10.11</code>
<file>python-3.10.11-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.10.11/python-3.10.11-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 @@ -2805,46 +2815,46 @@
<file>python-3.11.0a4-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a4-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0a5-win32</code>
<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="false" webInstall="false" msi="false">
<code>3.11.0a5-win32</code>
<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</code>
<file>python-3.11.0a5-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a5-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0a6-win32</code>
<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="false" webInstall="false" msi="false">
<code>3.11.0a6-win32</code>
<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</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="false" webInstall="false" msi="false">
<code>3.11.0a7-win32</code>
<file>python-3.11.0a7.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a7.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>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0a7.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.0a7</code>
<file>python-3.11.0a7-amd64.exe</file>
Expand Down Expand Up @@ -2910,16 +2920,16 @@
<file>python-3.11.0b4-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0b4-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.11.0b5-win32</code>
<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="false" webInstall="false" msi="false">
<code>3.11.0b5-win32</code>
<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</code>
<file>python-3.11.0b5-amd64.exe</file>
Expand All @@ -2940,16 +2950,16 @@
<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>
<URL>https://www.python.org/ftp/python/3.11.0/python-3.11.0rc2.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="true" webInstall="false" msi="false">
<code>3.11.0rc2</code>
<file>python-3.11.0rc2-amd64.exe</file>
Expand All @@ -2970,36 +2980,51 @@
<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="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="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="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="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.11.3-win32</code>
<file>python-3.11.3.exe</file>
<URL>https://www.python.org/ftp/python/3.11.3/python-3.11.3.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.3-arm</code>
<file>python-3.11.3-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.3/python-3.11.3-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.11.3</code>
<file>python-3.11.3-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.11.3/python-3.11.3-amd64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a1-win32</code>
<file>python-3.12.0a1.exe</file>
Expand All @@ -3015,16 +3040,16 @@
<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>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a2.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="true" webInstall="false" msi="false">
<code>3.12.0a2</code>
<file>python-3.12.0a2-amd64.exe</file>
Expand All @@ -3045,16 +3070,16 @@
<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-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="true" webInstall="false" msi="false">
<code>3.12.0a4</code>
<file>python-3.12.0a4-amd64.exe</file>
Expand All @@ -3075,19 +3100,34 @@
<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>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a6-arm</code>
<file>python-3.12.0a6-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a6-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a6-win32</code>
<file>python-3.12.0a6.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a6.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a6-arm</code>
<file>python-3.12.0a6-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a6-arm64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a6</code>
<file>python-3.12.0a6-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a6-amd64.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a7-arm</code>
<file>python-3.12.0a7-arm64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a7-arm64.exe</URL>
</version>
<version x64="false" webInstall="false" msi="false">
<code>3.12.0a7-win32</code>
<file>python-3.12.0a7.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a7.exe</URL>
</version>
<version x64="true" webInstall="false" msi="false">
<code>3.12.0a7</code>
<file>python-3.12.0a7-amd64.exe</file>
<URL>https://www.python.org/ftp/python/3.12.0/python-3.12.0a7-amd64.exe</URL>
</version>
</versions>
11 changes: 10 additions & 1 deletion pyenv-win/libexec/pyenv-install.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ Function deepExtract(params, web)
' Windows try to execute pythonX.Y file (considers Y as en extension)
' It requires explicit .bat extension to work (pythonX.Y.bat)
' That's why we also use the pattern pythonXY
Dim version, pythonExe, pythonwExe, major, minor, majorMinor, majorDotMinor
Dim version, pythonExe, pythonwExe, venvlauncherExe, major, minor, majorMinor, majorDotMinor
version = params(LV_Code)
pythonExe = installPath &"\python.exe"
pythonwExe = installPath &"\pythonw.exe"
venvlauncherExe = installPath &"\Lib\venv\scripts\nt\python.exe"
major = Split(version,".")(0)
minor = Split(version, ".")(1)
majorMinor = major & minor
Expand All @@ -165,6 +166,14 @@ Function deepExtract(params, web)
objfs.CopyFile pythonwExe, installPath &"\pythonw"& major &".exe"
objfs.CopyFile pythonwExe, installPath &"\pythonw"& majorMinor &".exe"
objfs.CopyFile pythonwExe, installPath &"\pythonw"& majorDotMinor &".exe"
If objfs.FileExists(venvlauncherExe) Then
objfs.CopyFile venvlauncherExe, installPath &"\Lib\venv\scripts\nt\python"& major &".exe"
objfs.CopyFile venvlauncherExe, installPath &"\Lib\venv\scripts\nt\python"& majorMinor &".exe"
objfs.CopyFile venvlauncherExe, installPath &"\Lib\venv\scripts\nt\python"& majorDotMinor &".exe"
objfs.CopyFile venvlauncherExe, installPath &"\Lib\venv\scripts\nt\pythonw"& major &".exe"
objfs.CopyFile venvlauncherExe, installPath &"\Lib\venv\scripts\nt\pythonw"& majorMinor &".exe"
objfs.CopyFile venvlauncherExe, installPath &"\Lib\venv\scripts\nt\pythonw"& majorDotMinor &".exe"
End If
End Function

Function unzip(installFile, installPath, zipRootDir)
Expand Down
26 changes: 19 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def pyenv_file(shell, bin_path, shell_ext):
@pytest.fixture(scope='session', autouse=True, params=['AMD64', 'X86'],
ids=['PYENV_FORCE_ARCH=AMD64', 'PYENV_FORCE_ARCH=X86'])
def arch(request):
arch = request.param
value = request.param
if request.session.testsfailed:
pytest.skip(f'Skipping PYENV_FORCE_ARCH={arch} since at lease one test failed for PYENV_FORCE_ARCH=AMD64')
with(TemporaryEnvironment({'PYENV_FORCE_ARCH': arch})):
yield arch
pytest.skip(f'Skipping PYENV_FORCE_ARCH={value} since at lease one test failed for PYENV_FORCE_ARCH=AMD64')
with(TemporaryEnvironment({'PYENV_FORCE_ARCH': value})):
yield value


@pytest.fixture()
Expand Down Expand Up @@ -105,10 +105,22 @@ def run(run_args, pyenv_path, bin_path, shims_path):
environ[key] = str(pyenv_path)
environ['PATH'] = environ['PATH'].replace(str(Path(os.environ[key])), environ[key])

def run(*args, env={}):
env = {**environ, **env}
def remove_python_paths(path):
path = Path(path)
if path.joinpath("python.exe").exists():
return False
if path.parent.name.lower() == "scripts" and path.parent.joinpath("python.exe").exists():
return False
return True

environ["PATH"] = os.pathsep.join(filter(remove_python_paths, environ["PATH"].split(os.pathsep)))
environ.pop("VIRTUAL_ENV", None)

def run(*args, **kwargs):
env = {**environ, **kwargs.pop("env", {})}
env.pop("PYTHONPATH", None)
args = run_args + list(args)
return do_run(*args, env=env)
return do_run(*args, env=env, **kwargs)

with TemporaryEnvironment({'PATH': environ['PATH']}):
return run
Expand Down
18 changes: 17 additions & 1 deletion tests/test_pyenv_feature_install.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import subprocess
import pytest

import os
from test_pyenv_helpers import Native


def test_check_pyenv_install_list(pyenv):
Expand Down Expand Up @@ -32,3 +35,16 @@ def test_check_pyenv_install_list(pyenv):
def test_check_pyenv_installation():
# TODO: tracking the logs of installation and checking the folder
pass


@pytest.mark.parametrize("version, python", (("3.9.13", "python39"), ("3.10.11", "python310"), ("3.11.3", "python311")))
def test_patched_venv_module(version, python, arch, pyenv, run, tmp_path):
if arch != os.environ["PROCESSOR_ARCHITECTURE"]:
pytest.skip()
pyenv.install(Native(version), check=True)
pyenv.rehash(check=True)
pyenv("global", Native(version), check=True)
pyenv.exec(python, "-m", "venv", str(tmp_path / "venv"), check=True)
stdout, stderr = run(str(tmp_path / "venv" / "Scripts" / "pip.exe"), "--version")
assert stderr == "", stdout

Loading

0 comments on commit 006cb9c

Please sign in to comment.