Set environment before calling which

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-10-26 19:06:39 -04:00
parent 0135ab6571
commit 2803538701
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ steps:
export GIT_SSL_CAINFO="$(python -m certifi)"
export LANG="C.UTF-8"
export PIP_PROCESS_DEPENDENCY_LINKS="1"
echo "Path: $PATH"
echo "Path $PATH"
echo "Installing Pipenv…"
pip install -e "$(pwd)" --upgrade
pipenv install --deploy --dev
+2
View File
@@ -8,7 +8,9 @@ steps:
# https://bugs.python.org/issue18199
subst T: "$env:TEMP"
Write-Host "##vso[task.setvariable variable=TEMP]T:\"
$env:TEMP='T:\'
Write-Host "##vso[task.setvariable variable=TMP]T:\"
$env:TEMP='T:\'
Get-ChildItem Env:
D:\.venv\Scripts\pipenv run pytest -n 4 -ra --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
displayName: Run integration tests
+4 -1
View File
@@ -1520,6 +1520,10 @@ def which_pip(allow_global=False):
def system_which(command, mult=False):
"""Emulates the system's which. Returns None if not found."""
_which = "which -a" if not os.name == "nt" else "where"
os.environ = {
vistir.compat.fs_str(k): vistir.compat.fs_str(val)
for k, val in os.environ.items()
}
c = delegator.run("{0} {1}".format(_which, command))
try:
# Which Not found…
@@ -2223,7 +2227,6 @@ def _launch_windows_subprocess(script):
def do_run_nt(script):
os.environ = {k: vistir.compat.fs_str(val) for k, val in os.environ.items()}
p = _launch_windows_subprocess(script)
p.communicate()
sys.exit(p.returncode)