Skip to content

Commit

Permalink
Merge pull request #5334 from pypa/earlier-dot-env-load
Browse files Browse the repository at this point in the history
Load the dot env earlier
  • Loading branch information
oz123 authored Sep 7, 2022
2 parents 9527820 + a64d675 commit f6ef1d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/5334.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Load the dot env earlier so that ``PIPENV_CUSTOM_VENV_NAME`` is more useful across projects.
6 changes: 3 additions & 3 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit f6ef1d3

Please sign in to comment.