8000 Fix circular imports for sphinx (#3986) · getsentry/sentry-python@2894963 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2894963

Browse files
authored
Fix circular imports for sphinx (#3986)
1 parent 9df9cbf commit 2894963

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import sphinx.ext.autodoc # noqa: F401
1414
import sphinx.ext.intersphinx # noqa: F401
1515
import urllib3.exceptions # noqa: F401
16+
import importlib_metadata # noqa: F401
17+
import opentelemetry.sdk.metrics._internal # noqa: F401
1618

1719
typing.TYPE_CHECKING = True
1820

sentry_sdk/integrations/opentelemetry/contextvars_context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
if TYPE_CHECKING:
1616
from typing import Optional
17-
from sentry_sdk.integrations.opentelemetry.scope import PotelScope
17+
import sentry_sdk.integrations.opentelemetry.scope as scope
1818

1919

2020
class SentryContextVarsRuntimeContext(ContextVarsRuntimeContext):
@@ -29,16 +29,16 @@ def attach(self, context):
2929

3030
should_use_isolation_scope = context.pop(SENTRY_USE_ISOLATION_SCOPE_KEY, None)
3131
should_use_isolation_scope = cast(
32-
"Optional[PotelScope]", should_use_isolation_scope
32+
"Optional[scope.PotelScope]", should_use_isolation_scope
3333
)
3434

3535
should_use_current_scope = context.pop(SENTRY_USE_CURRENT_SCOPE_KEY, None)
3636
should_use_current_scope = cast(
37-
"Optional[PotelScope]", should_use_current_scope
37+
"Optional[scope.PotelScope]", should_use_current_scope
3838
)
3939

4040
if scopes:
41-
scopes = cast("tuple[PotelScope, PotelScope]", scopes)
41+
scopes = cast("tuple[scope.PotelScope, scope.PotelScope]", scopes)
4242
(current_scope, isolation_scope) = scopes
4343
else:
4444
current_scope = sentry_sdk.get_current_scope()

sentry_sdk/integrations/opentelemetry/propagator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
if TYPE_CHECKING:
3838
from typing import Optional, Set
39-
from sentry_sdk.integrations.opentelemetry.scope import PotelScope
39+
import sentry_sdk.integrations.opentelemetry.scope as scope
4040

4141

4242
class SentryPropagator(TextMapPropagator):
@@ -94,7 +94,7 @@ def inject(self, carrier, context=None, setter=default_setter):
9494

9595
scopes = get_value(SENTRY_SCOPES_KEY, context)
9696
if scopes:
97-
scopes = cast("tuple[PotelScope, PotelScope]", scopes)
97+
scopes = cast("tuple[scope.PotelScope, scope.PotelScope]", scopes)
9898
(current_scope, _) = scopes
9999

100100
# TODO-neel-potel check trace_propagation_targets

0 commit comments

Comments
 (0)
0