mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Pass system flag to pyhon which
This commit is contained in:
+2
-3
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user