solari-runloop-compat 0.2.3__tar.gz → 0.2.4__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.
Files changed (55) hide show
  1. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/COMPAT.md +1 -0
  2. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/PKG-INFO +1 -1
  3. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/pyproject.toml +1 -1
  4. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/__init__.py +1 -1
  5. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_vendor_user.py +11 -0
  6. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/.gitignore +0 -0
  7. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/LICENSE +0 -0
  8. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/NOTICE +0 -0
  9. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/README.md +0 -0
  10. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_branding.py +0 -0
  11. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_client.py +0 -0
  12. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_config.py +0 -0
  13. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_context.py +0 -0
  14. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_dockerfile.py +0 -0
  15. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_exceptions.py +0 -0
  16. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_gateway.py +0 -0
  17. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_loop.py +0 -0
  18. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_mapping.py +0 -0
  19. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_models.py +0 -0
  20. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_redact.py +0 -0
  21. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_resources.py +0 -0
  22. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_sync.py +0 -0
  23. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/lib/__init__.py +0 -0
  24. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/lib/polling.py +0 -0
  25. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/pagination.py +0 -0
  26. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/sdk.py +0 -0
  27. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/__init__.py +0 -0
  28. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_build_log.py +0 -0
  29. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_build_logs_list_view.py +0 -0
  30. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_build_parameters.py +0 -0
  31. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_view.py +0 -0
  32. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_async_execution_detail_view.py +0 -0
  33. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_execution_detail_view.py +0 -0
  34. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_snapshot_list_view.py +0 -0
  35. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_snapshot_view.py +0 -0
  36. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_view.py +0 -0
  37. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devboxes/__init__.py +0 -0
  38. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devboxes/devbox_logs_list_view.py +0 -0
  39. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/secret_view.py +0 -0
  40. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/__init__.py +0 -0
  41. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/after_idle.py +0 -0
  42. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/code_mount_parameters.py +0 -0
  43. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/launch_parameters.py +0 -0
  44. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/lifecycle_configuration.py +0 -0
  45. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/lifecycle_hooks.py +0 -0
  46. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/resume_triggers.py +0 -0
  47. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/tunnel_view.py +0 -0
  48. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/run_runloop_examples.sh +0 -0
  49. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_config.py +0 -0
  50. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_context.py +0 -0
  51. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_dockerfile.py +0 -0
  52. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_gateway_wire.py +0 -0
  53. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_live_staging.py +0 -0
  54. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_mapping.py +0 -0
  55. {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_surface.py +0 -0
@@ -138,6 +138,7 @@ asks the gateway for exactly that at create time (`user: "user"`, `cwd: "/home/u
138
138
  sudo). Restores from a snapshot keep the snapshot's own user.
139
139
  - **Gateway that predates `user` / `cwd`** (it answers 400 naming them, or ignores them): the plain create is used and the sandbox runs as **root in
140
140
  `/home/root`**, which is what this package did before. Check `whoami` if code depends on it.
141
+ - **Template or snapshot made before user support** (the server answers 400 naming `user`): the plain create is used, the sandbox runs as **root**, and one warning says so. Rebuild templates and snapshots to get the vendor user.
141
142
  - Shared isolation is commands and code only and takes no `user` / `cwd`; the compat packages never create shared sandboxes. (Runloop's own docs: the default user is `user` with home `/home/user`.)
142
143
 
143
144
  ## Snapshots and output (0.2.2)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: solari-runloop-compat
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Runloop-compatible Python interface over Solari Sandboxes. Not affiliated with Runloop.
5
5
  Project-URL: Homepage, https://getsolari.com
6
6
  Author: Solari
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "solari-runloop-compat"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "Runloop-compatible Python interface over Solari Sandboxes. Not affiliated with Runloop."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -29,7 +29,7 @@ from ._exceptions import (
29
29
  from .lib.polling import PollingConfig, PollingTimeout
30
30
  from .sdk import AsyncRunloopSDK, RunloopSDK
31
31
 
32
- __version__ = "0.2.3"
32
+ __version__ = "0.2.4"
33
33
  Client = Runloop
34
34
  AsyncClient = AsyncRunloop
35
35
 
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import re
6
+ import warnings
6
7
  from typing import Any
7
8
 
8
9
  from solari_core.errors import GatewayError
@@ -17,6 +18,15 @@ def _refuses_user_fields(e: BaseException) -> bool:
17
18
  return isinstance(e, GatewayError) and e.status == 400 and re.search(r"\b(user|cwd)\b", repr(getattr(e, "body", None)), re.I) is not None
18
19
 
19
20
 
21
+ def _warn_root() -> None:
22
+ warnings.warn(
23
+ "solari-runloop-compat: the server or this template's image predates user support, so the sandbox runs as root instead of 'user'. "
24
+ "Rebuild templates and snapshots made before user support shipped to get the vendor user.",
25
+ RuntimeWarning,
26
+ stacklevel=4,
27
+ )
28
+
29
+
20
30
  async def create_as_vendor_user(solari: Any, **opts: Any) -> Any:
21
31
  """``solari.create(**opts)`` with ``user`` / ``cwd`` set to Runloop's defaults. A gateway that predates them (it answers 400
22
32
  naming them) gets the plain create, and the sandbox runs as root there (COMPAT.md). Restores from a snapshot keep the
@@ -31,4 +41,5 @@ async def create_as_vendor_user(solari: Any, **opts: Any) -> Any:
31
41
  raise
32
42
  if explicit: # the default user is best effort on a gateway that predates user/cwd; a user the caller named is not
33
43
  raise SolariCompatUnsupported("user_parameters", "this gateway cannot create sandboxes as another user yet") from e
44
+ _warn_root()
34
45
  return await solari.create(**opts)