From fb4765a17b41bf33d1504b07070fc315eda91b3b Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 7 Sep 2022 06:27:03 -0400 Subject: [PATCH 1/3] Load the dot env earlier so that PIPENV_CUSTOM_VENV_NAME is more useful across projects. --- pipenv/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index 4b5ad405ab..f6d012b620 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -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( From be17a9f87100aaf0926239366d6887d714621109 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 7 Sep 2022 06:29:03 -0400 Subject: [PATCH 2/3] Add news fragment. --- news/5334.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/5334.bugfix.rst diff --git a/news/5334.bugfix.rst b/news/5334.bugfix.rst new file mode 100644 index 0000000000..83b1f04254 --- /dev/null +++ b/news/5334.bugfix.rst @@ -0,0 +1 @@ +Load the dot env earlier so that ``PIPENV_CUSTOM_VENV_NAME`` is more useful across projects. \ No newline at end of file From a64d6751872ad664a2dc1be52fdd7fdb877b80cf Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 7 Sep 2022 06:34:06 -0400 Subject: [PATCH 3/3] Fix lint --- news/5334.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/5334.bugfix.rst b/news/5334.bugfix.rst index 83b1f04254..719fbe34b6 100644 --- a/news/5334.bugfix.rst +++ b/news/5334.bugfix.rst @@ -1 +1 @@ -Load the dot env earlier so that ``PIPENV_CUSTOM_VENV_NAME`` is more useful across projects. \ No newline at end of file +Load the dot env earlier so that ``PIPENV_CUSTOM_VENV_NAME`` is more useful across projects.