-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Linuxbrew shells are detected as nu
shell
#6197
Comments
First, I am suprised to learn that we don't have a bransh for zsh. Line 47 in 5eb672a
Supported shells are found here: https://github.com/pypa/virtualenv/tree/main/src/virtualenv/activation |
@oz123 thank you for taking a look! The issue is that I think a 'deep' fix would only detect based on the end of the |
As a workaround (if anyone else runs into this) I've set up a symlink to a path without |
Please draft it. I was just taking a look on my Ubuntu VM at this issue. Unfortunately, despite your very detailed steps to construct the issue, I was not able to recreate it:
|
Do you already have |
Well:
That seems wrong... |
if |
OK, I set my default shell to zsh, and after new login I can recreate the issue. |
@JoshStern can you add to your patch:
I believe this will not break the behaviour, as the current order of parsing does not change.
|
Addresses issue: pypa#6197 Previously these branches would trip if the shell name was present anywhere in the cmd path. This updates the check to only look at the end.
Addresses issue: pypa#6197 Previously these branches would trip if the shell name was present anywhere in the cmd path. This updates the check to only look at the end.
Just pushed up a PR with my original fix, running the tests now. Your idea is definitely more backwards compatible, I was hoping to fix it for any path that has a shell as a substring and not just the linuxbrew case. |
I can't seem to get the suite running using the container option. I tried 3.7, 3.8, and 3.9 (got the furthest with 3.8). I've tried most of the options here, let me know if there's something else I need to set up. |
Addresses issue: pypa#6197 This updates the check to only look at the path after linuxbrew if it is present.
Addresses issue: pypa#6197 This updates the check to only look at the path after linuxbrew if it is present.
@oz123 I've pushed both versions of the fix - feel free to pick either (or modify as needed). Sorry I can't verify the suite locally 😞. I may spend some time trying to get the containerized run working on my machine on another day. |
Thanks for your efforts. No worries about the suite. We only support Python 3.8+. |
Addresses issue: #6197 Previously these branches would trip if the shell name was present anywhere in the cmd path. This updates the check to only look at the end.
Fixed in #6215 |
Issue description
When running
pipenv shell
using a brew-installed shell thecmd
will includelinuxbrew
which trips the nu branch when identifying the activate file and command to run.Expected result
Shells with
nu
elsewhere in the path are not detected asnu
shell.Actual result
Followed by (I am using
zsh
):Steps to replicate
This can be replicated without a Pipfile:
pipenv
, andzsh
:zsh
.Proposed fix
This may require some conversation. Switching the branches to check the end of the path would be a breaking change for anyone who depends on the current behavior. It may be worth adding a
zsh
branch which does the same check beforenu
. I'm happy to make the change with some guidance from a contributor.$ pipenv --support
Pipenv version:
'2024.0.1'
Pipenv location:
'/home/linuxbrew/.linuxbrew/Cellar/pipenv/2024.0.1/libexec/lib/python3.12/site-packages/pipenv'
Python location:
'/home/linuxbrew/.linuxbrew/Cellar/pipenv/2024.0.1/libexec/bin/python'
OS Name:
'posix'
User pip version:
'24.0'
user Python installations found:
PEP 508 Information:
System environment variables:
GJS_DEBUG_TOPICS
USER
XDG_SESSION_TYPE
SHLVL
HOME
DESKTOP_SESSION
GIO_LAUNCHED_DESKTOP_FILE
GTK_MODULES
GNOME_SHELL_SESSION_MODE
MANAGERPID
SYSTEMD_EXEC_PID
DBUS_SESSION_BUS_ADDRESS
GIO_LAUNCHED_DESKTOP_FILE_PID
LOGNAME
GTK_IM_MODULE
JOURNAL_STREAM
XDG_SESSION_CLASS
USERNAME
GNOME_DESKTOP_SESSION_ID
WINDOWPATH
PATH
SESSION_MANAGER
INVOCATION_ID
XDG_RUNTIME_DIR
XDG_MENU_PREFIX
DISPLAY
LANG
XDG_CURRENT_DESKTOP
XAUTHORITY
XDG_SESSION_DESKTOP
XMODIFIERS
SSH_AGENT_LAUNCHER
SSH_AUTH_SOCK
SHELL
QT_ACCESSIBILITY
GDMSESSION
GPG_AGENT_INFO
GJS_DEBUG_OUTPUT
QT_IM_MODULE
PWD
XDG_DATA_DIRS
XDG_CONFIG_DIRS
KITTY_WINDOW_ID
WINDOWID
TERM
COLORTERM
OLDPWD
HOMEBREW_PREFIX
HOMEBREW_CELLAR
HOMEBREW_REPOSITORY
MANPATH
INFOPATH
ZSH
PAGER
LESS
LSCOLORS
LS_COLORS
VIRTUAL_ENV_DISABLE_PROMPT
FZF_CTRL_R_OPTS
NVM_DIR
NVM_CD_FLAGS
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PYTHONFINDER_IGNORE_UNSUPPORTED
PIP_PYTHON_PATH
PIPENV_ACTIVE
Pipenv–specific environment variables:
PIPENV_ACTIVE
:1
Debug–specific environment variables:
PATH
:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/user/.local/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/user/.local/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
SHELL
:/home/linuxbrew/.linuxbrew/bin/zsh
LANG
:en_US.UTF-8
PWD
:/home/user
Contents of
Pipfile
('/home/user/Pipfile'):The text was updated successfully, but these errors were encountered: