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:
105105 BETA_VERSION="${BASE_VERSION}b1"
106106 else
107107 # 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+ ")
109115 BETA_VERSION="${BASE_VERSION}b1"
110116 fi
111117
Original file line number Diff line number Diff line change @@ -101,7 +101,13 @@ jobs:
101101 BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
102102 else
103103 # 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+ ")
105111 fi
106112
107113 ALPHA_VERSION="${BASE_VERSION}a${DATE_STAMP}.${TIME_STAMP}.${COMMIT_SHORT}"
Original file line number Diff line number Diff line change 1010
1111if TYPE_CHECKING :
1212 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
1326
1427
1528class TextService :
@@ -172,7 +185,8 @@ def annotate_text_sync(
172185 chunk_spans = self .annotate_text_sync (chunk , structured = True )
173186 # Adjust span positions to account for chunk offset
174187 for span in chunk_spans :
175- adjusted_span = Span (
188+ SpanClass = _get_span_class ()
189+ adjusted_span = SpanClass (
176190 start = span .start + current_offset ,
177191 end = span .end + current_offset ,
178192 text = span .text ,
You can’t perform that action at this time.
0 commit comments