Skip to content

feat: regenerate asset w/ dependencies using generator v1.32.0#17153

Open
chalmerlowe wants to merge 2 commits into
mainfrom
fix-asset-dependencies-1.32.0
Open

feat: regenerate asset w/ dependencies using generator v1.32.0#17153
chalmerlowe wants to merge 2 commits into
mainfrom
fix-asset-dependencies-1.32.0

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe commented May 15, 2026

Updates post processing to account for dropping support for Python 3.7, 3.8, 3.9 and impacts that has on using 3.10 for lower bounds testing.

Adds google-cloud-org-policy to post-processing for insertion into google-cloud-asset files:

  • setup.py
  • constraints-3.10.txt

google-cloud-asset was failing to regenerate successfully due to missing dependency on org-policy.

Partially corrects #17152 🦕

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 enables code generation for the google-cloud-asset package, drops support for Python 3.9, and updates several dependency constraints. Key changes include fixing asynchronous calls in generated samples, updating Python version warnings, and refining test assertions for REST parameter comparison. Review feedback identifies critical issues in the new post-processing YAML file, specifically the use of fragile hardcoded versions and pattern mismatches that will likely cause replacement failures. Additionally, the removal of the warnings-as-errors flag in the documentation build was flagged as a violation of standards regarding shared configuration changes.

Comment on lines +20 to +26
before: |
dependencies = \[
"google-api-core\[grpc\] >= 2.17.1, <3.0.0",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
"grpcio >= 1.44.0, < 2.0.0",
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 before block uses hardcoded versions which makes the replacement fragile. Per the repository rules, use flexible regex patterns like [\s\S]* to match version strings instead of hardcoding specific versions. This ensures the replacement logic remains functional even when dependency versions are updated in the source files, preventing match failures.

    before: |
      dependencies = [
          "google-api-core[grpc] >= [\s\S]*, <3.0.0",
          # Exclude incompatible versions of `google-auth`
          # See https://github.com/googleapis/google-cloud-python/issues/12364
          "google-auth >= [\s\S]*, <3.0.0,!=2.24.0,!=2.25.0",
          "grpcio >= [\s\S]*, < 2.0.0",
References
  1. When defining search patterns for automated code replacements in librarian post-processing YAML files, use flexible regex patterns (such as [\s\S]*) to match version strings instead of hardcoding specific versions.

Comment on lines +40 to +42
before: |
google-api-core==2.17.1
google-auth==2.14.1
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 before block for constraints-3.10.txt expects pinned versions (google-api-core==2.17.1), but the source file (as seen in the diff's LEFT side) contains unpinned library names. This replacement will likely fail to match and apply if the generator still outputs unpinned names.

    before: |
      google-api-core
      google-auth

session.run(
"sphinx-build",
"-W", # warnings as errors
"-T", # show full traceback on exception
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 -W flag (warnings as errors) has been removed from the sphinx-build command. Changes to shared configurations should be applied consistently across all relevant packages in a dedicated, universal change rather than piecemeal in individual pull requests. If this flag needs to be changed, it should be done as a repository-wide update.

References
  1. Changes to shared configurations, like mypy flags, should be applied consistently across all relevant packages in a dedicated, universal change rather than piecemeal in individual pull requests.

@chalmerlowe chalmerlowe force-pushed the fix-asset-dependencies-1.32.0 branch from d94f5ca to 8f6927d Compare May 15, 2026 11:42
@chalmerlowe chalmerlowe changed the title feat: regenerate asset dependencies using generator v1.32.0 feat: regenerate asset w/ dependencies using generator v1.32.0 May 15, 2026
@chalmerlowe chalmerlowe marked this pull request as ready for review May 15, 2026 15:29
@chalmerlowe chalmerlowe requested review from a team as code owners May 15, 2026 15:29
@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented May 15, 2026

So was everything other than the content of librarian.yaml and the post-processing scripts generated with Librarian? If so, :shipit: ! :) (Well, if Python folks are happy, anyway.)

chalmerlowe pushed a commit that referenced this pull request May 15, 2026
Updates post processing to account for dropping support for Python 3.7,
3.8, 3.9 and impacts that has on using 3.10 for lower bounds testing.

Bumps `google-auth` to `>=2.23.3` to prevent dependency resolution issue
when used in sync with `google-cloud-storage`

Corrects a deficiency in the constraints template that did not capture
all the necessary bounds from `setup.py`

Partially corrects #17153 🦕
@chalmerlowe
Copy link
Copy Markdown
Contributor Author

So was everything other than the content of librarian.yaml and the post-processing scripts generated with Librarian? If so, :shipit: ! :) (Well, if Python folks are happy, anyway.)

yes, yes, it was!!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants