Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load the dot env earlier #5334

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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