Skip to content

Commit 329d91b

Browse files
Update mypy (#9469)
1 parent 421d3c3 commit 329d91b

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/syntax-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ jobs:
3838
3939
- name: Run Syntax Test
4040
run: |
41-
runInContainer bash -c "pip install --no-cache-dir quantconnect-stubs types-requests==2.32.* types-pytz==2025.2.0.* mypy==1.15.0"
42-
runInContainer python run_syntax_check.py
41+
runInContainer bash -c "pip install --no-cache-dir quantconnect-stubs types-requests==2.32.* types-pytz==2025.2.0.* mypy==1.20.2"
42+
runInContainer python run_syntax_check.py

run_syntax_check.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def should_ignore(line: str, prev_line_ignored: bool) -> bool:
7171
'Module has no attribute "JsonConvert"',
7272
'Too many arguments for "update" of "IndicatorBase"',
7373
'Signature of "update" incompatible with supertype "IndicatorBase"',
74+
'Signature of "update" incompatible with supertype "QuantConnect.Indicators.IndicatorBase"',
7475
'has incompatible type "Symbol"; expected "str"',
7576
# This methods take an indicator and consolidator which might be instances of custom
7677
# indicator/consolidator Python classes that don't inherit from PythonIndicator or IDataConsolidator
@@ -94,7 +95,7 @@ def should_ignore(line: str, prev_line_ignored: bool) -> bool:
9495

9596
# Ignore accessing indicator properties. Useful for instance when adding indicators of different types
9697
# to a list and then iterating over them, the common type will be IIndicatorWarmUpPeriodProvider
97-
indicator_attributes_match = re.search(r'error: "IIndicatorWarmUpPeriodProvider" has no attribute "([^"]+)"', line)
98+
indicator_attributes_match = re.search(r'error: "IIndicatorWarmUpPeriodProvider" has no attribute "([^"]+)"', line) or re.search(r'error: "Iterable\[IndicatorDataPoint\]" has no attribute "([^"]+)"', line)
9899
if indicator_attributes_match and indicator_attributes_match.group(1) in specific_indicator_attributes:
99100
return True
100101

@@ -156,4 +157,4 @@ def run_syntax_check(target_file: str):
156157
log(str(result))
157158
success_rate = round((sum(result) / len(result)) * 100, 1)
158159
log(f"SUCCESS RATE {success_rate}% took {time.time() - start_time}s")
159-
exit(0 if success_rate >= 99.3 else 1)
160+
exit(0 if success_rate >= 99.1 else 1)

0 commit comments

Comments
 (0)