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

MNT: (deps): Bump requests from 2.28.1 to 2.32.3 in /ci #780

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 4, 2024

Bumps requests from 2.28.1 to 2.32.3.

Release notes

Sourced from requests's releases.

v2.32.3

2.32.3 (2024-05-29)

Bugfixes

  • Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of HTTPAdapter. (#6716)
  • Fixed issue where Requests started failing to run on Python versions compiled without the ssl module. (#6724)

v2.32.2

2.32.2 (2024-05-21)

Deprecations

  • To provide a more stable migration for custom HTTPAdapters impacted by the CVE changes in 2.32.0, we've renamed _get_connection to a new public API, get_connection_with_tls_context. Existing custom HTTPAdapters will need to migrate their code to use this new API. get_connection is considered deprecated in all versions of Requests>=2.32.0.

    A minimal (2-line) example has been provided in the linked PR to ease migration, but we strongly urge users to evaluate if their custom adapter is subject to the same issue described in CVE-2024-35195. (#6710)

v2.32.1

2.32.1 (2024-05-20)

Bugfixes

  • Add missing test certs to the sdist distributed on PyPI.

v2.32.0

2.32.0 (2024-05-20)

🐍 PYCON US 2024 EDITION 🐍

Security

  • Fixed an issue where setting verify=False on the first request from a Session will cause subsequent requests to the same origin to also ignore cert verification, regardless of the value of verify. (GHSA-9wx4-h78v-vm56)

Improvements

  • verify=True now reuses a global SSLContext which should improve request time variance between first and subsequent requests. It should also minimize certificate load time on Windows systems when using a Python version built with OpenSSL 3.x. (#6667)
  • Requests now supports optional use of character detection (chardet or charset_normalizer) when repackaged or vendored.

... (truncated)

Changelog

Sourced from requests's changelog.

2.32.3 (2024-05-29)

Bugfixes

  • Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of HTTPAdapter. (#6716)
  • Fixed issue where Requests started failing to run on Python versions compiled without the ssl module. (#6724)

2.32.2 (2024-05-21)

Deprecations

  • To provide a more stable migration for custom HTTPAdapters impacted by the CVE changes in 2.32.0, we've renamed _get_connection to a new public API, get_connection_with_tls_context. Existing custom HTTPAdapters will need to migrate their code to use this new API. get_connection is considered deprecated in all versions of Requests>=2.32.0.

    A minimal (2-line) example has been provided in the linked PR to ease migration, but we strongly urge users to evaluate if their custom adapter is subject to the same issue described in CVE-2024-35195. (#6710)

2.32.1 (2024-05-20)

Bugfixes

  • Add missing test certs to the sdist distributed on PyPI.

2.32.0 (2024-05-20)

Security

  • Fixed an issue where setting verify=False on the first request from a Session will cause subsequent requests to the same origin to also ignore cert verification, regardless of the value of verify. (GHSA-9wx4-h78v-vm56)

Improvements

  • verify=True now reuses a global SSLContext which should improve request time variance between first and subsequent requests. It should also minimize certificate load time on Windows systems when using a Python version built with OpenSSL 3.x. (#6667)
  • Requests now supports optional use of character detection (chardet or charset_normalizer) when repackaged or vendored. This enables pip and other projects to minimize their vendoring surface area. The Response.text() and apparent_encoding APIs will default to utf-8 if neither library is present. (#6702)

... (truncated)

Commits
  • 0e322af v2.32.3
  • e188799 Don't create default SSLContext if ssl module isn't present (#6724)
  • 145b539 Merge pull request #6716 from sigmavirus24/bug/6715
  • b1d73dd Don't use default SSLContext with custom poolmanager kwargs
  • 6badbac Update HISTORY.md
  • a62a2d3 Allow for overriding of specific pool key params
  • 88dce9d v2.32.2
  • c98e4d1 Merge pull request #6710 from nateprewitt/api_rename
  • 92075b3 Add deprecation warning
  • aa1461b Move _get_connection to get_connection_with_tls_context
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dopplershift
Copy link
Member

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot-pip-ci-requests-2.32.3 branch from 7b3058a to 03d8bad Compare November 5, 2024 20:30
@dopplershift
Copy link
Member

@dependabot rebase

@dopplershift
Copy link
Member

So the breakage here isn't with requests, but urlllib3, which changed internally how it handles compressed responses starting in v2. The upshot is that broke vcrpy loading our recorded responses. Thankfully, this issue pointed me to how to rewrite, which I did with:

#!/usr/bin/env python3

import pathlib
import yaml
import zlib
try:
    # use the same dumper config as vcr to minimize entropy in the diffs
    from yaml import CDumper as Dumper, CLoader as Loader
except ImportError:
    from yaml import Dumper, Loader


for fname in pathlib.Path('.').glob('**/fixtures/*'):
    print(fname)
    with fname.open('r') as file:
        data = yaml.load(file, Loader=Loader)

    changed = False
    for interaction in data['interactions']:
        response = interaction.get('response', {})
        headers = response.get('headers', {})
        contentType = headers.get('content-encoding') or headers.get('Content-Encoding')
        compressed_string = response['body']['string']
        if contentType and contentType[0] == 'gzip' and compressed_string:
            changed = True
            response['body']['string'] = zlib.decompress(compressed_string, zlib.MAX_WBITS | 16)

    if changed:
        with fname.open('w') as file:
            yaml.dump(data, file, Dumper=Dumper)

This also then requires bumping to vcrpy 4.3.1.

The downside is that the requests/vcrpy updates take us to about an 18 month window. We do have the option (I think) of pinning urllib3 < 2 for now, but I'm not sure it's worth it since those other packages are pure Python.

@dcamron @lesserwhirls Any thoughts?

@dopplershift
Copy link
Member

As discussed on the MetPy call, I think the consensus is that this is reasonable enough. I'll also add that moving to requests 2.30 is a requirement to use Sphinx 8.1.3.

dependabot bot and others added 4 commits November 7, 2024 13:50
Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.32.3.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.28.1...v2.32.3)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
urllib3 2.x changed how it handles compressed responses, which breaks
our existing cassettes. This updates the files to contain the
decompressed responses for compatibilty going forward, and also notes
our constraint in our test requirements in CI.
Definitely don't need these showing up in diffs.
This is needed to get to urllib 2.x, which we now rely on to test
properly. As a result, we also have to bump VCRPy to 4.3.1.
@dcamron dcamron merged commit 2429d32 into main Nov 7, 2024
28 checks passed
@dcamron dcamron deleted the dependabot-pip-ci-requests-2.32.3 branch November 7, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants