Skip to content

fix(templates): resolve core dependencies locally and batch pip installs#17032

Merged
parthea merged 5 commits into
mainfrom
update-core-deps-nox-session
May 12, 2026
Merged

fix(templates): resolve core dependencies locally and batch pip installs#17032
parthea merged 5 commits into
mainfrom
update-core-deps-nox-session

Conversation

@ohmayr
Copy link
Copy Markdown
Contributor

@ohmayr ohmayr commented May 11, 2026

fix(templates): resolve core dependencies locally and batch pip installs

Previously, the core_deps_from_source and prerelease_deps nox sessions installed core sibling packages sequentially. In a monorepo environment, this caused two major issues:

  1. Correctness: It frequently fetched remote upstream code (or PyPI releases) instead of testing the actual local code modified in the active PR.
  2. Performance: Sequential pip install commands triggered strict dependency resolution repeatedly, leading to severe CI timeouts.

This updates the noxfile template to:

  • Dynamically resolve first-party dependencies from the local packages/ directory to guarantee the presubmit tests the active PR's code.
  • Batch the pip install commands using --no-deps and --ignore-installed to bypass the resolver overhead and eliminate the sequential network bottleneck.
  • Dynamically sort packages in prerelease_deps into local vs. PyPI deployments using a regex parser, ensuring safe handling of complex version bounds (e.g., grpcio>=1.75.1) without hardcoding multiple lists.

@ohmayr ohmayr requested a review from a team as a code owner May 11, 2026 20:42
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 noxfile.py template and its corresponding golden files to install core dependencies from local paths instead of remote git repositories. Feedback indicates that a comment needs updating to reflect the new variable name core_packages. Additionally, the logic for locating the packages directory is currently too simplistic and will fail for nested golden files; a more robust traversal method was suggested to ensure the correct path is resolved.

Comment thread packages/gapic-generator/gapic/templates/noxfile.py.j2 Outdated
Comment thread packages/gapic-generator/gapic/templates/noxfile.py.j2 Outdated
@ohmayr ohmayr changed the title chore(templates): resolve core dependencies from local sibling paths fix(templates): resolve core dependencies locally and batch pip installs May 11, 2026
@parthea parthea merged commit 5ca8803 into main May 12, 2026
89 checks passed
@parthea parthea deleted the update-core-deps-nox-session branch May 12, 2026 14:57
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