chore(multiple samples) Updating all instances of requests dependency.#14202
chore(multiple samples) Updating all instances of requests dependency.#14202XrossFox wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the requests library to version 2.34.2 across numerous requirements.txt files and introduces a Python version constraint of >= 3.10. Review feedback highlights that the absence of fallback entries for Python versions older than 3.10 will cause runtime errors in those environments. Additionally, the [security] extra is noted as deprecated and should be removed, and one file is identified as autogenerated, requiring updates to be made to the source configuration rather than the compiled file.
| google-auth-httplib2==0.2.0 | ||
| google-auth==2.38.0 | ||
| requests==2.32.4 | ||
| requests==2.34.2; python_version >= '3.10' |
There was a problem hiding this comment.
The addition of the ; python_version >= '3.10' environment marker without a corresponding entry for older Python versions will cause the requests library to be completely omitted when installing dependencies on Python < 3.10. This will lead to an ImportError at runtime for any environment using an older Python version. Since many samples in this repository still support Python versions as old as 3.7 or even 2.7 (as seen in other requirements.txt files), please provide a fallback version for those environments.
requests==2.32.4; python_version < '3.10'
requests==2.34.2; python_version >= '3.10'
| Werkzeug==2.3.8; python_version < '3.7' | ||
| gunicorn==23.0.0 | ||
| requests[security]==2.31.0 | ||
| requests[security]==2.34.2; python_version >= '3.10' |
There was a problem hiding this comment.
The [security] extra for the requests library has been a no-op since version 2.6.0 and is officially deprecated. It is recommended to remove it. Additionally, as noted in other files, the python_version >= '3.10' marker requires a fallback version for older Python environments to avoid breaking the sample.
requests==2.31.0; python_version < '3.10'
requests==2.34.2; python_version >= '3.10'
| regex==2023.12.25 | ||
| # via apache-beam | ||
| requests==2.31.0 | ||
| requests==2.34.2; python_version >= '3.10' |
There was a problem hiding this comment.
This file is autogenerated by pip-compile, as indicated in the header on line 15. Manual edits to this file will be overwritten the next time the dependencies are compiled. To update this dependency correctly, you should modify the source file (e.g., pyproject.toml or requirements.in) and regenerate this file using the pip-compile command.
WIP
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
nox -s py-3.9(see Test Environment Setup)nox -s lint(see Test Environment Setup)