-
-
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
pipenv update --outdated
crashes with IndexError in Git repo
#1837
Comments
I think this is kind of complicated to be honest mainly due to the VCS involvement. I’ve been sitting on a significant refactor of the requirement parser and this is one of the pieces I am considering. If I put the branch up, maybe you can grab it and see how it works for you. Probably related: #1690 |
Sure, I'm happy to test whatever. As a quick fix, results = filter(lambda r: not r.startswith("#"), results) before passing them to Really it should remove comments from within lines as well, but I would be surprised if |
@anowlcalledjosh sorry for dropping the ball on this, was working through a big datacenter migration this weekend. I looked over that PR, seems like a good idea. I I have time I can bring it in, but feel free to PR it if you like as well. I think we keep commented lines for some reason, would have to dig to find out why |
FYI, pypa/pip#4759 is now addressed in pip's master branch. |
Thanks @cjerdonek :) I added a bunch of custom handling for this in |
When I run
pipenv update --outdated
, it crashes with an IndexError, but only if a package is installed in editable mode where the package is also a Git repository.This looks kind of like pypa/pip#4759? I don't know if you would be willing to merge the PR that apparently fixes it into Pipenv's vendored Pip; alternatively, ignoring lines from Pip that start with
#
might work, since apparently requirements files are allowed to contain comments, and I guess Pipenv is probably parsing the output ofpip freeze
.$ python -m pipenv.help output
Pipenv version:
'11.9.0'
Pipenv location:
'/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv'
Python location:
'/home/josh/.local/venvs/pipenv/bin/python'
Other Python installations in
PATH
:2.7
:/usr/bin/python2.7
2.7
:/usr/bin/python2.7
3.5
:/usr/bin/python3.5m
3.5
:/usr/bin/python3.5
3.6
:/usr/bin/python3.6m
3.6
:/usr/bin/python3.6
2.7.12
:/usr/bin/python
2.7.12
:/usr/bin/python2
3.5.2
:/usr/bin/python3
PEP 508 Information:
System environment variables:
GIT_PS1_SHOWDIRTYSTATE
SSH_AGENT_PID
XDG_DATA_HOME
PYENV_ROOT
SHELL
TERM
PIPENV_VENV_IN_PROJECT
RIPGREP_CONFIG_PATH
TMUX_VERSION
NVM_DIR
USER
LS_COLORS
DEBEMAIL
SSH_AUTH_SOCK
TMUX
MAIL
PATH
PWD
EDITOR
LANG
TMUX_PANE
GIT_PS1_SHOWUNTRACKEDFILES
GPG_TTY
HOME
MANPAGER
SHLVL
XDG_CONFIG_HOME
GIT_PS1_SHOWSTASHSTATE
PIPENV_SHELL_FANCY
XDG_CACHE_HOME
LOGNAME
GIT_PS1_SHOWUPSTREAM
VISUAL
TMUX_PLUGIN_MANAGER_PATH
DEBFULLNAME
GOPATH
LESSOPEN
LESSCLOSE
_
OLDPWD
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PYTHONUNBUFFERED
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT
:1
PIPENV_SHELL_FANCY
:1
Debug–specific environment variables:
PATH
:/home/josh/go/bin:/home/josh/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/josh/.cargo/bin:/home/josh/.cabal/bin:/home/josh/bin:/home/josh/.local/bin
SHELL
:/bin/bash
EDITOR
:vim
LANG
:en_GB.UTF-8
PWD
:/home/josh/pipenv_test
Contents of
Pipfile
('/home/josh/pipenv_test/Pipfile'):Contents of
Pipfile.lock
('/home/josh/pipenv_test/Pipfile.lock'):Expected result
The outdated packages should be displayed? (I've actually never used this command before, but I guess it probably shouldn't just crash 😃)
Actual result
I inserted some debugging, and in the final stack frame, the value of
dep
is"## !! Could not determine repository location"
; a couple of frames up inpipenv.core.do_outdated
, the value ofresults
is['## !! Could not determine repository location', 'foo==0.1']
.Steps to replicate
Run in an empty directory:
The text was updated successfully, but these errors were encountered: