opencomputer-sdk 1.0.0__tar.gz → 1.2.0__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 (41) hide show
  1. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/.gitignore +1 -0
  2. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/PKG-INFO +7 -3
  3. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/README.md +4 -0
  4. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/__init__.py +14 -1
  5. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/sandbox.py +18 -0
  6. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/version.py +1 -1
  7. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/pyproject.toml +2 -2
  8. opencomputer_sdk-1.2.0/tests/test_deprecation.py +37 -0
  9. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/run_all_tests.py +0 -0
  10. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/stream_demo.py +0 -0
  11. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_commands.py +0 -0
  12. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_concurrent.py +0 -0
  13. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_declarative_images.py +0 -0
  14. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_default_template.py +0 -0
  15. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_disk_size.py +0 -0
  16. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_domain_tls.py +0 -0
  17. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_environment.py +0 -0
  18. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_exec.py +0 -0
  19. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_file_ops.py +0 -0
  20. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_large_files.py +0 -0
  21. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_multi_template.py +0 -0
  22. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_python_sdk.py +0 -0
  23. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_reconnect.py +0 -0
  24. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_secret_store_fork.py +0 -0
  25. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_secretstore.py +0 -0
  26. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_shell.py +0 -0
  27. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/examples/test_timeout.py +0 -0
  28. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/agent.py +0 -0
  29. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/browser.py +0 -0
  30. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/commands.py +0 -0
  31. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/exec.py +0 -0
  32. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/filesystem.py +0 -0
  33. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/image.py +0 -0
  34. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/mounts.py +0 -0
  35. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/project.py +0 -0
  36. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/pty.py +0 -0
  37. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/shell.py +0 -0
  38. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/snapshot.py +0 -0
  39. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/sse.py +0 -0
  40. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/template.py +0 -0
  41. {opencomputer_sdk-1.0.0 → opencomputer_sdk-1.2.0}/opencomputer/usage.py +0 -0
@@ -97,3 +97,4 @@ cloudflare-workers/api-edge/wrangler.ci.toml
97
97
 
98
98
  .dev.vars*
99
99
  !.dev.vars.example
100
+ cloudflare-workers/api-edge/wrangler.*.generated.jsonc
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: opencomputer-sdk
3
- Version: 1.0.0
4
- Summary: Python SDK for OpenComputer - cloud sandbox platform
3
+ Version: 1.2.0
4
+ Summary: Deprecated: Python SDK for the retired OpenComputer sandbox platform. 1.2.0 is the final release.
5
5
  Project-URL: Homepage, https://github.com/diggerhq/opensandbox
6
6
  Project-URL: Repository, https://github.com/diggerhq/opensandbox
7
7
  Project-URL: Documentation, https://github.com/diggerhq/opensandbox/tree/main/sdks/python
@@ -9,7 +9,7 @@ Project-URL: Issues, https://github.com/diggerhq/opensandbox/issues
9
9
  Author: OpenComputer
10
10
  License-Expression: MIT
11
11
  Keywords: cloud,code-execution,containers,opencomputer,sandbox
12
- Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Development Status :: 7 - Inactive
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Classifier: Programming Language :: Python :: 3
@@ -28,6 +28,10 @@ Description-Content-Type: text/markdown
28
28
 
29
29
  # opencomputer
30
30
 
31
+ > **Deprecated.** `opencomputer-sdk` 1.2.0 is the final release; the package receives no further updates. It is a client for the OpenComputer sandbox platform, which is shut down. Importing `opencomputer` emits a `FutureWarning`.
32
+ >
33
+ > There is no Python replacement. For [Serverless Agents](https://opencomputer.dev/agents) call the [management API](https://opencomputer.dev/agents/api) over HTTP, or use the TypeScript client `@opencomputer/sdk/agents` (`npm install @opencomputer/sdk`). Pinning `opencomputer-sdk<1.2` avoids the warning.
34
+
31
35
  Python SDK for [OpenComputer](https://github.com/diggerhq/opensandbox) — cloud sandbox platform.
32
36
 
33
37
  ## Install
@@ -1,5 +1,9 @@
1
1
  # opencomputer
2
2
 
3
+ > **Deprecated.** `opencomputer-sdk` 1.2.0 is the final release; the package receives no further updates. It is a client for the OpenComputer sandbox platform, which is shut down. Importing `opencomputer` emits a `FutureWarning`.
4
+ >
5
+ > There is no Python replacement. For [Serverless Agents](https://opencomputer.dev/agents) call the [management API](https://opencomputer.dev/agents/api) over HTTP, or use the TypeScript client `@opencomputer/sdk/agents` (`npm install @opencomputer/sdk`). Pinning `opencomputer-sdk<1.2` avoids the warning.
6
+
3
7
  Python SDK for [OpenComputer](https://github.com/diggerhq/opensandbox) — cloud sandbox platform.
4
8
 
5
9
  ## Install
@@ -1,4 +1,17 @@
1
- """OpenComputer Python SDK - cloud sandbox platform."""
1
+ """OpenComputer Python SDK - cloud sandbox platform. Deprecated: 1.2.0 is the final release."""
2
+
3
+ import warnings as _warnings
4
+
5
+ #: Shown once per process, on the first ``import opencomputer``. A
6
+ #: FutureWarning, not a DeprecationWarning: Python's default filters show it
7
+ #: to end users wherever the import happens, not only in ``__main__``.
8
+ DEPRECATION_MESSAGE = (
9
+ "opencomputer-sdk is deprecated and receives no further releases: the "
10
+ "OpenComputer sandbox platform it targets is shut down. For Serverless "
11
+ "Agents use the management API (https://opencomputer.dev/agents/api) or "
12
+ "the TypeScript client @opencomputer/sdk/agents (npm install @opencomputer/sdk)."
13
+ )
14
+ _warnings.warn(DEPRECATION_MESSAGE, FutureWarning, stacklevel=2)
2
15
 
3
16
  from opencomputer.sandbox import Sandbox, ScalingLockedError, PlanLimitError, SandboxFamilyLimitError
4
17
  from opencomputer.browser import Browser, BrowserProfile
@@ -77,6 +77,18 @@ class Sandbox:
77
77
  #: a successful ``rotate_preview_auth_token()`` this value is replaced
78
78
  #: with the new token. Empty string when not enabled or when reconnecting.
79
79
  preview_auth_token: str = ""
80
+ #: RFC3339 instant at which the provider destroys this sandbox's host, or
81
+ #: ``None`` when the runtime imposes no lifetime.
82
+ #:
83
+ #: Two uses. It is the deadline to plan against — checkpoint and roll over
84
+ #: before it, because the disk goes with the host. And because only some
85
+ #: runtimes have one, its presence identifies which runtime served the
86
+ #: create, which is what the upgrade guide's smoke test checks.
87
+ #:
88
+ #: Read this rather than computing a deadline from the create time:
89
+ #: sandboxes are served from a warm pool, so the host is usually older
90
+ #: than the create.
91
+ end_at: str | None = None
80
92
  _api_url: str = ""
81
93
  _api_key: str = ""
82
94
  _connect_url: str = ""
@@ -219,6 +231,7 @@ class Sandbox:
219
231
  status=data.get("status", "running"),
220
232
  template=template,
221
233
  preview_auth_token=data.get("previewAuthToken", ""),
234
+ end_at=data.get("endAt"),
222
235
  _api_url=url,
223
236
  _api_key=key,
224
237
  _connect_url=connect_url,
@@ -278,6 +291,7 @@ class Sandbox:
278
291
  sandbox_id=sandbox_id,
279
292
  status=data.get("status", "running"),
280
293
  template=data.get("templateID", ""),
294
+ end_at=data.get("endAt"),
281
295
  _api_url=url,
282
296
  _api_key=key,
283
297
  _connect_url=connect_url,
@@ -748,6 +762,10 @@ class Sandbox:
748
762
  return cls(
749
763
  sandbox_id=data["sandboxID"],
750
764
  status=data.get("status", "running"),
765
+ # Absent on the runtime that serves this call today, but populated
766
+ # rather than dropped so a reader does not have to wonder why one
767
+ # constructor omits it.
768
+ end_at=data.get("endAt"),
751
769
  _api_url=url,
752
770
  _api_key=key,
753
771
  _connect_url=connect_url,
@@ -26,7 +26,7 @@ this docstring start with that name: two readers of this file are greps.
26
26
 
27
27
  from __future__ import annotations
28
28
 
29
- __version__ = "1.0.0"
29
+ __version__ = "1.2.0"
30
30
 
31
31
  #: Header carrying the version above. Lower-case to match the TypeScript SDK;
32
32
  #: HTTP/2 requires it there and consistency costs nothing here.
@@ -8,7 +8,7 @@ name = "opencomputer-sdk"
8
8
  # server in x-oc-sdk-version. One source, so the published version and the
9
9
  # routed-on version cannot disagree.
10
10
  dynamic = ["version"]
11
- description = "Python SDK for OpenComputer - cloud sandbox platform"
11
+ description = "Deprecated: Python SDK for the retired OpenComputer sandbox platform. 1.2.0 is the final release."
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.10"
14
14
  license = "MIT"
@@ -17,7 +17,7 @@ authors = [
17
17
  ]
18
18
  keywords = ["sandbox", "opencomputer", "cloud", "containers", "code-execution"]
19
19
  classifiers = [
20
- "Development Status :: 3 - Alpha",
20
+ "Development Status :: 7 - Inactive",
21
21
  "Intended Audience :: Developers",
22
22
  "License :: OSI Approved :: MIT License",
23
23
  "Programming Language :: Python :: 3",
@@ -0,0 +1,37 @@
1
+ import importlib
2
+ import sys
3
+ import warnings
4
+
5
+ import pytest
6
+
7
+
8
+ def _fresh_import():
9
+ for name in [m for m in sys.modules if m == "opencomputer" or m.startswith("opencomputer.")]:
10
+ del sys.modules[name]
11
+ return importlib.import_module("opencomputer")
12
+
13
+
14
+ def test_import_warns_deprecated_and_points_to_replacement():
15
+ with pytest.warns(FutureWarning, match="deprecated") as record:
16
+ mod = _fresh_import()
17
+ message = str(record[0].message)
18
+ assert "@opencomputer/sdk/agents" in message
19
+ assert "https://opencomputer.dev/agents/api" in message
20
+ assert mod.DEPRECATION_MESSAGE == message
21
+
22
+
23
+ def test_final_release_version_stays_on_major_1():
24
+ # The server routes on the SDK's major (x-oc-sdk-version); the deprecation
25
+ # release must not move callers.
26
+ with warnings.catch_warnings():
27
+ warnings.simplefilter("ignore", FutureWarning)
28
+ mod = _fresh_import()
29
+ assert mod.__version__ == "1.2.0"
30
+
31
+
32
+ def test_existing_exports_still_import():
33
+ with warnings.catch_warnings():
34
+ warnings.simplefilter("ignore", FutureWarning)
35
+ mod = _fresh_import()
36
+ for name in mod.__all__:
37
+ assert hasattr(mod, name), name