runcloud-sdk 0.8.2__tar.gz → 0.8.3__tar.gz
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.
- {runcloud_sdk-0.8.2/runcloud_sdk.egg-info → runcloud_sdk-0.8.3}/PKG-INFO +1 -1
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/pyproject.toml +1 -1
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/client.py +4 -2
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3/runcloud_sdk.egg-info}/PKG-INFO +1 -1
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/tests/test_sdk.py +15 -3
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/LICENSE +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/README.md +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/__init__.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/__init__.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/blaxel.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/daytona.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/e2b.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/modal.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/sprites.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud/compat/vercel.py +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud_sdk.egg-info/SOURCES.txt +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud_sdk.egg-info/dependency_links.txt +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud_sdk.egg-info/requires.txt +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/runcloud_sdk.egg-info/top_level.txt +0 -0
- {runcloud_sdk-0.8.2 → runcloud_sdk-0.8.3}/setup.cfg +0 -0
|
@@ -20,7 +20,7 @@ from websockets.sync.client import connect as websocket_connect
|
|
|
20
20
|
Transport = Callable[[str, str, Any], Any]
|
|
21
21
|
StreamTransport = Callable[[str, dict[str, Any]], Any]
|
|
22
22
|
DEFAULT_API_URL = "https://api.run.cloud"
|
|
23
|
-
USER_AGENT = "runcloud-python/0.8.
|
|
23
|
+
USER_AGENT = "runcloud-python/0.8.3"
|
|
24
24
|
FILE_CHUNK_BYTES = 512 * 1024
|
|
25
25
|
|
|
26
26
|
|
|
@@ -253,7 +253,9 @@ class Client:
|
|
|
253
253
|
explicit_api_key = _nonempty_string(api_key)
|
|
254
254
|
environment_api_key = _nonempty_string(
|
|
255
255
|
os.environ.get("RUN_CLOUD_API_KEY")
|
|
256
|
-
) or _nonempty_string(
|
|
256
|
+
) or _nonempty_string(
|
|
257
|
+
os.environ.get("RUN_CLOUD_API_TOKEN")
|
|
258
|
+
) or _nonempty_string(os.environ.get("RUN_CLOUD_CI_ENVIRONMENT_TOKEN"))
|
|
257
259
|
saved_credentials = (
|
|
258
260
|
None
|
|
259
261
|
if explicit_api_key or environment_api_key
|
|
@@ -338,7 +338,7 @@ class SDKTests(unittest.TestCase):
|
|
|
338
338
|
Client(api_key="rc_live_test").request("GET", "/run-cloud/account")
|
|
339
339
|
|
|
340
340
|
request = urlopen.call_args.args[0]
|
|
341
|
-
self.assertEqual(request.get_header("User-agent"), "runcloud-python/0.8.
|
|
341
|
+
self.assertEqual(request.get_header("User-agent"), "runcloud-python/0.8.3")
|
|
342
342
|
|
|
343
343
|
def test_exec_stream_opens_authenticated_websocket_and_sends_command(self):
|
|
344
344
|
session = WebSocketSession()
|
|
@@ -368,7 +368,7 @@ class SDKTests(unittest.TestCase):
|
|
|
368
368
|
connect.assert_called_once_with(
|
|
369
369
|
"wss://api.example.test/run-cloud/sandboxes/sb_1/exec/stream?mode=command",
|
|
370
370
|
additional_headers={"Authorization": "Bearer rc_live_test"},
|
|
371
|
-
user_agent_header="runcloud-python/0.8.
|
|
371
|
+
user_agent_header="runcloud-python/0.8.3",
|
|
372
372
|
open_timeout=60.0,
|
|
373
373
|
close_timeout=5,
|
|
374
374
|
max_size=8 << 20,
|
|
@@ -398,7 +398,12 @@ class CredentialTests(unittest.TestCase):
|
|
|
398
398
|
clear=False,
|
|
399
399
|
)
|
|
400
400
|
self.environment.start()
|
|
401
|
-
for name in (
|
|
401
|
+
for name in (
|
|
402
|
+
"RUN_CLOUD_API_KEY",
|
|
403
|
+
"RUN_CLOUD_API_TOKEN",
|
|
404
|
+
"RUN_CLOUD_CI_ENVIRONMENT_TOKEN",
|
|
405
|
+
"RUN_CLOUD_API_URL",
|
|
406
|
+
):
|
|
402
407
|
os.environ.pop(name, None)
|
|
403
408
|
|
|
404
409
|
def tearDown(self):
|
|
@@ -458,6 +463,13 @@ class CredentialTests(unittest.TestCase):
|
|
|
458
463
|
self.assertEqual(client.api_key, "environment-key")
|
|
459
464
|
self.assertEqual(client.api_url, "https://api.run.cloud")
|
|
460
465
|
|
|
466
|
+
def test_ci_environment_capability_is_used_without_an_api_key(self):
|
|
467
|
+
os.environ["RUN_CLOUD_CI_ENVIRONMENT_TOKEN"] = "rce_environment"
|
|
468
|
+
|
|
469
|
+
client = Client()
|
|
470
|
+
|
|
471
|
+
self.assertEqual(client.api_key, "rce_environment")
|
|
472
|
+
|
|
461
473
|
def test_api_url_override_applies_to_saved_login(self):
|
|
462
474
|
self.save_credentials()
|
|
463
475
|
os.environ["RUN_CLOUD_API_URL"] = "https://override.example/"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|