Skip to content

chore(multiple samples) Updating all instances of requests dependency.#14202

Draft
XrossFox wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
XrossFox:python-requests-dependency-update-1
Draft

chore(multiple samples) Updating all instances of requests dependency.#14202
XrossFox wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
XrossFox:python-requests-dependency-update-1

Conversation

@XrossFox
Copy link
Copy Markdown
Contributor

WIP

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: appengine Issues related to the App Engine Admin API API. api: auth Issues related to the Google Authentication API api: bigquery Issues related to the BigQuery API. labels May 20, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread aml-ai/requirements.txt
google-auth-httplib2==0.2.0
google-auth==2.38.0
requests==2.32.4
requests==2.34.2; python_version >= '3.10'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: appengine Issues related to the App Engine Admin API API. api: auth Issues related to the Google Authentication API api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant