Skip to content

Make some parse errors non-blocking #18941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged

Conversation

hauntsaninja
Copy link
Collaborator

I made the argument explicit and left blocker=True for some ones I didn't check

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

colour (https://github.com/colour-science/colour)
+ colour/hints/__init__.py:617: error: Missing return statement  [empty-body]
+ colour/hints/__init__.py:620: error: Missing return statement  [empty-body]
+ colour/hints/__init__.py:636: error: Argument 1 to "arraylike" has incompatible type "list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | int | float | complex | str | _NestedSequence[bool | int | float | complex | str | bytes]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/hints/__init__.py:638: error: Argument 1 to "arraylike" has incompatible type "list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | int | float | complex | str | _NestedSequence[bool | int | float | complex | str | bytes]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/hints/__init__.py:647: error: Argument 1 to "number_or_arraylike" has incompatible type "list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | int | float | complex | str | _NestedSequence[bool | int | float | complex | str | bytes]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/hints/__init__.py:649: error: Argument 1 to "number_or_arraylike" has incompatible type "list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | int | float | complex | str | _NestedSequence[bool | int | float | complex | str | bytes]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/hints/__init__.py:658: error: Argument 1 to "arraylike" has incompatible type "list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | int | float | complex | str | _NestedSequence[bool | int | float | complex | str | bytes]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/hints/__init__.py:660: error: Argument 1 to "arraylike" has incompatible type "list[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | int | float | complex | str | _NestedSequence[bool | int | float | complex | str | bytes]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/volume/mesh.py:71: error: Argument 1 to "Delaunay" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | builtins.bool | int | float | complex | str | bytes | _NestedSequence[builtins.bool | int | float | complex | str | bytes]"; expected "CanArrayND[floating[Any] | integer[Any] | numpy.bool[builtins.bool], tuple[int, ...]] | Sequence[CanArrayND[floating[Any] | integer[Any] | numpy.bool[builtins.bool], tuple[int, ...]] | Sequence[float | floating[Any] | integer[Any] | numpy.bool[builtins.bool] | CanArray0D[floating[Any] | integer[Any] | numpy.bool[builtins.bool]]]]"  [arg-type]
+ colour/volume/mesh.py:73: error: Argument 1 to "find_simplex" of "Delaunay" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | builtins.bool | int | float | complex | str | bytes | _NestedSequence[builtins.bool | int | float | complex | str | bytes]"; expected "CanArrayND[floating[Any] | integer[Any] | numpy.bool[builtins.bool], tuple[int, ...]] | SequenceND[CanArrayND[floating[Any] | integer[Any] | numpy.bool[builtins.bool], tuple[int, ...]] | float | floating[Any] | integer[Any] | numpy.bool[builtins.bool] | CanArray0D[floating[Any] | integer[Any] | numpy.bool[builtins.bool]]]"  [arg-type]
+ colour/utilities/verbose.py:122: error: "MixinLogging" has no attribute "name"  [attr-defined]
+ colour/utilities/verbose.py:850: error: Cannot find implementation or library stub for module named "pkg_resources"  [import-not-found]
+ colour/utilities/requirements.py:149: error: Library stubs not installed for "networkx"  [import-untyped]
+ colour/utilities/requirements.py:187: error: Cannot find implementation or library stub for module named "PyOpenColorIO"  [import-not-found]
+ colour/utilities/requirements.py:224: error: Cannot find implementation or library stub for module named "OpenImageIO"  [import-not-found]
+ colour/utilities/requirements.py:299: error: Cannot find implementation or library stub for module named "pydot"  [import-not-found]
+ colour/utilities/requirements.py:348: error: Library stubs not installed for "tqdm"  [import-untyped]
+ colour/utilities/requirements.py:385: error: Cannot find implementation or library stub for module named "trimesh"  [import-not-found]
+ colour/utilities/requirements.py:422: error: Cannot find implementation or library stub for module named "xxhash"  [import-not-found]
+ colour/utilities/network.py:153: error: "Self" has no attribute "_id"  [attr-defined]
+ colour/utilities/network.py:184: error: "TreeNode" has no attribute "_id"; maybe "id"?  [attr-defined]
+ colour/utilities/network.py:335: error: Need type annotation for "sibling"  [var-annotated]
+ colour/utilities/network.py:996: error: Need type annotation for "_input_ports" (hint: "_input_ports: dict[<type>, <type>] = ...")  [var-annotated]
+ colour/utilities/network.py:997: error: Need type annotation for "_output_ports" (hint: "_output_ports: dict[<type>, <type>] = ...")  [var-annotated]
+ colour/utilities/network.py:1071: error: Need type annotation for "input_edges" (hint: "input_edges: dict[<type>, <type>] = ...")  [var-annotated]
+ colour/utilities/network.py:1077: error: Need type annotation for "output_edges" (hint: "output_edges: dict[<type>, <type>] = ...")  [var-annotated]
+ colour/utilities/network.py:1436: error: Item "None" of "Any | None" has no attribute "connect"  [union-attr]
+ colour/utilities/network.py:1481: error: Item "None" of "Any | None" has no attribute "disconnect"  [union-attr]
+ colour/utilities/network.py:1624: error: Need type annotation for "_nodes" (hint: "_nodes: dict[<type>, <type>] = ...")  [var-annotated]
+ colour/utilities/network.py:1689: error: Argument 1 to "append" of "list" has incompatible type "PortNode"; expected "Self"  [arg-type]
+ colour/utilities/network.py:1743: error: Argument 1 to "remove" of "list" has incompatible type "PortNode"; expected "Self"  [arg-type]
+ colour/utilities/network.py:1779: error: Library stubs not installed for "networkx"  [import-untyped]
+ colour/utilities/network.py:1802: error: Item "None" of "PortNode | None" has no attribute "name"  [union-attr]
+ colour/utilities/network.py:1811: error: Item "None" of "PortNode | None" has no attribute "name"  [union-attr]
+ colour/utilities/network.py:1822: error: Item "None" of "PortNode | None" has no attribute "name"  [union-attr]
+ colour/utilities/network.py:1831: error: Item "None" of "PortNode | None" has no attribute "name"  [union-attr]
+ colour/utilities/network.py:1928: error: Name "Dot" is not defined  [name-defined]
+ colour/utilities/network.py:1954: error: Cannot find implementation or library stub for module named "pydot"  [import-not-found]
+ colour/utilities/common.py:1098: error: Cannot find implementation or library stub for module named "xxhash"  [import-not-found]
+ colour/utilities/array.py:143: error: Argument 1 to "fields" has incompatible type "MixinDataclassFields"; expected "DataclassInstance | type[DataclassInstance]"  [arg-type]
+ colour/utilities/array.py:270: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | <6 more items> | None")  [assignment]
+ colour/utilities/array.py:521: error: Argument 1 to "as_float_array" has incompatible type "DataclassInstance | type[DataclassInstance]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"  [arg-type]
+ colour/utilities/array.py:527: error: Value of type variable "_DataclassT" of "replace" cannot be "MixinDataclassArithmetic"  [type-var]
+ colour/utilities/array.py:616: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | type[unsignedinteger[_16Bit]] | type[unsignedinteger[_32Bit]] | type[unsignedinteger[_64Bit]] | None")  [assignment]
+ colour/utilities/array.py:623: error: "None" not callable  [misc]
+ colour/utilities/array.py:623: error: Incompatible return value type (got "signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit] | Any", expected "ndarray[tuple[int, ...], dtype[signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit]]]")  [return-value]
+ colour/utilities/array.py:623: error: Argument 1 to "signedinteger" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"; expected "SupportsInt | SupportsIndex | str | bytes"  [arg-type]
+ colour/utilities/array.py:623: error: Argument 1 to "unsignedinteger" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"; expected "SupportsInt | SupportsIndex | str | bytes"  [arg-type]
+ colour/utilities/array.py:656: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:672: error: "None" not callable  [misc]
+ colour/utilities/array.py:672: error: Incompatible return value type (got "floating[_16Bit] | floating[_32Bit] | float64 | Any", expected "ndarray[tuple[int, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/utilities/array.py:672: error: Argument 1 to "floating" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"; expected "SupportsFloat | SupportsIndex | str | bytes | None"  [arg-type]
+ colour/utilities/array.py:672: error: Argument 1 to "float64" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]"; expected "SupportsFloat | SupportsIndex | str | bytes | None"  [arg-type]
+ colour/utilities/array.py:700: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | type[unsignedinteger[_16Bit]] | type[unsignedinteger[_32Bit]] | type[unsignedinteger[_64Bit]] | None")  [assignment]
+ colour/utilities/array.py:735: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:866: error: Module has no attribute "DTYPE_INT_DEFAULT"  [attr-defined]
+ colour/utilities/array.py:916: error: Module has no attribute "DTYPE_FLOAT_DEFAULT"  [attr-defined]
+ colour/utilities/array.py:1134: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1198: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1263: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1327: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1398: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1468: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1536: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1605: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1673: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:1748: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64] | None")  [assignment]
+ colour/utilities/array.py:2173: error: Incompatible types in assignment (expression has type "type[generic[float]]", variable has type "type[numpy.bool[builtins.bool]] | type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | <7 more items> | None")  [assignment]
+ colour/utilities/array.py:2235: error: Incompatible types in assignment (expression has type "type[generic[float]]", variable has type "type[numpy.bool[builtins.bool]] | type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | <7 more items> | None")  [assignment]
+ colour/utilities/array.py:2556: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | <6 more items> | None")  [assignment]
+ colour/utilities/array.py:2594: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | <6 more items> | None")  [assignment]
+ colour/utilities/array.py:2634: error: Incompatible types in assignment (expression has type "type[object]", variable has type "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | <6 more items> | None")  [assignment]
+ colour/utilities/__init__.py:324: error: Incompatible types in assignment (expression has type "utilities", target has type Module)  [assignment]

... (truncated 1832 lines) ...

@hauntsaninja hauntsaninja merged commit 99e2688 into python:master Apr 18, 2025
18 checks passed
@hauntsaninja hauntsaninja deleted the blocker branch April 18, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant