pipenv
pipenv copied to clipboard
Unexpected behaviour when `PIPENV_VERSION` environment variable is set
Is your feature request related to a problem? Please describe.
Having the PIPENV_VERSION environment variable set leads to the unexpected behaviour.
I encountered this problem during setting up the CI configuration. I have parametrized Python version by environment variable and I wanted to do the same for pipenv.
Describe the solution you'd like
The only use case I can think of for this feature might be to "disable" the current pipenv command, e.g.
PIPENV_VERSION=true pipenv run mypy .
will print the pipenv version instead of running the mypy.
I would propose to do not treat this environment variable as the configurational one.
Describe alternatives you've considered
In case the pipenv would like to keep this feature, I would propose to add a mention about PIPENV_VERSION environment variable to the Configuration With Environment Variables section of the documentation.
And maybe would be nice (more user friendly) to put link that refers to Configuration With Environment Variables to the error message, so instead of:
> PIPENV_VERSION=2022.7.24 pipenv
Usage: pipenv [OPTIONS] COMMAND [ARGS]...
Try 'pipenv -h' for help.
Error: Invalid value for '--version': '2022.7.24' is not a valid boolean.
display somethink like
> PIPENV_VERSION=2022.7.24 pipenv
Usage: pipenv [OPTIONS] COMMAND [ARGS]...
Try 'pipenv -h' for help.
Error: Invalid value for '--version': '2022.7.24' is not a valid boolean.
For more information about configuring `pipenv` via environment variables see https://pipenv.pypa.io/en/latest/advanced/#configuration-with-environment-variables.
Additional context
I have found one related issue to this - the https://github.com/pypa/pipenv/issues/3633. It was created on 20.3.2019, closed on 30.3.2019 and the last mention of it is from 5.9.2022, so people are still encountering the problem.
$ pipenv --support
Pipenv version: '2022.7.24'
Pipenv location: '/home/jcas/.pyenv/versions/3.8.10/envs/ds-upsell3.8.10/lib/python3.8/site-packages/pipenv'
Python location: '/home/jcas/.pyenv/versions/3.8.10/envs/ds-upsell3.8.10/bin/python3.8'
Python installations found:
3.11.2:/home/jcas/.pyenv/versions/3.11.2/bin/python33.10.9:/home/jcas/.pyenv/versions/3.10.9/bin/python33.10.6:/home/jcas/.pyenv/versions/3.10.6/bin/python33.10.4:/home/jcas/.pyenv/versions/3.10.4/bin/python33.10.2:/home/jcas/.pyenv/versions/3.10.2/bin/python33.9.10:/home/jcas/.pyenv/versions/3.9.10/bin/python33.9.6:/home/jcas/.pyenv/versions/3.9.6/bin/python33.8.13:/home/jcas/.pyenv/versions/3.8.13/bin/python33.8.12:/home/jcas/.pyenv/versions/3.8.12/bin/python33.8.10:/home/jcas/.pyenv/versions/3.8.10/bin/python33.8.10:/usr/bin/python33.8.10:/usr/bin/python3.83.8.10:/bin/python33.8.10:/bin/python3.82.7.18:/usr/bin/python22.7.18:/usr/bin/python2.72.7.18:/usr/bin/python2.7.18:/bin/python22.7.18:/bin/python2.72.7.18:/bin/python
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.8.10',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '5.15.0-58-generic',
'platform_system': 'Linux',
'platform_version': '#64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023',
'python_full_version': '3.8.10',
'python_version': '3.8',
'sys_platform': 'linux'}
System environment variables:
SHELLSESSION_MANAGERQT_ACCESSIBILITYTMUX_COLUMNS_59COLORTERMTMUX_COLUMNS_58TMUX_COLUMNS_55TMUX_COLUMNS_54TMUX_COLUMNS_57PYENV_SHELLTMUX_COLUMNS_56TMUX_COLUMNS_51TMUX_COLUMNS_50TMUX_COLUMNS_53TMUX_COLUMNS_52XDG_CONFIG_DIRSXDG_SESSION_PATHTMUX_COLUMNS_103TMUX_COLUMNS_102TMUX_COLUMNS_101TMUX_COLUMNS_100TMUX_COLUMNS_107TMUX_COLUMNS_106GNOME_DESKTOP_SESSION_IDTMUX_COLUMNS_105TMUX_COLUMNS_104TMUX_COLUMNS_109TMUX_COLUMNS_108TMUXLANGUAGEMANDATORY_PATHLC_ADDRESSTMUX_PWD_6TMUX_PWD_7TMUX_PWD_4TMUX_PWD_5TMUX_PWD_2TMUX_PWD_3TMUX_PWD_0TMUX_PWD_1LC_NAMESSH_AUTH_SOCKTMUX_PWD_8TMUX_PWD_9TMUX_PWD_47TMUX_PWD_44TMUX_PWD_45TMUX_PWD_42TMUX_PWD_43TMUX_PWD_40TMUX_PWD_41TMUX_PWD_48TMUX_PLUGIN_MANAGER_PATHTMUX_PWD_15TMUX_PWD_14TMUX_PWD_17TMUX_PWD_16RIPGREP_CONFIG_PATHTMUX_PWD_10TMUX_PWD_13TMUX_PWD_12TMUX_PWD_19TMUX_PWD_18DESKTOP_SESSIONLC_MONETARYSSH_AGENT_PIDTMUX_PWD_109TMUX_PWD_108TMUX_PWD_107TMUX_PWD_106TMUX_PWD_105TMUX_PWD_104TMUX_PWD_103TMUX_PWD_102TMUX_PWD_101TMUX_PWD_100EDITORGTK_MODULESXDG_SEATPWDPYENV_VIRTUALENV_INITXDG_SESSION_DESKTOPLOGNAMEQT_QPA_PLATFORMTHEMEXDG_SESSION_TYPETMUX_COLUMNS_28TMUX_COLUMNS_29TMUX_COLUMNS_20TMUX_COLUMNS_21TMUX_COLUMNS_22TMUX_COLUMNS_23TMUX_COLUMNS_24TMUX_COLUMNS_25TMUX_COLUMNS_26TMUX_COLUMNS_27TMUX_PWD_99TMUX_PWD_98TMUX_PWD_95GPG_AGENT_INFOTMUX_PWD_94TMUX_PWD_97TMUX_PWD_91TMUX_PWD_90TMUX_PWD_93TMUX_PWD_92TMUX_COLUMNS_77TMUX_COLUMNS_76TMUX_COLUMNS_75TMUX_COLUMNS_74TMUX_COLUMNS_73TMUX_COLUMNS_72TMUX_COLUMNS_71TMUX_COLUMNS_70TMUX_COLUMNS_79XAUTHORITYFZF_DEFAULT_COMMANDXDG_GREETER_DATA_DIRTMUX_PWD_39TMUX_PWD_38TMUX_PWD_37TMUX_PWD_36TMUX_PWD_35TMUX_PWD_34TMUX_PWD_33TMUX_PWD_32TMUX_PWD_31TMUX_PWD_30TMUX_COLUMNS_99GDM_LANGTMUX_COLUMNS_98TMUX_COLUMNS_91TMUX_COLUMNS_90TMUX_COLUMNS_93TMUX_COLUMNS_92TMUX_COLUMNS_95HOMETMUX_COLUMNS_94TMUX_COLUMNS_97LC_PAPERLANGLS_COLORSXDG_CURRENT_DESKTOPVTE_VERSIONTMUX_PWD_60TMUX_PWD_61TMUX_PWD_62TMUX_PWD_63TMUX_PWD_64TMUX_PWD_66TMUX_PWD_67TMUX_PWD_68TMUX_PWD_69TMUX_COLUMNS_10TMUX_COLUMNS_13TMUX_COLUMNS_12TMUX_COLUMNS_15TMUX_COLUMNS_14XDG_SEAT_PATHTMUX_COLUMNS_17TMUX_COLUMNS_16TMUX_COLUMNS_19TMUX_COLUMNS_18GNOME_TERMINAL_SCREENTMUX_PWD_59TMUX_PWD_58TMUX_PWD_51TMUX_PWD_50TMUX_PWD_53TMUX_PWD_52TMUX_PWD_55TMUX_PWD_54TMUX_PWD_57TMUX_PWD_56NVM_DIRTMUXINATOR_CONFIGLESSCLOSEXDG_SESSION_CLASSTERMLC_IDENTIFICATIONFZF_CTRL_T_COMMANDGTK_OVERLAY_SCROLLINGDEFAULTS_PATHLESSOPENTMUX_COLUMNS_39TMUX_COLUMNS_38USERTMUX_COLUMNS_33TMUX_COLUMNS_32TMUX_COLUMNS_31TMUX_COLUMNS_30TMUX_PANETMUX_COLUMNS_37TMUX_COLUMNS_36TMUX_COLUMNS_35TMUX_COLUMNS_34GNOME_TERMINAL_SERVICETMUX_COLUMNS_48TMUX_COLUMNS_42TMUX_COLUMNS_43TMUX_COLUMNS_40TMUX_COLUMNS_41TMUX_COLUMNS_47TMUX_COLUMNS_44TMUX_COLUMNS_45DISPLAYSHLVLNVM_CD_FLAGSLC_TELEPHONELC_MEASUREMENTXDG_VTNRDESKTOP_AUTOSTART_IDXDG_SESSION_IDTMUX_PWD_73TMUX_PWD_72TMUX_PWD_71TMUX_PWD_70TMUX_PWD_77TMUX_PWD_76TMUX_PWD_75TMUX_PWD_74TMUX_PWD_79XDG_RUNTIME_DIRTMUX_COLUMNS_8TMUX_COLUMNS_9TMUX_COLUMNS_2TMUX_COLUMNS_3TMUX_COLUMNS_0TMUX_COLUMNS_1TMUX_COLUMNS_6TMUX_COLUMNS_7TMUX_COLUMNS_4TMUX_COLUMNS_5TMUX_COLUMNS_64TMUX_COLUMNS_66TMUX_COLUMNS_67TMUX_COLUMNS_60PYENV_ROOTTMUX_COLUMNS_61TMUX_COLUMNS_62TMUX_COLUMNS_63TMUX_COLUMNS_68TMUX_COLUMNS_69GTK3_MODULESXDG_DATA_DIRSTMUX_COLUMNS_87TMUX_COLUMNS_84TMUX_COLUMNS_85TMUX_COLUMNS_82TMUX_COLUMNS_83TMUX_COLUMNS_80TMUX_COLUMNS_81PATHTMUX_COLUMNS_88TMUX_COLUMNS_89GDMSESSIONDBUS_SESSION_BUS_ADDRESStmux_versionTMUX_PWD_88TMUX_PWD_89TMUX_PWD_82NVM_BINTMUX_PWD_83TMUX_PWD_80TMUX_PWD_81TMUX_PWD_87TMUX_PWD_84TMUX_PWD_85POWERLINE_COMMANDLC_NUMERICOLDPWDTMUX_PWD_28TMUX_PWD_29TMUX_PWD_24TMUX_PWD_25TMUX_PWD_26TMUX_PWD_27TMUX_PWD_20TMUX_PWD_21TMUX_PWD_22TMUX_PWD_23_PIP_SHIMS_BASE_MODULEPIP_DISABLE_PIP_VERSION_CHECKPIP_PYTHON_PATHPYTHONDONTWRITEBYTECODEPYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH:/home/jcas/.local/bin:/home/jcas/bin:/home/jcas/.poetry/bin:/home/jcas/.pyenv/plugins/pyenv-virtualenv/shims:/home/jcas/.pyenv/shims:/home/jcas/.pyenv/bin:/home/jcas/.local/bin:/home/jcas/.nvm/versions/node/v16.14.0/bin:/home/jcas/.poetry/bin:/home/jcas/.pyenv/plugins/pyenv-virtualenv/shims:/home/jcas/.pyenv/bin:/home/jcas/.local/bin:/home/jcas/.poetry/bin:/home/jcas/.local/bin:/home/jcas/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/jcas/.fzf/binSHELL:/bin/bashEDITOR:nvimLANG:en_US.UTF-8PWD:/home/jcas/
I just searched the current code base and don't see where we are using a VERSION env var, -- that would get the PIPENV_ prefix if we were, but I don't see it. Also noting your support shows you on `Pipenv version: '2022.7.24'
Could you upgrade to 2023.2.18 and check again?
I would propose to do not treat this environment variable as the configurational one.
I don't see where the environment variables listed there mention a VERSION variable either ...
I just searched the current code base and don't see where we are using a VERSION env var, -- that would get the PIPENV_ prefix if we were, but I don't see it. Also noting your support shows you on `Pipenv version: '2022.7.24'
@matteius, heh, I did exactly the same before. =) As I understand correctly from the #3633, this is feature of click library.
Could you upgrade to
2023.2.18and check again?
You have good point here. =) I have tried it on the 2023.2.18 version, but the result is the same.

Also, a rather unexpected and confusing error message
+ pipenv --version
pipenv, version 2024.0.2
+ pipenv --help
Usage: pipenv [OPTIONS] COMMAND [ARGS]...
Try 'pipenv -h' for help.
Error: Invalid value for '--version': '2024.0.2' is not a valid boolean.
WHAT?! :)
Source:
- https://github.com/glensc/plex-fuse/actions/runs/12357575180/job/34486153585#step:5:21
Added a workaround:
- https://github.com/glensc/plex-fuse/commit/7e29d73a8ff7fbc8ed0f483a24e4d864b1e494be