runtime-sdk 0.4.37__tar.gz → 0.4.38__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.4
2
2
  Name: runtime-sdk
3
- Version: 0.4.37
3
+ Version: 0.4.38
4
4
  Summary: Runtime Python SDK and CLI
5
5
  Project-URL: Repository, https://github.com/The-Money-Company-Limited/runtimevm
6
6
  Project-URL: Issues, https://github.com/The-Money-Company-Limited/runtimevm/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runtime-sdk"
3
- version = "0.4.37"
3
+ version = "0.4.38"
4
4
  description = "Runtime Python SDK and CLI"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -544,8 +544,12 @@ def main(argv: list[str] | None = None) -> int:
544
544
  return report_error("runtime-sdk supports macOS and Linux only; Windows is not supported")
545
545
 
546
546
  try:
547
- if args.command == "enter" and args.enter_command and "--" not in raw_argv:
548
- return report_error("enter command must be separated from the computer id with --")
547
+ enter_id: str | None = None
548
+ enter_command: list[str] | None = None
549
+ if args.command == "enter":
550
+ enter_id, enter_command, enter_err = _parse_enter_invocation(raw_argv, args.id, args.enter_command)
551
+ if enter_err:
552
+ return report_error(enter_err)
549
553
 
550
554
  config = load_config()
551
555
  if args.base_url:
@@ -632,7 +636,7 @@ def main(argv: list[str] | None = None) -> int:
632
636
  if args.command == "start":
633
637
  return handle_start(config, args.id)
634
638
  if args.command == "enter":
635
- return handle_enter(config, args.id, args.enter_command)
639
+ return handle_enter(config, enter_id, enter_command)
636
640
  if args.command in ("delete", "rm"):
637
641
  return handle_delete(config, args.id, force=getattr(args, "force", False))
638
642
  if args.command == "run":
@@ -709,6 +713,22 @@ def main(argv: list[str] | None = None) -> int:
709
713
  # --------------------------------------------------------------------------- #
710
714
 
711
715
 
716
+ def _parse_enter_invocation(raw_argv: list[str], parsed_id: str | None, parsed_command: list[str]) -> tuple[str | None, list[str], str | None]:
717
+ enter_index = raw_argv.index("enter")
718
+ enter_args = raw_argv[enter_index + 1:]
719
+ if "--" not in enter_args:
720
+ if parsed_command:
721
+ return None, [], "enter command must be separated from the computer id with --"
722
+ return parsed_id, parsed_command, None
723
+
724
+ separator_index = enter_args.index("--")
725
+ before_separator = enter_args[:separator_index]
726
+ if len(before_separator) > 1:
727
+ return None, [], "enter accepts at most one computer id before --"
728
+ computer_id = before_separator[0] if before_separator else None
729
+ return computer_id, enter_args[separator_index + 1:], None
730
+
731
+
712
732
  def write_json(payload: dict[str, Any], *, error: bool = False) -> int:
713
733
  stream = sys.stderr if error else sys.stdout
714
734
  stream.write(json.dumps(payload) + "\n")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtime-sdk
3
- Version: 0.4.37
3
+ Version: 0.4.38
4
4
  Summary: Runtime Python SDK and CLI
5
5
  Project-URL: Repository, https://github.com/The-Money-Company-Limited/runtimevm
6
6
  Project-URL: Issues, https://github.com/The-Money-Company-Limited/runtimevm/issues
File without changes
File without changes