ph-runtime-guest 0.3.0__tar.gz → 0.4.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 (24) hide show
  1. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/PKG-INFO +1 -1
  2. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/pyproject.toml +1 -1
  3. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/limits.py +1 -2
  4. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/runner.py +1 -2
  5. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/snapshot.py +2 -1
  6. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/.gitignore +0 -0
  7. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/LICENSE +0 -0
  8. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/README.md +0 -0
  9. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/__init__.py +0 -0
  10. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/__main__.py +0 -0
  11. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/_json.py +0 -0
  12. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/cell.py +0 -0
  13. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/channel.py +0 -0
  14. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/errors.py +0 -0
  15. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/lifecycle.py +0 -0
  16. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/protocol.py +0 -0
  17. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/proxies.py +0 -0
  18. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/py.typed +0 -0
  19. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/src/ph_runtime/skill.py +0 -0
  20. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/tests/test_cell_bindings.py +0 -0
  21. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/tests/test_channel_limit.py +0 -0
  22. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/tests/test_cpu_budget.py +0 -0
  23. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/tests/test_run_settlement.py +0 -0
  24. {ph_runtime_guest-0.3.0 → ph_runtime_guest-0.4.0}/tests/test_snapshot_paths.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ph-runtime-guest
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: The guest half of pH's code runtime: the fd-3 protocol, the run loop, and the binding proxies a cell awaits.
5
5
  Project-URL: Homepage, https://github.com/chastabor/pH
6
6
  Project-URL: Repository, https://github.com/chastabor/pH
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ph-runtime-guest"
7
- version = "0.3.0"
7
+ version = "0.4.0"
8
8
  description = "The guest half of pH's code runtime: the fd-3 protocol, the run loop, and the binding proxies a cell awaits."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -29,6 +29,7 @@ from __future__ import annotations
29
29
  import contextlib
30
30
  import math
31
31
  import signal
32
+ import time
32
33
  from typing import Any
33
34
 
34
35
  __all__ = [
@@ -63,8 +64,6 @@ except ImportError: # pragma: no cover — Windows has no `resource` module
63
64
  def cpu_seconds_used() -> float:
64
65
  """CPU seconds this process has consumed, user + system."""
65
66
  if resource is None: # pragma: no cover
66
- import time
67
-
68
67
  return time.process_time()
69
68
  usage = resource.getrusage(resource.RUSAGE_SELF)
70
69
  return float(usage.ru_utime + usage.ru_stime)
@@ -35,6 +35,7 @@ from __future__ import annotations
35
35
 
36
36
  import asyncio
37
37
  import contextlib
38
+ import importlib
38
39
  import io
39
40
  import json
40
41
  import os
@@ -321,8 +322,6 @@ class Runner:
321
322
  the harness's surface: a skill is capability the deployment installed,
322
323
  not cell state, and snapshotting it would try to pickle a module.
323
324
  """
324
- import importlib
325
-
326
325
  for name in names:
327
326
  try:
328
327
  module = importlib.import_module(name)
@@ -80,7 +80,8 @@ class _BoundedSink:
80
80
 
81
81
  def _dill() -> Any | None: # noqa: ANN401
82
82
  try:
83
- import dill # type: ignore[import-untyped]
83
+ # Optional in the runtime venv: without it each value is reported unpicklable.
84
+ import dill # type: ignore[import-untyped] # noqa: PLC0415
84
85
  except ImportError: # pragma: no cover — a venv without dill
85
86
  return None
86
87
  return dill