Skip to content

Commit 37fd9ee

Browse files
authored
๐Ÿšจ Fix mypy tests due to wrong quoting (#510)
* ๐Ÿšจ Fix mypy tests due to wrong quoting * โž• Add types-mock as dev dependnecy * โž• Add types-contextvars and types-dataclasses as dev dependencies * โœ๏ธ Add python markers on types-contextvars and types-dataclasses
1 parent ea9aedf commit 37fd9ee

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

โ€Žrequirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ pytest>=5.2.0
2121
pytest-cov>=2.7.0,<2.8.0
2222
mock>=2.0.0,<3.0.0
2323
flake8>=3.5.0,<3.6.0
24-
mypy
24+
mypy>=0.901
25+
types-mock>=0.1.1
26+
types-contextvars>=0.1.2; python_version < "3.7"
27+
types-dataclasses>=0.1.3; python_version < "3.7"
2528
# Executing notebook tests
2629
ipykernel>=5.1.4,<5.2.0
2730
nbconvert==5.6.1,<5.7.0

โ€Žthinc/tests/mypy/outputs/fail-plugin.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
12: error: Layer input (thinc.types.Ragged) not compatible with previous layer input (thinc.types.Floats2d) [layer-mismatch-input]
1313
12: error: Layer input (thinc.types.Ragged) not compatible with next layer input (thinc.types.Floats2d) [layer-mismatch-input]
1414
12: error: Layer input (thinc.types.Floats2d) not compatible with previous layer input (thinc.types.Ragged) [layer-mismatch-input]
15-
14: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]'
15+
14: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]"
1616
17: error: Layer input (thinc.types.Floats2d) not compatible with next layer input (thinc.types.Ragged) [layer-mismatch-input]
1717
17: error: Layer input (thinc.types.Ragged) not compatible with previous layer input (thinc.types.Floats2d) [layer-mismatch-input]
1818
17: error: Layer input (thinc.types.Ragged) not compatible with next layer input (thinc.types.Floats2d) [layer-mismatch-input]
1919
17: error: Layer input (thinc.types.Floats2d) not compatible with previous layer input (thinc.types.Ragged) [layer-mismatch-input]
20-
20: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]'
20+
20: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]"
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
3: error: Need type annotation for 'good_model' [var-annotated]
2-
4: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, Any]'
3-
6: error: Need type annotation for 'good_model2' [var-annotated]
4-
7: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, Any]'
5-
9: error: Need type annotation for 'bad_model_undetected' [var-annotated]
6-
10: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, Any]'
7-
12: error: Need type annotation for 'bad_model_undetected2' [var-annotated]
8-
13: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, Any]'
1+
3: error: Need type annotation for "good_model" [var-annotated]
2+
4: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, Any]"
3+
6: error: Need type annotation for "good_model2" [var-annotated]
4+
7: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, Any]"
5+
9: error: Need type annotation for "bad_model_undetected" [var-annotated]
6+
10: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, Any]"
7+
12: error: Need type annotation for "bad_model_undetected2" [var-annotated]
8+
13: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, Any]"
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
6: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]'
2-
9: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]'
3-
12: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]'
4-
15: note: Revealed type is 'thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]'
5-
31: error: Need type annotation for 'non_combinator_model' [var-annotated]
6-
34: note: Revealed type is 'thinc.model.Model[Any, Any]'
1+
6: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]"
2+
9: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]"
3+
12: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]"
4+
15: note: Revealed type is "thinc.model.Model[thinc.types.Floats2d, thinc.types.Floats2d]"
5+
31: error: Need type annotation for "non_combinator_model" [var-annotated]
6+
34: note: Revealed type is "thinc.model.Model[Any, Any]"

0 commit comments

Comments
ย (0)