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

Update pip to 20.3.4/21.3.1 (new dependency resolver) #1259

Merged
merged 1 commit into from
Nov 1, 2021
Merged

Conversation

edmorley
Copy link
Member

Update pip from 20.2.4 to:

  • 20.3.4 for Python 2.7 and 3.5
  • 21.3.1 for Python 3.6+

Of note Pip 20.3+ includes the new dependency resolver (only enabled by default when using Python 3+). This new dependency resolver is more strict, see:
https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
https://pip.pypa.io/en/stable/topics/dependency-resolution/

Release notes:
https://pip.pypa.io/en/stable/news/#v21-3-1

Changelog:
pypa/pip@20.2.4...21.3.1

The new versions of pip have been synced to S3 using:

$ pip download --no-cache pip==20.3.4
...
Saved ./pip-20.3.4-py2.py3-none-any.whl
Successfully downloaded pip
$ pip download --no-cache pip==21.3.1
Collecting pip==21.3.1
...
Saved ./pip-21.3.1-py3-none-any.whl
Successfully downloaded pip
$ aws s3 sync . s3://heroku-buildpack-python/common/ --exclude "*" --include "*.whl" --dryrun
(dryrun) upload: ./pip-20.3.4-py2.py3-none-any.whl to s3://heroku-buildpack-python/common/pip-20.3.4-py2.py3-none-any.whl
(dryrun) upload: ./pip-21.3.1-py3-none-any.whl to s3://heroku-buildpack-python/common/pip-21.3.1-py3-none-any.whl
$ aws s3 sync . s3://heroku-buildpack-python/common/ --exclude "*" --include "*.whl"
upload: ./pip-20.3.4-py2.py3-none-any.whl to s3://heroku-buildpack-python/common/pip-20.3.4-py2.py3-none-any.whl
upload: ./pip-21.3.1-py3-none-any.whl to s3://heroku-buildpack-python/common/pip-21.3.1-py3-none-any.whl

Closes #1109.
GUS-W-8493316.

Update pip from 20.2.4 to:
  - 20.3.4 for Python 2.7 and 3.5
  - 21.3.1 for Python 3.6+

Of note Pip 20.3+ includes the new dependency resolver (only enabled by default
when using Python 3+). This new dependency resolver is more strict, see:
https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
https://pip.pypa.io/en/stable/topics/dependency-resolution/

Release notes:
https://pip.pypa.io/en/stable/news/#v21-3-1

Changelog:
pypa/pip@20.2.4...21.3.1

The new versions of pip have been synced to S3 using:

```
$ pip download --no-cache pip==20.3.4
...
Saved ./pip-20.3.4-py2.py3-none-any.whl
Successfully downloaded pip
$ pip download --no-cache pip==21.3.1
Collecting pip==21.3.1
...
Saved ./pip-21.3.1-py3-none-any.whl
Successfully downloaded pip
$ aws s3 sync . s3://heroku-buildpack-python/common/ --exclude "*" --include "*.whl" --dryrun
(dryrun) upload: ./pip-20.3.4-py2.py3-none-any.whl to s3://heroku-buildpack-python/common/pip-20.3.4-py2.py3-none-any.whl
(dryrun) upload: ./pip-21.3.1-py3-none-any.whl to s3://heroku-buildpack-python/common/pip-21.3.1-py3-none-any.whl
$ aws s3 sync . s3://heroku-buildpack-python/common/ --exclude "*" --include "*.whl"
upload: ./pip-20.3.4-py2.py3-none-any.whl to s3://heroku-buildpack-python/common/pip-20.3.4-py2.py3-none-any.whl
upload: ./pip-21.3.1-py3-none-any.whl to s3://heroku-buildpack-python/common/pip-21.3.1-py3-none-any.whl
```

Closes #1109.
GUS-W-8493316.
@edmorley edmorley requested a review from a team as a code owner October 29, 2021 19:55
@edmorley edmorley self-assigned this Oct 29, 2021
@edmorley
Copy link
Member Author

Example of a new error shown when conflicting (invalid) dependency combinations are attempted to be installed:

$ pip install requests==2.26.0 'urllib3<1.21'
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting requests==2.26.0
  Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 2.2 MB/s
Collecting urllib3<1.21
  Downloading urllib3-1.20-py2.py3-none-any.whl (111 kB)
     |████████████████████████████████| 111 kB 29.1 MB/s
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests==2.26.0) (2.10)
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.7-py3-none-any.whl (38 kB)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests==2.26.0) (2020.12.5)
ERROR: Cannot install requests==2.26.0 and urllib3<1.21 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested urllib3<1.21
    requests 2.26.0 depends on urllib3<1.27 and >=1.21.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

I'll cover these in the changelog entry (the pip docs linked from the PR description explains how to resolve these).

@edmorley edmorley merged commit b82ddba into main Nov 1, 2021
@edmorley edmorley deleted the update-pip branch November 1, 2021 16:29
@edmorley edmorley mentioned this pull request Nov 1, 2021
@edmorley
Copy link
Member Author

edmorley commented Nov 1, 2021

@edmorley
Copy link
Member Author

edmorley commented Nov 1, 2021

For apps that need a temporary workaround until you have time to fix the app's dependencies, you can pin to the previous version of the buildpack (v201), using the approach described here:
https://devcenter.heroku.com/articles/buildpacks#buildpack-references

davidofwatkins referenced this pull request in zenput/heroku-buildpack-python Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pip 20.3+ and its new dependency resolver
2 participants