Skip to content

Commit aed9f1c

Browse files
committed
bin_dir relative to pip
1 parent 066fbfc commit aed9f1c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/test_project.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import subprocess
33
from pathlib import Path
4+
from shutil import which
45
from sys import platform, executable
56
from typing import Sequence
67

@@ -33,16 +34,17 @@ def baked_with_development_dependencies(cookies):
3334
if platform.startswith("win") and os.environ.get('CI', False):
3435
# Creating virtualenv does not work on Windows CI,
3536
# falling back to using current Python
36-
bin_dir = str(Path(executable).parent) + '\\'
37+
pip = Path(which('pip3'))
38+
bin_dir = str(pip.parent) + '\\'
3739
print(bin_dir)
3840
print(list(Path(bin_dir).iterdir()))
3941
else:
4042
env_output = run(['python3', '-m', 'venv', 'env'], result.project)
4143
assert env_output.returncode == 0
4244
bin_dir = 'env/Scripts/' if platform.startswith("win") else 'env/bin/'
43-
latest_pip_output = run([f'{bin_dir}pip', 'install', '--upgrade', 'pip', 'setuptools'], result.project)
45+
latest_pip_output = run([f'{bin_dir}pip3', 'install', '--upgrade', 'pip', 'setuptools'], result.project)
4446
assert latest_pip_output.returncode == 0
45-
pip_output = run([f'{bin_dir}pip', 'install', '--editable', '.[dev]'], result.project)
47+
pip_output = run([f'{bin_dir}pip3', 'install', '--editable', '.[dev]'], result.project)
4648
assert pip_output.returncode == 0
4749
return result.project, bin_dir
4850

0 commit comments

Comments
 (0)