Locking may fail while unparsing setup.py if version is read from environment #4274
Labels
Type: Bug 🐛
This issue is a bug.
Type: Regression
This issue is a regression of a previous behavior.
Type: Vendored Dependencies
This issue affects vendored dependencies within pipenv.
Milestone
Issue description
When the source directory is added to the Pipfile (using
pipenv install -e .
) and the version number defined insetyp.py
is read from the environment, then unparsingsetup.py
may throw an unexpected exception when runningpipenv lock
.Running
pipenv lock --clear
, as suggested on the "diagnose documentation" page, throws the same exception.Expected result
I would expect locking operation to continue (and complete), while not necessarily detecting the version number of the source package.
Actual result
The operation aborts due to an unexpected exception:
Steps to replicate
I think this is the simplest way I can reproduce it. With a
setup.py
file of:And a
Pipfile
of:Running the command
pipfile lock
fails with the described error.Notes:
version=os.environ['PACKAGE_VERSION']
) works, but would obviously fail if run without the environment variable definedos.environ.get('PACKAGE_VERSION', '0.0.1')
works as wellpython
is installed using homebrew;pipenv
is installed usingpython3 -m pip install pipenv
$ pipenv --support
Pipenv version:
'2020.5.28'
Pipenv location:
'/usr/local/lib/python3.7/site-packages/pipenv'
Python location:
'/usr/local/opt/python/bin/python3.7'
Python installations found:
3.7.7
:/usr/local/bin/python3
3.7.7
:/usr/local/bin/python3.7m
3.7.7
:/usr/local/bin/python3.7
3.7.3
:/usr/bin/python3
2.7.16
:/usr/bin/python2
2.7.16
:/usr/bin/python2.7
PEP 508 Information:
System environment variables:
TERM_SESSION_ID
SSH_AUTH_SOCK
LC_TERMINAL_VERSION
COLORFGBG
ITERM_PROFILE
XPC_FLAGS
PWD
SHELL
LC_CTYPE
TERM_PROGRAM_VERSION
TERM_PROGRAM
PATH
DISPLAY
LC_TERMINAL
COLORTERM
TERM
HOME
TMPDIR
USER
XPC_SERVICE_NAME
LOGNAME
ITERM_SESSION_ID
__CF_USER_TEXT_ENCODING
SHLVL
OLDPWD
P9K_TTY
ZSH
LESS
PAGER
LSCOLORS
P9K_SSH
LC_ALL
LANG
_
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_SHIMS_BASE_MODULE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/Users/pes/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin
SHELL
:/bin/zsh
LANG
:en_US.UTF-8
PWD
:/Users/pes/work/Projects/CUE/work/pipenv-unparse
Contents of
Pipfile
('/Users/pes/work/Projects/CUE/work/pipenv-unparse/Pipfile'):Contents of
Pipfile.lock
('/Users/pes/work/Projects/CUE/work/pipenv-unparse/Pipfile.lock'):The text was updated successfully, but these errors were encountered: