cloud-sql-python-connector 1.15.0__py2.py3-none-any.whl → 1.16.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloud-sql-python-connector
3
- Version: 1.15.0
3
+ Version: 1.16.0
4
4
  Summary: The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.
5
5
  Home-page: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
6
6
  Author: Google LLC
@@ -3,8 +3,8 @@ google/cloud/sql/connector/asyncpg.py,sha256=HUOB0rRhr2-zMbygDtdWTDNlYqEPkN0ADqC
3
3
  google/cloud/sql/connector/client.py,sha256=ocUN1nrgZyJRnxgh6Ym3w0c_qKb8hqKCmR1OiJ2KUpM,12622
4
4
  google/cloud/sql/connector/connection_info.py,sha256=cFNOeHJ0lQODf7q5Hc25LXsNWzWgzYcFMrBuNdZ1y5k,4430
5
5
  google/cloud/sql/connector/connection_name.py,sha256=4F5XhgmSWGEeF-3TJk2E61YPbxMAecPGw56nPTZmQ2o,2067
6
- google/cloud/sql/connector/connector.py,sha256=9t2iz_Tx1NluGgaM8JlZUfb7HWHgsWjmLnAL8WvKp4E,21157
7
- google/cloud/sql/connector/enums.py,sha256=44tfMm8D_t0ls6GfKwiQ6YkslWM21PZR40RhJPWntkc,2882
6
+ google/cloud/sql/connector/connector.py,sha256=y5Y2DTNzxMqlpJX_7yVb3kAFe1Fhbva-PqTWbTXRn0U,21363
7
+ google/cloud/sql/connector/enums.py,sha256=dVBS9eEWNrHtzze0AJlmtbdUogG3EocNWOQcI_8qPd0,2937
8
8
  google/cloud/sql/connector/exceptions.py,sha256=eyflYggkKZx3t944FTPqQrX-R75lZgtpOwC4uVLPhG0,1823
9
9
  google/cloud/sql/connector/instance.py,sha256=nRzhE7t_M6AhjiYvEZHOjkBHx3d9wGRCC6RekgDApFI,8379
10
10
  google/cloud/sql/connector/lazy.py,sha256=p1wLte49xE_aHiY5shjMbxwytgW-ycS0Hd67C34gaDY,4631
@@ -16,9 +16,9 @@ google/cloud/sql/connector/rate_limiter.py,sha256=bPTupfM4f5QRSCmCAWMqjQylEB7bUM
16
16
  google/cloud/sql/connector/refresh_utils.py,sha256=HfuuLdlqg2IxusB4T3BMj-BJlGsXtHsrCX_Hp-eJ_j0,5063
17
17
  google/cloud/sql/connector/resolver.py,sha256=cNDJMhmS_0CIAmz8kCABKHJNLNm1wiwIVoPEN-gWzzY,2850
18
18
  google/cloud/sql/connector/utils.py,sha256=7g1fX-JsZc7xOgTuxrAiroFHQIQk_BEJZNYaKOinwQY,3508
19
- google/cloud/sql/connector/version.py,sha256=l3R3usCjpr4Wwp3w2gpWFcrGmsLi8Y1gAAvZC15RLv0,598
20
- cloud_sql_python_connector-1.15.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
21
- cloud_sql_python_connector-1.15.0.dist-info/METADATA,sha256=Qszn2k_QqcVlX92c_1A-7MurYUoojTIMbx5M13aPZnI,30314
22
- cloud_sql_python_connector-1.15.0.dist-info/WHEEL,sha256=OpXWERl2xLPRHTvd2ZXo_iluPEQd8uSbYkJ53NAER_Y,109
23
- cloud_sql_python_connector-1.15.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
24
- cloud_sql_python_connector-1.15.0.dist-info/RECORD,,
19
+ google/cloud/sql/connector/version.py,sha256=STYwswkV70z2aymP3esep2gpFhkstu_2LjfQInftIYQ,598
20
+ cloud_sql_python_connector-1.16.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
21
+ cloud_sql_python_connector-1.16.0.dist-info/METADATA,sha256=VWU4GVMFcsAHimOPNqQXBKaw7HF4Mru-St5b27U0vvA,30314
22
+ cloud_sql_python_connector-1.16.0.dist-info/WHEEL,sha256=OpXWERl2xLPRHTvd2ZXo_iluPEQd8uSbYkJ53NAER_Y,109
23
+ cloud_sql_python_connector-1.16.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
24
+ cloud_sql_python_connector-1.16.0.dist-info/RECORD,,
@@ -19,9 +19,10 @@ from __future__ import annotations
19
19
  import asyncio
20
20
  from functools import partial
21
21
  import logging
22
+ import os
22
23
  from threading import Thread
23
24
  from types import TracebackType
24
- from typing import Any, Optional, Type, Union
25
+ from typing import Any, Optional, Union
25
26
 
26
27
  import google.auth
27
28
  from google.auth.credentials import Credentials
@@ -65,7 +66,7 @@ class Connector:
65
66
  user_agent: Optional[str] = None,
66
67
  universe_domain: Optional[str] = None,
67
68
  refresh_strategy: str | RefreshStrategy = RefreshStrategy.BACKGROUND,
68
- resolver: Type[DefaultResolver] | Type[DnsResolver] = DefaultResolver,
69
+ resolver: type[DefaultResolver] | type[DnsResolver] = DefaultResolver,
69
70
  ) -> None:
70
71
  """Initializes a Connector instance.
71
72
 
@@ -171,7 +172,11 @@ class Connector:
171
172
  if isinstance(ip_type, str):
172
173
  ip_type = IPTypes._from_str(ip_type)
173
174
  self._ip_type = ip_type
174
- self._universe_domain = universe_domain
175
+ # check for universe domain arg and then env var
176
+ if universe_domain:
177
+ self._universe_domain = universe_domain
178
+ else:
179
+ self._universe_domain = os.environ.get("GOOGLE_CLOUD_UNIVERSE_DOMAIN") # type: ignore
175
180
  # construct service endpoint for Cloud SQL Admin API calls
176
181
  if not sqladmin_api_endpoint:
177
182
  self._sqladmin_api_endpoint = (
@@ -391,7 +396,7 @@ class Connector:
391
396
 
392
397
  def __exit__(
393
398
  self,
394
- exc_type: Optional[Type[BaseException]],
399
+ exc_type: Optional[type[BaseException]],
395
400
  exc_val: Optional[BaseException],
396
401
  exc_tb: Optional[TracebackType],
397
402
  ) -> None:
@@ -404,7 +409,7 @@ class Connector:
404
409
 
405
410
  async def __aexit__(
406
411
  self,
407
- exc_type: Optional[Type[BaseException]],
412
+ exc_type: Optional[type[BaseException]],
408
413
  exc_val: Optional[BaseException],
409
414
  exc_tb: Optional[TracebackType],
410
415
  ) -> None:
@@ -19,9 +19,10 @@ from enum import Enum
19
19
  from google.cloud.sql.connector.exceptions import IncompatibleDriverError
20
20
 
21
21
 
22
+ # TODO: Replace Enum with StrEnum when Python 3.11 is minimum supported version
22
23
  class RefreshStrategy(Enum):
23
- LAZY: str = "LAZY"
24
- BACKGROUND: str = "BACKGROUND"
24
+ LAZY = "LAZY"
25
+ BACKGROUND = "BACKGROUND"
25
26
 
26
27
  @classmethod
27
28
  def _missing_(cls, value: object) -> None:
@@ -37,9 +38,9 @@ class RefreshStrategy(Enum):
37
38
 
38
39
 
39
40
  class IPTypes(Enum):
40
- PUBLIC: str = "PRIMARY"
41
- PRIVATE: str = "PRIVATE"
42
- PSC: str = "PSC"
41
+ PUBLIC = "PRIMARY"
42
+ PRIVATE = "PRIVATE"
43
+ PSC = "PSC"
43
44
 
44
45
  @classmethod
45
46
  def _missing_(cls, value: object) -> None:
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "1.15.0"
15
+ __version__ = "1.16.0"