Pass system flag to pyhon which

This commit is contained in:
Matt Davis
2023-07-02 06:52:40 -04:00
parent e6be3dd67f
commit 2d1037654f
3 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -1155,12 +1155,11 @@ class Project:
result = str(result.path)
return result
@property
def python(self) -> str:
def python(self, system=False) -> str:
"""Path to the project python"""
from pipenv.utils.shell import project_python
return project_python(self)
return project_python(self, system=system)
def _which(self, command, location=None, allow_global=False):
if not allow_global and location is None:
+1 -1
View File
@@ -79,4 +79,4 @@ def ensure_project(
skip_requirements=skip_requirements,
system=system,
)
os.environ["PIP_PYTHON_PATH"] = project.python
os.environ["PIP_PYTHON_PATH"] = project.python(system=system)
+2 -2
View File
@@ -1166,7 +1166,7 @@ def resolve_deps(
req_dir = req_dir if req_dir else os.environ.get("req_dir", None)
if not req_dir:
req_dir = create_tracked_tempdir(prefix="pipenv-", suffix="-requirements")
with HackedPythonVersion(python_path=project.python):
with HackedPythonVersion(python_path=project.python(system=allow_global)):
try:
results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
deps,
@@ -1185,7 +1185,7 @@ def resolve_deps(
# Second (last-resort) attempt:
if results is None:
with HackedPythonVersion(
python_path=project.python,
python_path=project.python(system=allow_global),
):
try:
# Attempt to resolve again, with different Python version information,