salesforce-data-customcode 6.0.6.dev1__py3-none-any.whl → 6.0.7.dev1__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.
@@ -97,10 +97,19 @@ class SFCLITokenProvider(TokenProvider):
97
97
  def get_token(self) -> "AccessTokenResponse":
98
98
  """Get token from Salesforce SF CLI"""
99
99
  import json
100
+ import shutil
100
101
  import subprocess
101
102
 
102
103
  from datacustomcode.deploy import AccessTokenResponse
103
104
 
105
+ sf_path = shutil.which("sf") or shutil.which("sf.cmd")
106
+ if sf_path is None:
107
+ raise RuntimeError(
108
+ "The 'sf' command was not found. "
109
+ "Install Salesforce CLI: "
110
+ "https://developer.salesforce.com/tools/salesforcecli"
111
+ )
112
+
104
113
  def _run_sf_command(args: list[str], description: str) -> dict:
105
114
  try:
106
115
  result = subprocess.run(
@@ -108,14 +117,8 @@ class SFCLITokenProvider(TokenProvider):
108
117
  capture_output=True,
109
118
  text=True,
110
119
  check=True,
111
- timeout=30,
120
+ timeout=120,
112
121
  )
113
- except FileNotFoundError as exc:
114
- raise RuntimeError(
115
- "The 'sf' command was not found. "
116
- "Install Salesforce CLI: "
117
- "https://developer.salesforce.com/tools/salesforcecli"
118
- ) from exc
119
122
  except subprocess.TimeoutExpired as exc:
120
123
  raise RuntimeError(
121
124
  f"'{description}' timed out for org '{self.sf_cli_org}'"
@@ -142,7 +145,7 @@ class SFCLITokenProvider(TokenProvider):
142
145
 
143
146
  # Get org info from sf org display
144
147
  display_data = _run_sf_command(
145
- ["sf", "org", "display", "--target-org", self.sf_cli_org, "--json"],
148
+ [sf_path, "org", "display", "--target-org", self.sf_cli_org, "--json"],
146
149
  "sf org display",
147
150
  )
148
151
  result_data = display_data.get("result", {})
@@ -159,7 +162,7 @@ class SFCLITokenProvider(TokenProvider):
159
162
  try:
160
163
  token_data = _run_sf_command(
161
164
  [
162
- "sf",
165
+ sf_path,
163
166
  "org",
164
167
  "auth",
165
168
  "show-access-token",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: salesforce-data-customcode
3
- Version: 6.0.6.dev1
3
+ Version: 6.0.7.dev1
4
4
  Summary: Data Cloud Custom Code SDK
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE.txt
@@ -93,10 +93,10 @@ datacustomcode/templates/script/payload/config.json,sha256=0d2mEMt4NHIeOUTsgiPMu
93
93
  datacustomcode/templates/script/payload/entrypoint.py,sha256=4Uph0ILa5ukk_6C90paK3uzQn0zZvNLr9ho3o_ZwErQ,2474
94
94
  datacustomcode/templates/script/requirements-dev.txt,sha256=OWwuy1awesqOZOS3Zizmdd6BDnSePpGFN5bq5IrALvc,176
95
95
  datacustomcode/templates/script/requirements.txt,sha256=qJbqzs5z0Hrx590U3T7dHq_m8UQEx2TdhgrJSz-QHIQ,40
96
- datacustomcode/token_provider.py,sha256=kGPxdxGZEr6VFknW7jFb9P6wOvRaRo-sfdBN2cUjEZY,6792
96
+ datacustomcode/token_provider.py,sha256=qA_e4vqSXnxn0MccFFPULWO8ZeUOEAu5QpBnoYCg-fc,6839
97
97
  datacustomcode/version.py,sha256=9LlbVrzwBvut1L308QbwNBgxdQk5CrghH39JARVSxms,989
98
- salesforce_data_customcode-6.0.6.dev1.dist-info/METADATA,sha256=k11RadLqAMw2inLBjUV6rLcjor-Itqf3wX7u1EJhuO8,25115
99
- salesforce_data_customcode-6.0.6.dev1.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
100
- salesforce_data_customcode-6.0.6.dev1.dist-info/entry_points.txt,sha256=WpQ94UB7UuRCYGOLtJV3vAgm1tl7iVf43VYRWIuNu5Y,74
101
- salesforce_data_customcode-6.0.6.dev1.dist-info/licenses/LICENSE.txt,sha256=iOi8EmQpfkFhMENi7VYtkl2EqS14pEOccoXHiW2dyPU,11443
102
- salesforce_data_customcode-6.0.6.dev1.dist-info/RECORD,,
98
+ salesforce_data_customcode-6.0.7.dev1.dist-info/METADATA,sha256=9Op-KDabeAL6ISPaoMWYn4clze4wGbB_fUYLlPcRNIQ,25115
99
+ salesforce_data_customcode-6.0.7.dev1.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
100
+ salesforce_data_customcode-6.0.7.dev1.dist-info/entry_points.txt,sha256=WpQ94UB7UuRCYGOLtJV3vAgm1tl7iVf43VYRWIuNu5Y,74
101
+ salesforce_data_customcode-6.0.7.dev1.dist-info/licenses/LICENSE.txt,sha256=iOi8EmQpfkFhMENi7VYtkl2EqS14pEOccoXHiW2dyPU,11443
102
+ salesforce_data_customcode-6.0.7.dev1.dist-info/RECORD,,