Commit 5073c205 by Arun Babu Neelicattu

env: align ephemeral environment interface to build

parent b21dd144
......@@ -450,7 +450,9 @@ class PackageInfo:
except PackageInfoError:
pass
with ephemeral_environment(pip=True, wheel=True, setuptools=True) as venv:
with ephemeral_environment(
with_pip=True, with_wheel=True, with_setuptools=True
) as venv:
# TODO: cache PEP 517 build environment corresponding to each project venv
dest_dir = venv.path.parent / "dist"
dest_dir.mkdir()
......
......@@ -1464,9 +1464,10 @@ class NullEnv(SystemEnv):
@contextmanager
def ephemeral_environment(
executable=None,
pip: bool = False,
wheel: Optional[bool] = None,
setuptools: Optional[bool] = None,
flags: Dict[str, bool] = None,
with_pip: bool = False,
with_wheel: Optional[bool] = None,
with_setuptools: Optional[bool] = None,
) -> ContextManager[VirtualEnv]:
with temporary_directory() as tmp_dir:
# TODO: cache PEP 517 build environment corresponding to each project venv
......@@ -1474,9 +1475,10 @@ def ephemeral_environment(
EnvManager.build_venv(
path=venv_dir.as_posix(),
executable=executable,
with_pip=pip,
with_wheel=wheel,
with_setuptools=setuptools,
flags=flags,
with_pip=with_pip,
with_wheel=with_wheel,
with_setuptools=with_setuptools,
)
yield VirtualEnv(venv_dir, venv_dir)
......
......@@ -47,7 +47,7 @@ def pip_install(
# Under certain Python3.6 installs vendored pip wheel does not contain zip-safe
# pep517 lib. In this cases we create an isolated ephemeral virtual environment.
with ephemeral_environment(
executable=environment.python, pip=True, setuptools=True
executable=environment.python, with_pip=True, with_setuptools=True
) as env:
return environment.run(
env._bin("pip"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment