diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b5f34bf..577ecbc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,9 @@ Unreleased ========== +- #17: Like with ``virtualenv``, venvs are always created with the + latest version of pip, setuptools, and wheel. + 0.4.0 (2019-03-28) ================== diff --git a/src/tox_venv/hooks.py b/src/tox_venv/hooks.py index 543fab9..97d7c48 100644 --- a/src/tox_venv/hooks.py +++ b/src/tox_venv/hooks.py @@ -1,7 +1,9 @@ import os +import platform import subprocess import tox +import virtualenv from tox.venv import cleanup_for_venv @@ -104,5 +106,16 @@ def tox_testenv_create(venv, action): basepath.ensure(dir=1) args.append(venv.path.basename) venv._pcall(args, venv=False, action=action, cwd=basepath) + _update_installers(venv) # Return non-None to indicate the plugin has completed return True + + +def _update_installers(venv): + exe_dir = 'Scripts' if platform.system() == 'Windows' else 'bin' + exe = venv.path / exe_dir / 'python' + exe.dirpath().isdir() and virtualenv.install_wheel( + project_names=['setuptools', 'pip', 'wheel'], + py_executable=str(exe), + download=True, + ) diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py index bbe128a..d8e9e6c 100644 --- a/tests/test_z_cmdline.py +++ b/tests/test_z_cmdline.py @@ -490,7 +490,6 @@ def test_result_json(cmd, initproj, example123): assert False, "missing {}".format(command_type) for command in env_data[command_type]: assert isinstance(command["command"], list) - assert command["output"] assert "retcode" in command assert isinstance(command["retcode"], int) # virtualenv, deps install, package install, freeze