Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .librarian/generator-input/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def lint(session):
session.run("flake8", "google", "tests")


@nox.session(python="3.13")
@nox.session(python="3.14")
def blacken(session):
"""Run black. Format code to uniform standard."""
session.install(BLACK_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion .librarian/state.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:e7cc6823efb073a8a26e7cefdd869f12ec228abfbd2a44aa9a7eacc284023677
libraries:
- id: google-cloud-logging
version: 3.13.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Comment on lines 94 to 95
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The removal of the scopes_kwargs dictionary simplifies the code by eliminating an unnecessary intermediate variable. This improves readability and directly passes the required arguments.

if not hasattr(self, "_ignore_credentials"):
Expand All @@ -107,11 +105,16 @@ def __init__(

if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
credentials_file,
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Comment on lines 94 to 95
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The removal of the scopes_kwargs dictionary simplifies the code by eliminating an unnecessary intermediate variable. This improves readability and directly passes the required arguments.

if not hasattr(self, "_ignore_credentials"):
Expand All @@ -107,11 +105,16 @@ def __init__(

if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
credentials_file,
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Comment on lines 94 to 95
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The removal of the scopes_kwargs dictionary simplifies the code by eliminating an unnecessary intermediate variable. This improves readability and directly passes the required arguments.

if not hasattr(self, "_ignore_credentials"):
Expand All @@ -107,11 +105,16 @@ def __init__(

if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
credentials_file,
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[mypy]
python_version = 3.7
python_version = 3.14
namespace_packages = True
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def lint(session):
session.run("flake8", "google", "tests")


@nox.session(python="3.13")
@nox.session(python="3.14")
def blacken(session):
"""Run black. Format code to uniform standard."""
session.install(BLACK_VERSION)
Expand Down
2 changes: 2 additions & 0 deletions testing/constraints-3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
google-api-core==1.34.1
# cryptography is a direct dependency of google-auth
cryptography==38.0.3
google-auth==2.14.1
proto-plus==1.22.0
protobuf==3.20.2
Expand Down
2 changes: 2 additions & 0 deletions testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# List all library dependencies and extras in this file.
google-api-core
google-auth
# cryptography is a direct dependency of google-auth
cryptography==38.0.3
proto-plus
protobuf
google-cloud-core
Expand Down