-
-
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 install --lock creates broken/confusing state under some circumstances #458
Comments
Hey @drakedevel, thanks for taking the time to put this issue together. This is a duplicate of #298 which has an open patch (#305) but we never made final decisions on what to do with conflicts and conflicting dependency specifications. We'll need to resolve that before we can move forward for a fix with this. |
I should also note this is a problem in |
Can you try this again with the latest version? I'm curious to know if our new dependency resolver will change this behavior @drakedevel :) |
@nateprewitt ah yeah -- I got thrown off by the title of that one being about order. As with the initial report in #298, pip handles this (more or less accidentally) regardless of what order you have the requirements in. I do think there's a separate bug which is that the generated Pipfile.lock doesn't reflect the actually installed versions (although maybe moot now, see below). @kennethreitz appears to be fixed! I just tried the exact same sequence of commands again, and now Pipfile, Pipfile.lock, and |
Excellent news! Bad news is that if you pass |
I spent some time today trying to convert a project from requirements.txt to Pipfile with pipenv, but was confused to discover the wrong versions of some packages getting installed. Upon further investigation, I discovered that
pipenv install --lock pkg1==version
followed bypipenv install --lock pkg2==version
, whenpkg2
depends onpkg1
(with no version constraint) can result in a higher version ofpkg1
being added to Pipfile.lock (but not actually installed), which then only takes effect on the nextpipenv install
.Here is a terminal transcript showing the behavior with
sqlalchemy==0.9.7
andgraphene-sqlalchemy==1.1.1
: https://gist.github.com/drakedevel/80457eca7bd2ff5fefbcb5192b67d88eYou can see that after the first install,
sqlalchemy
version 0.9.7 appears in Pipfile and Pipfile.lock as I'd expect. But, aftergraphene-sqlalchemy
is installed, the Pipfile.lock containssqlalchemy
version 1.1.13, in direct conflict with the Pipfile's version constraint, and not reflecting the actual packages installed (perpipenv run pip freeze
). You can see that thegraphene-sqlalchemy
install is satisfied with 0.9.7 and does not require an upgrade to proceed.This seems pretty broken to me on a few levels -- what's the point of specifying version constraints in the Pipfile if they get silently overridden? And what's the point of Pipfile.lock if it doesn't reflect the actual packages pipenv installed?
The text was updated successfully, but these errors were encountered: