File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,13 @@ jobs:
105
105
BETA_VERSION="${BASE_VERSION}b1"
106
106
else
107
107
# If stable, bump minor and add beta (4.1.1 -> 4.2.0)
108
- BASE_VERSION=$(python -c "import re; version = '$CURRENT_VERSION'; parts = version.split('.'); parts[1] = str(int(parts[1]) + 1); parts[2] = '0'; print('.'.join(parts))")
108
+ BASE_VERSION=$(python3 -c "
109
+ version = '$CURRENT_VERSION'
110
+ parts = version.split('.')
111
+ parts[1] = str(int(parts[1]) + 1)
112
+ parts[2] = '0'
113
+ print('.'.join(parts))
114
+ ")
109
115
BETA_VERSION="${BASE_VERSION}b1"
110
116
fi
111
117
Original file line number Diff line number Diff line change @@ -101,7 +101,13 @@ jobs:
101
101
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
102
102
else
103
103
# Bump minor version for alpha (4.1.1 -> 4.2.0)
104
- BASE_VERSION=$(python -c "import re; version = '$CURRENT_VERSION'; parts = version.split('.'); parts[1] = str(int(parts[1]) + 1); parts[2] = '0'; print('.'.join(parts))")
104
+ BASE_VERSION=$(python3 -c "
105
+ version = '$CURRENT_VERSION'
106
+ parts = version.split('.')
107
+ parts[1] = str(int(parts[1]) + 1)
108
+ parts[2] = '0'
109
+ print('.'.join(parts))
110
+ ")
105
111
fi
106
112
107
113
ALPHA_VERSION="${BASE_VERSION}a${DATE_STAMP}.${TIME_STAMP}.${COMMIT_SHORT}"
Original file line number Diff line number Diff line change 10
10
11
11
if TYPE_CHECKING :
12
12
from datafog .processing .text_processing .regex_annotator .regex_annotator import Span
13
+ else :
14
+ # Runtime import for Span when needed
15
+ Span = None
16
+
17
+
18
+ def _get_span_class ():
19
+ """Lazily import Span class when needed."""
20
+ global Span
21
+ if Span is None :
22
+ from datafog .processing .text_processing .regex_annotator .regex_annotator import (
23
+ Span ,
24
+ )
25
+ return Span
13
26
14
27
15
28
class TextService :
@@ -172,7 +185,8 @@ def annotate_text_sync(
172
185
chunk_spans = self .annotate_text_sync (chunk , structured = True )
173
186
# Adjust span positions to account for chunk offset
174
187
for span in chunk_spans :
175
- adjusted_span = Span (
188
+ SpanClass = _get_span_class ()
189
+ adjusted_span = SpanClass (
176
190
start = span .start + current_offset ,
177
191
end = span .end + current_offset ,
178
192
text = span .text ,
You can’t perform that action at this time.
0 commit comments