Skip to content

Commit

Permalink
executable -> python_executable
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Oct 21, 2020
1 parent 2f51666 commit b90c6b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/build/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ class IsolatedEnvironment(object):
Non-standard paths injected directly to sys.path still be passed to the environment.
"""

def __init__(self, path, executable, install_executable):
def __init__(self, path, python_executable, install_executable):
# type: (str, str, str) -> None
"""
Define an isolated build environment.
:param path: the path where the environment exists
:param executable: the python executable within the environment
:param python_executable: the python executable within the environment
:param install_executable: an executable that allows installing packages within the environment
"""
self._path = path
self._install_executable = install_executable
self._executable = executable
self._python_executable = python_executable

@classmethod
def for_current(cls): # type: () -> IsolatedEnvironment
Expand All @@ -46,7 +46,7 @@ def for_current(cls): # type: () -> IsolatedEnvironment
"""
path = tempfile.mkdtemp(prefix='build-env-')
executable, pip_executable = _create_isolated_env(path)
return cls(path=path, executable=executable, install_executable=pip_executable)
return cls(path=path, python_executable=executable, install_executable=pip_executable)

def __enter__(self): # type: () -> IsolatedEnvironment
"""Enable the isolated build environment"""
Expand Down Expand Up @@ -76,7 +76,7 @@ def path(self): # type: () -> str
@property
def executable(self): # type: () -> str
""":return: the python executable of the isolated build environment"""
return self._executable
return self._python_executable

def install(self, requirements): # type: (Iterable[str]) -> None
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_isolated_environment_install(mocker):
args = subprocess.check_call.call_args[0][0][:-1]
assert args == [
env._install_executable,
'-{}m'.format('E' if env._install_executable == env._executable and sys.version_info[0] == 2 else ''),
'-{}m'.format('E' if env._install_executable == env._python_executable and sys.version_info[0] == 2 else ''),
'pip',
'install',
'--prefix',
Expand Down

0 comments on commit b90c6b0

Please sign in to comment.