Skip to content

chore(multiple samples) Update pytest dependencies to solve dependabot security alerts.#14147

Open
XrossFox wants to merge 12 commits into
GoogleCloudPlatform:mainfrom
XrossFox:python-pytest-dependency-update-1
Open

chore(multiple samples) Update pytest dependencies to solve dependabot security alerts.#14147
XrossFox wants to merge 12 commits into
GoogleCloudPlatform:mainfrom
XrossFox:python-pytest-dependency-update-1

Conversation

@XrossFox
Copy link
Copy Markdown
Contributor

@XrossFox XrossFox commented May 8, 2026

Description

This PR is an attempt at upgrading Pytest dependencies for all samples. Update from various older versions to Pytest 9.0.3. This is to solve about 381 dependabot security alerts.

Also took the liberty to update most noxfile_config.py files to run the most older and newest versions of python, 3.10 and 3.14. This is because Pytest 9.0.3 only supports Python 3.10 onwards, since previous python versions have already been discontinued by October 31 2025.

Also updated base noxfile-template to reflect this change.

Extra: fixed some dependencies that had ditched support for older python versions, and ran linter for some samples as part of nox test command.

Fixes b/511241844

Regarding failing pipelines:

I have reviewed pipelines and all remaining errors or failures are unrelated to Pytest updates, with one exception.

This is the list of failing samples, which will be fixed in a case by case basis independently at a later point.

  • storage/samples/snippets - weird nox file (does not follow our implementation)
  • people-and-planet-ai/image-classification
  • storage/s3-sdk
  • trace/cloud-trace-demo-app-opentelemetry/app
  • translate/samples/snippets/hybrid_glossaries
  • videointelligence/samples/analyze
  • functions/v2/label_gce_instancefunctions/spanner
  • functions/spanner
  • discoveryengine
  • cloud_tasks/http_queues
  • batch

all appengine/ (most appengine samples are older and do not use nox)

  • appengine/flexible/storage

  • appengine/flexible/tasks

  • asset/snippets/

  • custom-credentials/aws/

  • custom-credentials/okta

  • cloud_tasks/http_queues

  • cloud_tasks/snippets

  • compute/client_library

  • compute/oslogin

  • dataflow/gemma/streaming

  • dataflow/gpu-examples/pytorch-minimal

  • gpu-examples/tensorflow-minimal

  • dataflow/run-inference

  • dataflow/snippets

  • datalabeling/snippets [BREAKING CHANGE with Pytest 9.0.3]

-dataproc/snippets
-datastore/samples/snippets

  • discoveryengine
  • functions/slack
  • functions/v2/label_gce_instance
  • functions/v2/hello-datastore
  • functions/v2/hello-firestore
  • functions/v2/upper-firestore
  • trace/cloud-trace-demo-app-opentelemetry/app
  • translate/samples/snippets/hybrid_glossaries
  • videointelligence/samples/analyze

-alloydb/notebooks
-automl/snippets
-blog/introduction_to_data_models_in_cloud_datastore
-contact-center-insights/snippets

  • contentwarehouse/snippets

  • dialogflow

  • dlp/snippets

  • document/ai

  • iam/cloud-client/snippets

  • genai/video_generation

  • model_garden/anthropic

  • monitoring/opencensus

  • optimization/snippets

  • people-and-planet-ai/weather-forecasting/tests/overview_tests

  • pubsublite/spark-connector

  • recaptcha_enterprise/snippets

  • retail/interactive-tutorials/search

  • securitycenter/snippets_management_api

  • securitycenter/snippets_v2

  • tpu

@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: auth Issues related to the Google Authentication API labels May 8, 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 several dependencies, but the review identifies that the specified versions for pytest and google-cloud-storage do not exist on PyPI, which will cause installation failures. Additionally, the reviewer suggests splitting the PR to separate test and production dependency updates to follow the best practice of focusing on a single change per pull request.

Comment thread auth/api-client/requirements-test.txt
Comment thread auth/api-client/requirements.txt
Comment thread auth/api-client/requirements.txt
@XrossFox XrossFox added kokoro:run Add this label to force Kokoro to re-run the tests. and removed kokoro:run Add this label to force Kokoro to re-run the tests. labels May 12, 2026
supportd, and max version supported (3.10 and 3.14).
@XrossFox XrossFox added the kokoro:run Add this label to force Kokoro to re-run the tests. label May 13, 2026
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label May 13, 2026
@XrossFox XrossFox added the kokoro:run Add this label to force Kokoro to re-run the tests. label May 13, 2026
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label May 13, 2026
@XrossFox XrossFox marked this pull request as ready for review May 15, 2026 19:58
@XrossFox XrossFox requested review from a team as code owners May 15, 2026 19:58
@XrossFox XrossFox requested review from a team, chalmerlowe, tswast and yuriatgoogle as code owners May 15, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: auth Issues related to the Google Authentication API samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants