Skip to content

Commit

Permalink
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no a…
Browse files Browse the repository at this point in the history
…ttribute 'universe_domain' (googleapis#12268)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
fix: Resolve AttributeError 'Credentials' object has no attribute
'universe_domain'
fix: Add google-auth as a direct dependency
fix: Add staticmethod decorator to `_get_client_cert_source` and
`_get_api_endpoint`
END_COMMIT_OVERRIDE



chore: Update gapic-generator-python to v1.14.1
PiperOrigin-RevId: 603728206

Source-Link:
googleapis/googleapis@9063da8

Source-Link:
https://github.com/googleapis/googleapis-gen/commit/891c67d0a855b08085eb301dabb14064ef4b2c6d
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWdlby10eXBlLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0=
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYWRkcmVzc3ZhbGlkYXRpb24vLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUtZGVsaXZlcnkvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ==
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtbWFwc3BsYXRmb3JtZGF0YXNldHMvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2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co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Feb 3, 2024
1 parent 81d36fc commit d7d730a
Show file tree
Hide file tree
Showing 99 changed files with 3,223 additions and 2,587 deletions.
2 changes: 1 addition & 1 deletion packages/google-geo-type/google/geo/type/gapic_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.3.4" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
18 changes: 18 additions & 0 deletions packages/google-geo-type/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ def docs(session):

session.install("-e", ".")
session.install(
# We need to pin to specific versions of the `sphinxcontrib-*` packages
# which still support sphinx 4.x.
# See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
# and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
"sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.5",
"sphinx==4.5.0",
"alabaster",
"recommonmark",
Expand All @@ -308,6 +317,15 @@ def docfx(session):

session.install("-e", ".")
session.install(
# We need to pin to specific versions of the `sphinxcontrib-*` packages
# which still support sphinx 4.x.
# See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
# and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
"sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.5",
"gcp-sphinx-docfx-yaml",
"alabaster",
"recommonmark",
Expand Down
1 change: 1 addition & 0 deletions packages/google-geo-type/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

dependencies = [
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
"google-auth >= 2.14.1, <3.0.0dev",
"proto-plus >= 1.22.3, <2.0.0dev",
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
]
Expand Down
1 change: 1 addition & 0 deletions packages/google-geo-type/testing/constraints-3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# 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.0
google-auth==2.14.1
proto-plus==1.22.3
protobuf==3.19.5
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.3.8" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.3.8" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def _read_environment_variables():
)
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env

@staticmethod
def _get_client_cert_source(provided_cert_source, use_cert_flag):
"""Return the client cert source to be used by the client.
Expand All @@ -377,6 +378,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
client_cert_source = mtls.default_client_cert_source()
return client_cert_source

@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
Expand Down Expand Up @@ -451,17 +453,18 @@ def _compare_universes(
Raises:
ValueError: when client_universe does not match the universe in credentials.
"""
if credentials:
credentials_universe = credentials.universe_domain
if client_universe != credentials_universe:
default_universe = AddressValidationClient._DEFAULT_UNIVERSE
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)

default_universe = AddressValidationClient._DEFAULT_UNIVERSE
credentials_universe = getattr(credentials, "universe_domain", default_universe)

if client_universe != credentials_universe:
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)
return True

def _validate_universe_domain(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-maps-addressvalidation",
"version": "0.3.8"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
1 change: 1 addition & 0 deletions packages/google-maps-addressvalidation/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

dependencies = [
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
"google-auth >= 2.14.1, <3.0.0dev",
"proto-plus >= 1.22.3, <2.0.0dev",
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"google-geo-type >= 0.1.0, <1.0.0dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# 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.0
google-auth==2.14.1
proto-plus==1.22.3
protobuf==3.19.5
google-geo-type==0.1.0
Loading

0 comments on commit d7d730a

Please sign in to comment.