isb-sdk 3.2.0__tar.gz → 3.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: isb-sdk
3
- Version: 3.2.0
3
+ Version: 3.3.0
4
4
  Summary: Python SDK for isb: declarative incus sandboxes (containers and VMs)
5
5
  Project-URL: Homepage, https://github.com/execution-associates/isb
6
6
  Project-URL: Repository, https://github.com/execution-associates/isb
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "isb-sdk"
7
- version = "3.2.0"
7
+ version = "3.3.0"
8
8
  description = "Python SDK for isb: declarative incus sandboxes (containers and VMs)"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -62,7 +62,7 @@ from ._types import (
62
62
  from ._util import Duration
63
63
  from .volumes import Volumes
64
64
 
65
- __version__ = "3.2.0"
65
+ __version__ = "3.3.0"
66
66
 
67
67
  __all__ = [
68
68
  "PROTOCOL",
@@ -25,6 +25,19 @@ SecretAs = Literal["env", "file"]
25
25
  UpdateOrder = Literal["stop-first", "start-first"]
26
26
 
27
27
 
28
+ class BootSpec(TypedDict, total=False):
29
+ """How incus starts an instance with the host. Every field left out takes
30
+ its default ([`crate::plan::boot_config`]).
31
+ """
32
+ #: Start with the host (`boot.autostart`).
33
+ autostart: Optional[BoolOrString]
34
+ #: How long incus waits after starting this instance before it starts
35
+ #: the next (`boot.autostart.delay`), e.g. `5s`; whole seconds.
36
+ delay: Optional[IntOrString]
37
+ #: Start order (`boot.autostart.priority`): higher starts first.
38
+ priority: Optional[int]
39
+
40
+
28
41
  class Dependency(TypedDict, total=False):
29
42
  condition: DependCondition
30
43
 
@@ -268,6 +281,11 @@ class RestartPolicy(TypedDict, total=False):
268
281
 
269
282
  class SandboxSpec(TypedDict, total=False):
270
283
  """Everything about one sandbox: a compose service."""
284
+ #: Whether and in what order incus starts the instance with the host
285
+ #: (`boot.autostart`, `.priority`, `.delay`). Default: from `restart`,
286
+ #: with a stack replica in the first start wave and every autostarting
287
+ #: instance spaced from the next (docs/reference/compose.md#boot).
288
+ boot: Optional[BootSpec]
271
289
  #: The sandbox's main command, run by a foreground `isb up` once the
272
290
  #: sandbox is ready, as `user` in `working_dir`. Its output is streamed,
273
291
  #: and `up` stops the sandbox when every command has exited. A list is
@@ -511,6 +529,11 @@ class ComposeFile(TypedDict, total=False):
511
529
 
512
530
  class SandboxSpecFields(TypedDict, total=False):
513
531
  """SandboxSpec without `container_name` and `image`: the keyword arguments of Sandbox.create."""
532
+ #: Whether and in what order incus starts the instance with the host
533
+ #: (`boot.autostart`, `.priority`, `.delay`). Default: from `restart`,
534
+ #: with a stack replica in the first start wave and every autostarting
535
+ #: instance spaced from the next (docs/reference/compose.md#boot).
536
+ boot: Optional[BootSpec]
514
537
  #: The sandbox's main command, run by a foreground `isb up` once the
515
538
  #: sandbox is ready, as `user` in `working_dir`. Its output is streamed,
516
539
  #: and `up` stops the sandbox when every command has exited. A list is
@@ -622,6 +645,7 @@ VolumeSpec = Union[str, VolumeMount]
622
645
 
623
646
  __all__ = [
624
647
  "BoolOrString",
648
+ "BootSpec",
625
649
  "Command",
626
650
  "ComposeFile",
627
651
  "DependCondition",
@@ -222,7 +222,7 @@ class FakeServerTests(unittest.IsolatedAsyncioTestCase):
222
222
  path = fake_server(
223
223
  self.tmp.name,
224
224
  """\
225
- echo '{"isb":"3.2.0","protocol":1}'
225
+ echo '{"isb":"3.3.0","protocol":1}'
226
226
  read line
227
227
  echo "boom" >&2
228
228
  exit 3
@@ -243,7 +243,7 @@ class FakeServerTests(unittest.IsolatedAsyncioTestCase):
243
243
  path = fake_server(
244
244
  self.tmp.name,
245
245
  """\
246
- echo '{"isb":"3.2.0","protocol":1}'
246
+ echo '{"isb":"3.3.0","protocol":1}'
247
247
  cat >/dev/null
248
248
  """,
249
249
  )
@@ -261,7 +261,7 @@ class FakeServerTests(unittest.IsolatedAsyncioTestCase):
261
261
  path = fake_server(
262
262
  self.tmp.name,
263
263
  """\
264
- echo '{"isb":"3.2.0","protocol":1}'
264
+ echo '{"isb":"3.3.0","protocol":1}'
265
265
  read a
266
266
  read b
267
267
  echo 'not json'
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