Skip to content

Commit 627f34d

Browse files
committed
Revert "s/temporalio.bridge.temporal_sdk_bridge/rg-replace temporal_sdk_bridge/"
This reverts commit c62cf00.
1 parent 1d4e1ec commit 627f34d

File tree

7 files changed

+44
-27
lines changed

7 files changed

+44
-27
lines changed

temporalio/bridge/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name = "temporal-sdk-bridge"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[package.metadata.maturin]
7+
module-name = "temporalio.bridge.temporal_sdk_bridge"
8+
9+
610
[lib]
711
name = "temporal_sdk_bridge"
812
crate-type = ["cdylib"]

temporalio/bridge/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
from typing import Mapping, Optional, Tuple, Type, TypeVar
1111

1212
import google.protobuf.message
13-
import temporal_sdk_bridge
14-
from temporal_sdk_bridge import RPCError
1513

1614
import temporalio.bridge.runtime
15+
import temporalio.bridge.temporal_sdk_bridge
16+
from temporalio.bridge.temporal_sdk_bridge import RPCError
1717

1818

1919
@dataclass
@@ -94,13 +94,15 @@ async def connect(
9494
"""Establish connection with server."""
9595
return Client(
9696
runtime,
97-
await temporal_sdk_bridge.connect_client(runtime._ref, config),
97+
await temporalio.bridge.temporal_sdk_bridge.connect_client(
98+
runtime._ref, config
99+
),
98100
)
99101

100102
def __init__(
101103
self,
102104
runtime: temporalio.bridge.runtime.Runtime,
103-
ref: temporal_sdk_bridge.ClientRef,
105+
ref: temporalio.bridge.temporal_sdk_bridge.ClientRef,
104106
):
105107
"""Initialize client with underlying SDK Core reference."""
106108
self._runtime = runtime

temporalio/bridge/metric.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
from typing import Mapping, Optional, Union
99

10-
import temporal_sdk_bridge
11-
1210
import temporalio.bridge.runtime
11+
import temporalio.bridge.temporal_sdk_bridge
1312

1413

1514
class MetricMeter:
@@ -18,12 +17,14 @@ class MetricMeter:
1817
@staticmethod
1918
def create(runtime: temporalio.bridge.runtime.Runtime) -> Optional[MetricMeter]:
2019
"""Create optional metric meter."""
21-
ref = temporal_sdk_bridge.new_metric_meter(runtime._ref)
20+
ref = temporalio.bridge.temporal_sdk_bridge.new_metric_meter(runtime._ref)
2221
if not ref:
2322
return None
2423
return MetricMeter(ref)
2524

26-
def __init__(self, ref: temporal_sdk_bridge.MetricMeterRef) -> None:
25+
def __init__(
26+
self, ref: temporalio.bridge.temporal_sdk_bridge.MetricMeterRef
27+
) -> None:
2728
"""Initialize metric meter."""
2829
self._ref = ref
2930
self._default_attributes = MetricAttributes(self, ref.default_attributes)
@@ -160,7 +161,7 @@ class MetricAttributes:
160161
def __init__(
161162
self,
162163
meter: MetricMeter,
163-
ref: temporal_sdk_bridge.MetricAttributesRef,
164+
ref: temporalio.bridge.temporal_sdk_bridge.MetricAttributesRef,
164165
) -> None:
165166
"""Initialize attributes."""
166167
self._meter = meter

temporalio/bridge/runtime.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@
88
from dataclasses import dataclass
99
from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Type
1010

11-
import temporal_sdk_bridge
1211
from typing_extensions import Protocol
1312

13+
import temporalio.bridge.temporal_sdk_bridge
14+
1415

1516
class Runtime:
1617
"""Runtime for SDK Core."""
1718

1819
@staticmethod
1920
def _raise_in_thread(thread_id: int, exc_type: Type[BaseException]) -> bool:
2021
"""Internal helper for raising an exception in thread."""
21-
return temporal_sdk_bridge.raise_in_thread(thread_id, exc_type)
22+
return temporalio.bridge.temporal_sdk_bridge.raise_in_thread(
23+
thread_id, exc_type
24+
)
2225

2326
def __init__(self, *, telemetry: TelemetryConfig) -> None:
2427
"""Create SDK Core runtime."""
25-
self._ref = temporal_sdk_bridge.init_runtime(telemetry)
28+
self._ref = temporalio.bridge.temporal_sdk_bridge.init_runtime(telemetry)
2629

2730
def retrieve_buffered_metrics(self, durations_as_seconds: bool) -> Sequence[Any]:
2831
"""Get buffered metrics."""

temporalio/bridge/testing.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
from dataclasses import dataclass
99
from typing import Optional, Sequence
1010

11-
import temporal_sdk_bridge
12-
1311
import temporalio.bridge.runtime
12+
import temporalio.bridge.temporal_sdk_bridge
1413

1514

1615
@dataclass
@@ -54,7 +53,9 @@ async def start_dev_server(
5453
) -> EphemeralServer:
5554
"""Start a dev server instance."""
5655
return EphemeralServer(
57-
await temporal_sdk_bridge.start_dev_server(runtime._ref, config)
56+
await temporalio.bridge.temporal_sdk_bridge.start_dev_server(
57+
runtime._ref, config
58+
)
5859
)
5960

6061
@staticmethod
@@ -63,10 +64,12 @@ async def start_test_server(
6364
) -> EphemeralServer:
6465
"""Start a test server instance."""
6566
return EphemeralServer(
66-
await temporal_sdk_bridge.start_test_server(runtime._ref, config)
67+
await temporalio.bridge.temporal_sdk_bridge.start_test_server(
68+
runtime._ref, config
69+
)
6770
)
6871

69-
def __init__(self, ref: temporal_sdk_bridge.EphemeralServerRef):
72+
def __init__(self, ref: temporalio.bridge.temporal_sdk_bridge.EphemeralServerRef):
7073
"""Initialize an ephemeral server."""
7174
self._ref = ref
7275

temporalio/bridge/worker.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
)
2020

2121
import google.protobuf.internal.containers
22-
import temporal_sdk_bridge
23-
from temporal_sdk_bridge import (
24-
CustomSlotSupplier as BridgeCustomSlotSupplier,
25-
)
26-
from temporal_sdk_bridge import PollShutdownError
2722
from typing_extensions import TypeAlias
2823

2924
import temporalio.api.common.v1
@@ -34,8 +29,13 @@
3429
import temporalio.bridge.proto.workflow_activation
3530
import temporalio.bridge.proto.workflow_completion
3631
import temporalio.bridge.runtime
32+
import temporalio.bridge.temporal_sdk_bridge
3733
import temporalio.converter
3834
import temporalio.exceptions
35+
from temporalio.bridge.temporal_sdk_bridge import (
36+
CustomSlotSupplier as BridgeCustomSlotSupplier,
37+
)
38+
from temporalio.bridge.temporal_sdk_bridge import PollShutdownError
3939

4040

4141
@dataclass
@@ -111,22 +111,26 @@ class Worker:
111111
def create(client: temporalio.bridge.client.Client, config: WorkerConfig) -> Worker:
112112
"""Create a bridge worker from a bridge client."""
113113
return Worker(
114-
temporal_sdk_bridge.new_worker(client._runtime._ref, client._ref, config)
114+
temporalio.bridge.temporal_sdk_bridge.new_worker(
115+
client._runtime._ref, client._ref, config
116+
)
115117
)
116118

117119
@staticmethod
118120
def for_replay(
119121
runtime: temporalio.bridge.runtime.Runtime,
120122
config: WorkerConfig,
121-
) -> Tuple[Worker, temporal_sdk_bridge.HistoryPusher]:
123+
) -> Tuple[Worker, temporalio.bridge.temporal_sdk_bridge.HistoryPusher]:
122124
"""Create a bridge replay worker."""
123125
[
124126
replay_worker,
125127
pusher,
126-
] = temporal_sdk_bridge.new_replay_worker(runtime._ref, config)
128+
] = temporalio.bridge.temporal_sdk_bridge.new_replay_worker(
129+
runtime._ref, config
130+
)
127131
return Worker(replay_worker), pusher
128132

129-
def __init__(self, ref: temporal_sdk_bridge.WorkerRef) -> None:
133+
def __init__(self, ref: temporalio.bridge.temporal_sdk_bridge.WorkerRef) -> None:
130134
"""Create SDK core worker from a bridge worker."""
131135
self._ref = ref
132136

temporalio/worker/workflow_sandbox/_restrictions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def with_child_unrestricted(self, *child_path: str) -> SandboxMatcher:
459459
# Must pass through the entire bridge in even the most minimum causes
460460
# because PyO3 does not allow re-init since 0.17. See
461461
# https://github.com/PyO3/pyo3/pull/2523.
462-
"temporal_sdk_bridge",
462+
"temporalio.bridge.temporal_sdk_bridge",
463463
}
464464

465465
SandboxRestrictions.passthrough_modules_with_temporal = (

0 commit comments

Comments
 (0)