Skip to content

Commit d7d730a

Browse files
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no attribute '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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtbWFwc3BsYXRmb3JtZGF0YXNldHMvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY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thonios Partheniou <partheniou@google.com>
1 parent 81d36fc commit d7d730a

99 files changed

Lines changed: 3223 additions & 2587 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-geo-type/google/geo/type/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-geo-type/noxfile.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,15 @@ def docs(session):
282282

283283
session.install("-e", ".")
284284
session.install(
285+
# We need to pin to specific versions of the `sphinxcontrib-*` packages
286+
# which still support sphinx 4.x.
287+
# See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
288+
# and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
289+
"sphinxcontrib-applehelp==1.0.4",
290+
"sphinxcontrib-devhelp==1.0.2",
291+
"sphinxcontrib-htmlhelp==2.0.1",
292+
"sphinxcontrib-qthelp==1.0.3",
293+
"sphinxcontrib-serializinghtml==1.1.5",
285294
"sphinx==4.5.0",
286295
"alabaster",
287296
"recommonmark",
@@ -308,6 +317,15 @@ def docfx(session):
308317

309318
session.install("-e", ".")
310319
session.install(
320+
# We need to pin to specific versions of the `sphinxcontrib-*` packages
321+
# which still support sphinx 4.x.
322+
# See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
323+
# and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
324+
"sphinxcontrib-applehelp==1.0.4",
325+
"sphinxcontrib-devhelp==1.0.2",
326+
"sphinxcontrib-htmlhelp==2.0.1",
327+
"sphinxcontrib-qthelp==1.0.3",
328+
"sphinxcontrib-serializinghtml==1.1.5",
311329
"gcp-sphinx-docfx-yaml",
312330
"alabaster",
313331
"recommonmark",

packages/google-geo-type/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
dependencies = [
4242
"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.*",
43+
"google-auth >= 2.14.1, <3.0.0dev",
4344
"proto-plus >= 1.22.3, <2.0.0dev",
4445
"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",
4546
]

packages/google-geo-type/testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
77
google-api-core==1.34.0
8+
google-auth==2.14.1
89
proto-plus==1.22.3
910
protobuf==3.19.5

packages/google-maps-addressvalidation/google/maps/addressvalidation/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.8" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.8" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/services/address_validation/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ def _read_environment_variables():
359359
)
360360
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
361361

362+
@staticmethod
362363
def _get_client_cert_source(provided_cert_source, use_cert_flag):
363364
"""Return the client cert source to be used by the client.
364365
@@ -377,6 +378,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
377378
client_cert_source = mtls.default_client_cert_source()
378379
return client_cert_source
379380

381+
@staticmethod
380382
def _get_api_endpoint(
381383
api_override, client_cert_source, universe_domain, use_mtls_endpoint
382384
):
@@ -451,17 +453,18 @@ def _compare_universes(
451453
Raises:
452454
ValueError: when client_universe does not match the universe in credentials.
453455
"""
454-
if credentials:
455-
credentials_universe = credentials.universe_domain
456-
if client_universe != credentials_universe:
457-
default_universe = AddressValidationClient._DEFAULT_UNIVERSE
458-
raise ValueError(
459-
"The configured universe domain "
460-
f"({client_universe}) does not match the universe domain "
461-
f"found in the credentials ({credentials_universe}). "
462-
"If you haven't configured the universe domain explicitly, "
463-
f"`{default_universe}` is the default."
464-
)
456+
457+
default_universe = AddressValidationClient._DEFAULT_UNIVERSE
458+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
459+
460+
if client_universe != credentials_universe:
461+
raise ValueError(
462+
"The configured universe domain "
463+
f"({client_universe}) does not match the universe domain "
464+
f"found in the credentials ({credentials_universe}). "
465+
"If you haven't configured the universe domain explicitly, "
466+
f"`{default_universe}` is the default."
467+
)
465468
return True
466469

467470
def _validate_universe_domain(self):

packages/google-maps-addressvalidation/samples/generated_samples/snippet_metadata_google.maps.addressvalidation.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-maps-addressvalidation",
11-
"version": "0.3.8"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-maps-addressvalidation/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
dependencies = [
4444
"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.*",
45+
"google-auth >= 2.14.1, <3.0.0dev",
4546
"proto-plus >= 1.22.3, <2.0.0dev",
4647
"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",
4748
"google-geo-type >= 0.1.0, <1.0.0dev",

packages/google-maps-addressvalidation/testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
77
google-api-core==1.34.0
8+
google-auth==2.14.1
89
proto-plus==1.22.3
910
protobuf==3.19.5
1011
google-geo-type==0.1.0

0 commit comments

Comments
 (0)