Merge pull request #5334 from pypa/earlier-dot-env-load

Load the dot env earlier
This commit is contained in:
Oz N Tiram
2022-09-07 19:52:52 +02:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
Load the dot env earlier so that ``PIPENV_CUSTOM_VENV_NAME`` is more useful across projects.
+3 -3
View File
@@ -2731,6 +2731,9 @@ def do_run(
"""
from .cmdparse import ScriptEmptyError
load_dot_env(project, quiet=quiet)
env = os.environ.copy()
# Ensure that virtualenv is available.
ensure_project(
project,
@@ -2740,9 +2743,6 @@ def do_run(
pypi_mirror=pypi_mirror,
)
load_dot_env(project, quiet=quiet)
env = os.environ.copy()
path = env.get("PATH", "")
if project.virtualenv_location:
new_path = os.path.join(