-
-
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 respects version constraint from incorrect python version #1967
Comments
Pipenv uses whichever thing is called |
@techalchemy as you can see from pipenv.help output, the thing called Can you please reopen the issue until we sort it out? |
@dspechnikov oooh yes, okay, I see the bug here:
We are currently picking up both of these... I'm not sure lockfiles currently actually have a way to handle this in the spec (duplicate entries would be the only way I guess right now? or flattening the markers and including all hashes found?) Otherwise we can just pick the one that matches the specified python version and resolve that one only as a fix -- @ncoghlan @jtratner @uranusjr @frostming -- thoughts? We have markers for 2 different python versions & a different specifier for each, what approach makes the most sense? |
I didn’t even know this was possible. People really can get creative with requirement specification. Flattening + merging hashes would cause a problem with the {
"django": [
{
"hashes": ["..."],
"markers": "python_version <= '2.7'",
"version": "1.11.7"
},
{
"hashes": ["..."],
"markers": "python_version >= '3.4'",
"version": "2.0.3"
}
]
} |
So we should allow duplicate entries with different markers in Pipfile too. (which is not supported by my previous commit) |
Huh, I thought the lockfile generation had successfully been changed to always use the venv Python, so I'm surprised it was picking up both markers. I suspect that longer term After all, |
I like @uranusjr’s suggestion but in the short term let’s just pick the one that works in the specific environment |
@ncoghlan that’s correct although if (as in this case) someone includes all markers on the same line, that’s the line we pick up. We just split the markers up. That makes me think — maybe we don’t have to do that |
I can't actually reproduce this on the current version of pipenv; maybe my marker fix caught it. @dspechnikov can you confirm that you are still seeing this |
Hm yeah this isn't happening with the latest released version of pipenv |
@techalchemy what do you mean by current version? Can I somehow help to reproduce it? I really want this to be fixed. |
Are you sure though? Is it possible you have multiple pipenv installations? Try to completely purge the one that’s on your path with |
As an additional FYI we don’t recommend putting secondary dependencies in your pipfile. I.e. |
@techalchemy uninstalling pipenv didn't help, but clearing the dependency cache did! Thanks a lot for the help everyone, I'll remember to clear the cache after upgrade just in case :) |
@dspechnikov awesome, I didn't even recommend that for some reason but I'm glad you stumbled across it 👏 |
drf-yasg
package has 2 Django version constraints:pipenv uses 2.7 one even when invoked in python 3.6 virtual env.
$ python -m pipenv.help output
Pipenv version:
'11.10.0'
Pipenv location:
'/Users/dspeck/work/test/.venv/lib/python3.6/site-packages/pipenv'
Python location:
'/Users/dspeck/work/test/.venv/bin/python'
Other Python installations in
PATH
:2.7
:/usr/bin/python2.7
2.7
:/usr/bin/python2.7
3.6
:/usr/local/bin/python3.6m
3.6
:/Users/dspeck/work/test/.venv/bin/python3.6
3.6
:/usr/local/bin/python3.6
3.6.4
:/Users/dspeck/work/test/.venv/bin/python
3.6.4
:/usr/local/bin/python
2.7.10
:/usr/bin/python
3.6.4
:/Users/dspeck/work/test/.venv/bin/python3
3.6.4
:/usr/local/bin/python3
PEP 508 Information:
System environment variables:
TERM_SESSION_ID
SSH_AUTH_SOCK
Apple_PubSub_Socket_Render
COLORFGBG
ITERM_PROFILE
XPC_FLAGS
PWD
SHELL
SECURITYSESSIONID
LC_CTYPE
TERM_PROGRAM_VERSION
TERM_PROGRAM
PATH
COLORTERM
COMMAND_MODE
TERM
HOME
TMPDIR
USER
XPC_SERVICE_NAME
LOGNAME
__CF_USER_TEXT_ENCODING
ITERM_SESSION_ID
SHLVL
OLDPWD
ZSH
PAGER
LESS
LSCOLORS
PROMPT_EOL_MARK
VIRTUAL_ENV_DISABLE_PROMPT
LC_ALL
LANG
PIPENV_VENV_IN_PROJECT
ANDROID_HOME
VIRTUAL_ENV
_
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PYTHONUNBUFFERED
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT
:yes
Debug–specific environment variables:
PATH
:/Users/dspeck/work/test/.venv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dspeck/Library/Android/sdk/tools:/Users/dspeck/Library/Android/sdk/platform-tools
SHELL
:/bin/zsh
LANG
:en_US.UTF-8
PWD
:/Users/dspeck/work/test
VIRTUAL_ENV
:/Users/dspeck/work/test/.venv
Contents of
Pipfile
('/Users/dspeck/work/test/Pipfile'):Expected result
pipenv lock
produces Pipfile.lockActual result
Pipenv cannot resolve dependencies with the following error:
verbose output
Steps to replicate
Run
pipenv lock
with the Pipfile provided above.The text was updated successfully, but these errors were encountered: