-
Notifications
You must be signed in to change notification settings - Fork 0
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
packaging import fix #7
Conversation
…hich still contains the LegacySpecifier class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of adding pip
to the Pipfile
because of compatibility issues it might raise down the line, especially as pipenv
uses its own version of pip
... but in this scenario I don't see much choice. The only other option would be remove our dependency on requirementslib
, but to be honest I don't know if there are other packages that would give us the same functionality, and might be more work than it's worth instead of just waiting for the issue with requirementslib
to be fixed. It will only be a matter of time as other projects have done the same.
If we go ahead with this, we need to keep an eye on requirementslib
so that when the issue is resolved, we can swiftly remove pip
from the Pipfile
. Maybe we create a separate GH issue for it so we don't forget.
Nice job figuring this one out!
That's a very good point James. Luckily we have all dependencies locked down to a certain version in the Pipfile so, as long as it works now (which it does), I'm pretty sure it will continue to work (I guess unless there are other "loose" sub-dependencies). Until the day we decide to start updating things, but we'll cross that bridge when we get to it. And yep, also good point on raising an issue to address this in the future. I've created one as suggested (link). Thanks for the review. |
The changes themselves look fine to me, although I'm cautiously apprehensive about pinning If I'm understanding correctly, the reason I echo James' sentiment that we should keep an eye on |
Yes pretty much @csut-anmut. But for the avoidance of any doubt, I'll try to explain it again: The reason we need to pin This is problematic because any version of pip > 24.0 will have removed this old/deprecated functionality by upgrading its own dependency on So to fix, we have to force Hope that makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Approved 👍.
a842a44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me 👍
When trying to run a
git push
on any of our pipenv-cookiecutter repositories, both of the pipenv-setup pre-push hooks fail with the following error:After some research, I discovered that this issue was due, at its very heart, to the fact that the
packaging
lib deprecated itsLegacyVersion
andLegacySpecifier
functionality (read about that here) from version 22.0 onwards.How this relates to this particular problem is twofold:
packaging
is used within the repo here, but THIS IS NOT THE PROBLEM since we pin its version in the pipfile to one that is compatible with version 21.0 which still contains the now deprecated functionality.packaging
also just so happens to be sub-sub-dependency of pipenv-setup via therequirementslib
package which depends onpip
which then itself depends onpackaging
. THIS IS THE ROOT CAUSE OF THE PROBLEM.Taking a dive down into this particular rabbit-hole, raises yet another twofold problem:
requirementslib
still depends on theLegacySpecifier
functionality frompackaging
viapip
, as can be seen in the GitHub source code here and the raised issue here.requirementslib
will install ANY version ofpip
greater than or equal to 22.2 which basically renders the package useless given it will by default install the latest version which has been updated to cater for the update inpackaging
and therefore give the error above.In other words,
requirementslib
need to sort their sh*t out.So in order to fix:
pip
and pin the version within the Pipfile to an older compatible version (v24.0) which still depends on the older version ofpackaging
containing theLegacySpecifier
functionality (v21.3), as recommended here, as this will forcerequirementslib
to use that version ofpip
which isn't problematic.Problem solved. For now.