Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/gapic-generator/gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,12 @@ def core_deps_from_source(session, protobuf_implementation):
# added to the list below so that it is installed from source, rather than PyPI
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
core_dependencies_from_source = [
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
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

There are several concerns with switching to local relative paths in the template:

  1. Missing Variable Definition: CURRENT_DIRECTORY is used in the f-strings but its definition is not visible in the diff. If it is not defined at the top level of the generated noxfile.py, this will result in a NameError at runtime.
  2. Portability Regression: The previous git-based URLs allowed the Nox sessions to be self-contained and runnable from any environment with internet access. Hardcoding relative paths (../<package>) means the generated noxfile.py will only work if it remains within the specific directory structure of the google-cloud-python monorepo. This breaks portability for users who clone or use these packages standalone.
  3. Invalid Path for google-auth: The google-auth package resides in its own repository (googleapis/google-auth-python) and is not a sibling directory within the packages/ folder of this monorepo. Consequently, ../google-auth will fail to resolve.

Consider using a conditional approach that checks for the existence of local paths and falls back to git URLs if they are missing.

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

]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-ads-admanager/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
Comment on lines +601 to +605
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

As noted in the template, using CURRENT_DIRECTORY without a visible definition in this file will cause a NameError. Additionally, the relative path for google-auth is likely incorrect as it is not part of this monorepo's packages/ directory. Furthermore, per repository guidelines, changes to shared configurations should be handled via the template to ensure consistency across all packages, rather than through piecemeal updates to individual files.

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

]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-ads-datamanager/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-ads-marketingplatform-admin/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-ai-generativelanguage/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-analytics-admin/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-analytics-data/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
10 changes: 5 additions & 5 deletions packages/google-apps-card/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ def core_deps_from_source(session, protobuf_implementation):
# Note: If a dependency is added to the `core_dependencies_from_source` list,
# the `prerel_deps` list in the `prerelease_deps` nox session should also be updated.
core_dependencies_from_source = [
"googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos",
"google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core",
"google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth",
"grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1",
"proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus",
f"{CURRENT_DIRECTORY}/../googleapis-common-protos",
f"{CURRENT_DIRECTORY}/../google-api-core",
f"{CURRENT_DIRECTORY}/../google-auth",
f"{CURRENT_DIRECTORY}/../grpc-google-iam-v1",
f"{CURRENT_DIRECTORY}/../proto-plus",
]

for dep in core_dependencies_from_source:
Expand Down
Loading
Loading