]> jfr.im git - yt-dlp.git/commitdiff
[rh:requests] Bump minimum `requests` version to 2.32.2 (#10079)
authorbashonly <redacted>
Sat, 1 Jun 2024 18:57:23 +0000 (13:57 -0500)
committerGitHub <redacted>
Sat, 1 Jun 2024 18:57:23 +0000 (18:57 +0000)
Closes #10078
Authored by: bashonly

README.md
bundle/py2exe.py
pyproject.toml
yt_dlp/networking/_requests.py

index e8cd6d3a06f8c9b578edefed4aa0f289320c0dd4..42ffd9b5202101ae952bebca25ae90decf86bb7c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -262,7 +262,7 @@ ### Platform-independent Binary (UNIX)
 
 ### Standalone Py2Exe Builds (Windows)
 
-While we provide the option to build with [py2exe](https://www.py2exe.org), it is recommended to build [using PyInstaller](#standalone-pyinstaller-builds) instead since the py2exe builds **cannot contain `pycryptodomex`/`certifi` and need VC++14** on the target computer to run.
+While we provide the option to build with [py2exe](https://www.py2exe.org), it is recommended to build [using PyInstaller](#standalone-pyinstaller-builds) instead since the py2exe builds **cannot contain `pycryptodomex`/`certifi`/`requests` and need VC++14** on the target computer to run.
 
 If you wish to build it anyway, install Python (if it is not already installed) and you can run the following commands:
 
index 2811674925b09ca773e7a0f1f2f455ba588e3e81..5fbe55e465e32a5f58614c224f03e764d3b7509e 100755 (executable)
@@ -42,9 +42,9 @@ def main():
                 # py2exe cannot import Crypto
                 'Crypto',
                 'Cryptodome',
-                # py2exe appears to confuse this with our socks library.
-                # We don't use pysocks and urllib3.contrib.socks would fail to import if tried.
-                'urllib3.contrib.socks'
+                # requests >=2.32.0 breaks py2exe builds due to certifi dependency
+                'requests',
+                'urllib3'
             ],
             'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
             # Modules that are only imported dynamically must be added here
index b746fbc96426f979f5bb5c4251f27dcef76b33ba..da6403ec7cc6924a815584e3413dd0e831c83e53 100644 (file)
@@ -46,7 +46,7 @@ dependencies = [
     "certifi",
     "mutagen",
     "pycryptodomex",
-    "requests>=2.31.0,<3",
+    "requests>=2.32.2,<3",
     "urllib3>=1.26.17,<3",
     "websockets>=12.0",
 ]
@@ -82,7 +82,6 @@ pyinstaller = [
 ]
 py2exe = [
     "py2exe>=0.12",
-    "requests==2.31.*",
 ]
 
 [project.urls]
index 6397a2c0ca924ff52076a0783d6f39460428faca..bf6fa634ddb2b6193c59e18343f8f119937169d3 100644 (file)
@@ -21,8 +21,8 @@
 if urllib3_version < (1, 26, 17):
     raise ImportError('Only urllib3 >= 1.26.17 is supported')
 
-if requests.__build__ < 0x023100:
-    raise ImportError('Only requests >= 2.31.0 is supported')
+if requests.__build__ < 0x023202:
+    raise ImportError('Only requests >= 2.32.2 is supported')
 
 import requests.adapters
 import requests.utils
@@ -182,14 +182,9 @@ def proxy_manager_for(self, proxy, **proxy_kwargs):
         return super().proxy_manager_for(proxy, **proxy_kwargs, **self._pm_args, **extra_kwargs)
 
     # Skip `requests` internal verification; we use our own SSLContext
-    # requests 2.31.0+
     def cert_verify(*args, **kwargs):
         pass
 
-    # requests 2.31.0-2.32.1
-    def _get_connection(self, request, *_, proxies=None, **__):
-        return self.get_connection(request.url, proxies)
-
     # requests 2.32.2+: Reimplementation without `_urllib3_request_context`
     def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None):
         url = urllib3.util.parse_url(request.url).url