[go: up one dir, main page]

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_dot_env called twice in pipenv shell #6198

Closed
chrisroat opened this issue Jul 10, 2024 · 1 comment · Fixed by #6202
Closed

load_dot_env called twice in pipenv shell #6198

chrisroat opened this issue Jul 10, 2024 · 1 comment · Fixed by #6202
Assignees

Comments

@chrisroat
Copy link

Issue description

When executing a pipenv shell the internal function load_dot_env is called in both the cli and shell functions.

Note that in the shell call, load_dot_env is not passed the state.quiet argument.

Expected result

The function is called only once in the cli function with the quiet option.

Actual result

$ pipenv shell
Loading .env environment variables...
Loading .env environment variables...
Launching subshell in virtual environment...
...
$ pipenv --quiet shell
Loading .env environment variables...
Launching subshell in virtual environment...
...

Steps to replicate

No Pipfile necessary -- just run pipenv.

$ pipenv shell
Loading .env environment variables...
Launching subshell in virtual environment...
...
$ pipenv --quiet shell
Launching subshell in virtual environment...
...

$ pipenv --support

Pipenv version: '2024.0.1'

Pipenv location: '/opt/homebrew/Cellar/pipenv/2024.0.1/libexec/lib/python3.12/site-packages/pipenv'

Python location: '/opt/homebrew/Cellar/pipenv/2024.0.1/libexec/bin/python'

OS Name: 'posix'

User pip version: '24.0'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.12.4',
 'os_name': 'posix',
 'platform_machine': 'arm64',
 'platform_python_implementation': 'CPython',
 'platform_release': '23.5.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT '
                     '2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112',
 'python_full_version': '3.12.4',
 'python_version': '3.12',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_PROGRAM
  • SHELL
  • TERM
  • TMPDIR
  • TERM_PROGRAM_VERSION
  • TERM_SESSION_ID
  • USER
  • SSH_AUTH_SOCK
  • PATH
  • __CFBundleIdentifier
  • PWD
  • XPC_FLAGS
  • XPC_SERVICE_NAME
  • SHLVL
  • HOME
  • LOGNAME
  • OLDPWD
  • HOMEBREW_PREFIX
  • HOMEBREW_CELLAR
  • HOMEBREW_REPOSITORY
  • MANPATH
  • INFOPATH
  • ZSH
  • PAGER
  • LESS
  • LSCOLORS
  • LS_COLORS
  • VIRTUAL_ENV_DISABLE_PROMPT
  • __CF_USER_TEXT_ENCODING
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH
  • PIPENV_ACTIVE
  • VIRTUAL_ENV
  • VIRTUAL_ENV_PROMPT
  • LANG
  • _
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /Users/chrisroat/.local/share/virtualenvs/test-jfMfHFml/bin:/Users/chrisroat/development/flutter/bin:/Applications/Postgres.app/Contents/Versions/16/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/chrisroat/development/flutter/bin:/Applications/Postgres.app/Contents/Versions/16/bin:/opt/homebrew/bin:/opt/homebrew/sbin
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /Users/chrisroat/test
  • VIRTUAL_ENV: /Users/chrisroat/.local/share/virtualenvs/test-jfMfHFml

Contents of Pipfile ('/Users/chrisroat/test/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.12"
@chrisroat
Copy link
Author

Would simply removing the load_dot_env call in shell be acceptable?

@oz123 oz123 self-assigned this Jul 13, 2024
oz123 added a commit that referenced this issue Jul 13, 2024
dot env is always globally loaded.

Fix #6198
oz123 added a commit that referenced this issue Jul 19, 2024
dot env is always globally loaded.

Fix #6198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants