Skip to content

Commit a780784

Browse files
authored
fix(apidocs): Fix circular imports, run in PRs and master (#1197)
1 parent 9de8d47 commit a780784

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ jobs:
3737
name: build documentation
3838
runs-on: ubuntu-latest
3939

40-
if: "startsWith(github.ref, 'refs/heads/release/')"
41-
4240
steps:
4341
- uses: actions/checkout@v2
4442
- uses: actions/setup-node@v1

sentry_sdk/tracing.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
import sentry_sdk
88

99
from sentry_sdk.utils import logger
10-
from sentry_sdk.tracing_utils import (
11-
EnvironHeaders,
12-
compute_tracestate_entry,
13-
extract_sentrytrace_data,
14-
extract_tracestate_data,
15-
has_tracestate_enabled,
16-
has_tracing_enabled,
17-
is_valid_sample_rate,
18-
maybe_create_breadcrumbs_from_span,
19-
)
2010
from sentry_sdk._types import MYPY
2111

2212

@@ -718,3 +708,17 @@ def _set_initial_sampling_decision(self, sampling_context):
718708
sample_rate=float(sample_rate),
719709
)
720710
)
711+
712+
713+
# Circular imports
714+
715+
from sentry_sdk.tracing_utils import (
716+
EnvironHeaders,
717+
compute_tracestate_entry,
718+
extract_sentrytrace_data,
719+
extract_tracestate_data,
720+
has_tracestate_enabled,
721+
has_tracing_enabled,
722+
is_valid_sample_rate,
723+
maybe_create_breadcrumbs_from_span,
724+
)

sentry_sdk/tracing_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
from typing import Dict
3333
from typing import Union
3434

35-
from sentry_sdk.tracing import Span
36-
3735

3836
SENTRY_TRACE_REGEX = re.compile(
3937
"^[ \t]*" # whitespace
@@ -405,3 +403,9 @@ def has_tracestate_enabled(span=None):
405403
options = client and client.options
406404

407405
return bool(options and options["_experiments"].get("propagate_tracestate"))
406+
407+
408+
# Circular imports
409+
410+
if MYPY:
411+
from sentry_sdk.tracing import Span

0 commit comments

Comments
 (0)