external-systems 0.101.0rc2__py3-none-any.whl → 0.103.0rc1__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.

Potentially problematic release.


This version of external-systems might be problematic. Click here for more details.

@@ -16,4 +16,4 @@
16
16
  # The version is set during the publishing step (since we can't know the version in advance)
17
17
  # using the autorelease bot
18
18
 
19
- __version__ = "0.101.0-rc2"
19
+ __version__ = "0.103.0-rc1"
@@ -20,18 +20,20 @@ from requests.adapters import HTTPAdapter
20
20
  from urllib3.util.retry import Retry
21
21
 
22
22
 
23
- class WrappedSession(Session):
23
+ class CustomCaBundleSession(Session):
24
24
  """
25
25
  A wrapper for requests.Session to override 'verify' property, ignoring REQUESTS_CA_BUNDLE environment variable.
26
26
 
27
- This is a workaround for https://github.com/kennethreitz/requests/issues/3829 (will be fixed in requests 3.0.0)
27
+ This is a workaround for https://github.com/psf/requests/issues/3829 (will be fixed in requests 3.0.0)
28
28
  """
29
29
 
30
30
  def merge_environment_settings(self, url, proxies, stream, verify, *args, **kwargs): # type: ignore[no-untyped-def]
31
31
  if isinstance(self.verify, str):
32
32
  verify = self.verify
33
33
 
34
- return super(WrappedSession, self).merge_environment_settings(url, proxies, stream, verify, *args, **kwargs)
34
+ return super(CustomCaBundleSession, self).merge_environment_settings(
35
+ url, proxies, stream, verify, *args, **kwargs
36
+ )
35
37
 
36
38
 
37
39
  class RetryingTimeoutHttpAdapter(HTTPAdapter):
@@ -97,7 +99,7 @@ def create_proxy_session(proxy_url: str, proxy_token: str) -> Session:
97
99
  """
98
100
 
99
101
  adapter = ProxyAdapter(proxy_auth={proxy_url: f"Bearer {proxy_token}"})
100
- session = WrappedSession()
102
+ session = CustomCaBundleSession()
101
103
  session.mount("http://", adapter)
102
104
  session.mount("https://", adapter)
103
105
  session.proxies = {"all": proxy_url}
@@ -124,7 +126,7 @@ def create_session(
124
126
  timeout (Optional[Union[float, tuple[float, float], tuple[float, None]]]): Timeout settings for the session.
125
127
  """
126
128
 
127
- session = WrappedSession()
129
+ session = CustomCaBundleSession()
128
130
 
129
131
  if cert:
130
132
  session.cert = cert
@@ -29,7 +29,6 @@ from ._connections import HttpsConnection
29
29
  from ._proxies import create_proxy_session
30
30
  from ._refreshable import DefaultSessionCredentialsManager, Refreshable, RefreshHandler
31
31
  from ._sockets import create_socket
32
- from ._utils import read_file
33
32
 
34
33
  log = logging.getLogger(__name__)
35
34
 
@@ -85,26 +84,19 @@ class Source:
85
84
  if self._source_parameters.server_certificates is None:
86
85
  return None
87
86
 
88
- new_ca_contents = []
89
-
90
- # If a custom CA bundle path is provided, use it.
91
- # Otherwise, use the requests CA bundle path if it is set.
87
+ # Precedence of which CA bundle to use for the Session object:
88
+ # 1. Custom CA bundle path (if provided we assume PEM format)
89
+ # 2. Requests CA bundle path
90
+ # 3. Temporary file
92
91
  ca_bundle_path = (
93
92
  self._custom_ca_bundle_path
94
- if self._custom_ca_bundle_path is not None
95
- else os.environ.get("REQUESTS_CA_BUNDLE")
93
+ or os.environ.get("REQUESTS_CA_BUNDLE")
94
+ or NamedTemporaryFile(delete=False, mode="w").name
96
95
  )
97
96
 
98
- # Copy the CA bundle contents to the new CA bundle file.
99
- if ca_bundle_path:
100
- new_ca_contents.append(read_file(ca_bundle_path))
101
-
102
- # Add all CAs for the source
103
- for required_ca in self._source_parameters.server_certificates.values():
104
- new_ca_contents.append(required_ca)
105
-
106
- with NamedTemporaryFile(delete=False, mode="w") as ca_bundle_file:
107
- ca_bundle_file.write("".join(new_ca_contents) + os.linesep)
97
+ server_certificates = self._source_parameters.server_certificates.values()
98
+ with open(ca_bundle_path, "a") as ca_bundle_file:
99
+ ca_bundle_file.write(os.linesep.join(server_certificates) + os.linesep)
108
100
  return ca_bundle_file.name
109
101
 
110
102
  @cached_property
@@ -23,8 +23,3 @@ def has_expiration_property(source_credentials: SourceCredentials) -> bool:
23
23
  """
24
24
 
25
25
  return hasattr(source_credentials, "expiration")
26
-
27
-
28
- def read_file(path: str) -> str:
29
- with open(path) as file:
30
- return file.read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: external-systems
3
- Version: 0.101.0rc2
3
+ Version: 0.103.0rc1
4
4
  Summary: A Python library for interacting with Foundry Sources
5
5
  License: Apache-2.0
6
6
  Keywords: Palantir,Foundry,Sources,Compute Modules,Python Functions,Transforms
@@ -1,15 +1,15 @@
1
1
  external_systems/__init__.py,sha256=xXDUDD6_qRO-nHuXZx-fXp0R0vc3N_OOsB1F5mF_kpU,651
2
- external_systems/_version.py,sha256=_lPL2Cf7l1QOKhNr6bOC2rmN4byt89IJMAHVjVv9xT0,753
2
+ external_systems/_version.py,sha256=c_mfS4PZeLJy0ogjiUVZANeBTYyWBz2voOqwBuulZ60,753
3
3
  external_systems/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  external_systems/sources/__init__.py,sha256=aqXbMIy_pnyIC1uPRzQfApLCbhYB4N8iRFnpOX4RdAk,1156
5
5
  external_systems/sources/_api.py,sha256=NV7oNIgzSWz4ROFW8uPpUJjDN5vfFzdTs3yKC37S39k,3262
6
6
  external_systems/sources/_connections.py,sha256=h82npEks29NALAAfMHrXcSnB7TY_OLeXgL3QN9Cssus,2509
7
- external_systems/sources/_proxies.py,sha256=hLN2JHRXqN5VA0i-p5B1yNDSrwYF7cm5kuTVHSQVAeA,5681
7
+ external_systems/sources/_proxies.py,sha256=8Rq197KkGXVkwlK8lJNxrs3b1xul09XGh9E4r9nedgA,5722
8
8
  external_systems/sources/_refreshable.py,sha256=0pa5XW0_2gTMW-ZymKhlhh3Kka_bWTWffThKvrTTifc,4421
9
9
  external_systems/sources/_sockets.py,sha256=XH51adVnloqg8XYVHPxl6K8R_q2BCh6WZ77cq1L8nRg,4473
10
- external_systems/sources/_sources.py,sha256=Nqu61CGKyUlErtImCz6tmq8y9RYeEJJ6AGHXA4o5HwA,10821
11
- external_systems/sources/_utils.py,sha256=EmUKKiKRDOZ2cZs7FZ4qCSan_lq1K_tquh3kxleB-jA,1004
12
- external_systems-0.101.0rc2.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
13
- external_systems-0.101.0rc2.dist-info/METADATA,sha256=-KBntM-juQ4KexO_KKBXTP_6QDvZy2urRHkQtW8yFBw,4768
14
- external_systems-0.101.0rc2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
- external_systems-0.101.0rc2.dist-info/RECORD,,
10
+ external_systems/sources/_sources.py,sha256=Zt0I_U5tMJrfTOvT5jEMG5jE10JevrI2V0ZX7FDWDfA,10604
11
+ external_systems/sources/_utils.py,sha256=_GDyJOzPHQudEbrPsRhXMs8u6AaHpgJQIq8H9xSYJZk,913
12
+ external_systems-0.103.0rc1.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
13
+ external_systems-0.103.0rc1.dist-info/METADATA,sha256=37nCIIvCCsNeXy_Kk1u7ZCTvqssmU6fo0sXzhTNNCBc,4768
14
+ external_systems-0.103.0rc1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
+ external_systems-0.103.0rc1.dist-info/RECORD,,