Skip to content
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

Make it more clear that legacy dependency resolver is still default under Python 2 #9194

Closed
wasilukm opened this issue Dec 1, 2020 · 5 comments
Labels
Python 2 only Python 2 specific type: docs Documentation related

Comments

@wasilukm
Copy link

wasilukm commented Dec 1, 2020

It seems that pip 20.3 under Python 2.7 still uses legacy resolver as default one. I'm executing following:

C:\Users\me>py -2 -m pip install trollius>2 pyshark==0.3.8
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behavior is the source of the following dependency conflicts.
pyshark 0.3.8 requires trollius==1.0.4, but you'll have trollius 2.2.post1 which is incompatible.

C:\Users\me>py -2 -m pip -V
pip 20.3 from C:\Python27\lib\site-packages\pip (python 2.7)

As contrary for Python 3 I get:

C:\Users\me>py -3 -m pip install trollius>2 pyshark==0.3.8
ERROR: Cannot install pyshark==0.3.8 and trollius because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

C:\Users\me>py -3 -m pip -V
pip 20.3 from C:\Users\me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip (python 3.8)

I would expect similar output on Python 2 and Python 3

@pradyunsg
Copy link
Member

This is an intentional choice.

pip's new dependency resolver is stricter across the board and makes significant changes to how we treat package metadata and dependency information. We know that this can be potentially disruptive for various projects. The major benefits from the stricter dependency resolver will slowly become more visible in the future, and we expect that projects would be updated to with better metadata and dependency declarations. Many Python 2 users won't be able to upgrade to newer releases of various projects (since many upstream projects on PyPI have dropped Python 2 support). Given that Python 2 will likely stay alive in various capacities in a lot of places, and that this is our last Python 2 compatible release (ignoring bugfixes), we did not want to be unnecessarily disruptive to those users.

Our anecdotal experience showed that most major applications with Python 2 support would not have benefited with the new resolver, and that improved our error reporting in resolution errors is non-disruptive overall.

It is still possible to opt-in to the new resolver on Python 2 (with --use-feature=2020-resolver), for users who wish to use the new resolver as available in the 20.3 release, on Python 2.

@wasilukm
Copy link
Author

wasilukm commented Dec 1, 2020

Thank you for the explanation. I understand the choice.
In the other hand I've just found information about strategy for Python 2 in documentation at the bottom of sub-chapter https://pip.pypa.io/en/stable/user_guide/#watch-out-for whereas main chapter https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program suggest that default resolver doesn't depend on Python version.

Similar is in release notes https://pip.pypa.io/en/stable/news/#id21 (different strategy for Python 2 not mentioned):

Switch to the new dependency resolver by default

Therefore please consider updating documentation regarding Python 2 default resolver to be more visible for the end users.

@brainwane
Copy link
Contributor

Thank you @pradyunsg for your clear explanation! I'll follow up by pointing at #8937 (comment) and #8664 (comment) for more background discussion.

@wasilukm Thanks for the suggestion. I definitely agree that we did not communicate clearly enough about the Python 2 behavior, and I take at least partial responsibility for that. I have some followup stuff to do to mitigate this and have listed them at #8936 (comment) .

@brainwane brainwane added the type: docs Documentation related label Dec 1, 2020
@brainwane brainwane added this to the 20.3.1 milestone Dec 1, 2020
@brainwane brainwane changed the title Default dependency resolver under Python 2 Make it more clear that legacy dependency resolver is still default under Python 2 Dec 1, 2020
@pradyunsg pradyunsg modified the milestones: 20.3.2, 20.3.3 Dec 9, 2020
brainwane added a commit to brainwane/pip that referenced this issue Dec 13, 2020
Partially addresses pypa#9194.

Signed-off-by: Sumana Harihareswara <sh@changeset.nyc>
@brainwane
Copy link
Contributor

I've made pull request #9269 to improve the documentation and highlight in more places that Python 2 environments will still default to the old resolver. Once it is merged, there will be a new CHANGELOG entry saying this as well.

In that pull request I've also added a link to the Python 2 sunsetting FAQ to the pip Python 2 support policy.

@pradyunsg
Copy link
Member

Closing since this was be a part of 20.3's bugfix releases. :)

@pradyunsg pradyunsg removed this from the 20.3.4 milestone Jan 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Python 2 only Python 2 specific type: docs Documentation related
Projects
None yet
Development

No branches or pull requests

3 participants