diff --git a/.github/workflows/conformance-test.yml b/.github/workflows/conformance-test.yml new file mode 100644 index 00000000..e0f96b90 --- /dev/null +++ b/.github/workflows/conformance-test.yml @@ -0,0 +1,121 @@ +name: Update Typing Conformance Tests Results + +on: + schedule: + - cron: "45 11 * * 1" + workflow_dispatch: + +permissions: + contents: write + +jobs: + check-versions: + runs-on: ubuntu-latest + outputs: + has_updates: ${{ steps.compare.outputs.has_updates }} + steps: + - name: Restore previous version state + id: restore-cache + uses: actions/cache/restore@v4 + with: + path: tool_versions.json + # We use a key that will mis s, forcing it to look at restore-keys + key: tool-state-placeholder-${{ github.run_id }} + # This picks the most recent cache matching this prefix + restore-keys: | + tool-state- + + - name: Check and Compare Versions + id: compare + run: | + TOOLS=("zuban" "pyrefly" "pyright" "mypy") + STATE_FILE="tool_versions.json" + UPDATED=false + + # Load previous state or create empty if first run + if [ -f "$STATE_FILE" ]; then + echo "Found previous state." + else + echo "{}" > "$STATE_FILE" + echo "No previous state found (First Run). Treating as updated." + # We force update to true on first run to populate the cache + UPDATED=true + fi + + # Temp file for the new state + NEW_STATE=$(mktemp) + echo "{}" > "$NEW_STATE" + + echo "Fetching versions from PyPI..." + + for tool in "${TOOLS[@]}"; do + # Fetch latest version string + LATEST=$(curl -sL "https://pypi.org/pypi/$tool/json" | jq -r '.info.version') + + # Get old version from JSON + OLD=$(jq -r --arg t "$tool" '.[$t] // ""' "$STATE_FILE") + + echo "Checking $tool: Old=$OLD | New=$LATEST" + + # Write to new state object + jq --arg t "$tool" --arg v "$LATEST" '.[$t] = $v' "$NEW_STATE" > "$NEW_STATE.tmp" && mv "$NEW_STATE.tmp" "$NEW_STATE" + + if [ "$LATEST" != "$OLD" ]; then + echo ">> UPDATE DETECTED for $tool" + UPDATED=true + fi + done + + if [ "$UPDATED" = "true" ]; then + echo "has_updates=true" >> $GITHUB_OUTPUT + # Replace the state file with the new one so Cache Save picks it up + mv "$NEW_STATE" "$STATE_FILE" + cat "$STATE_FILE" + else + echo "has_updates=false" >> $GITHUB_OUTPUT + echo "No updates found." + fi + + - name: Save new state to cache + if: steps.compare.outputs.has_updates == 'true' + uses: actions/cache/save@v4 + with: + path: tool_versions.json + # Unique key ensures a new cache entry is created + key: tool-state-${{ github.run_id }} + + run-conformance-tests: + needs: check-versions + if: needs.check-versions.outputs.has_updates == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v6 + with: + sparse-checkout: | + conformance + + - uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install Dependencies + run: | + cd conformance + pip install -r requirements.txt + + - name: Run Main Script (Src) + run: | + cd conformance/src + python main.py --skip-install-check + + - name: Commit and Push results + run: | + # go dir `conformance` + cd conformance + echo "Typing static type checkers has updated, commit and push new results" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add ./results/* + git commit -m "chore: update conformance test results" + git push diff --git a/conformance/results/mypy/callables_annotation.toml b/conformance/results/mypy/callables_annotation.toml index c8af7158..11daf620 100644 --- a/conformance/results/mypy/callables_annotation.toml +++ b/conformance/results/mypy/callables_annotation.toml @@ -17,17 +17,17 @@ callables_annotation.py:57: error: Bracketed expression "[...]" is not valid as callables_annotation.py:57: note: Did you mean "List[...]"? callables_annotation.py:58: error: Please use "Callable[[], ]" or "Callable" [misc] callables_annotation.py:59: error: Unexpected "..." [misc] -callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] -callables_annotation.py:93: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(int, 'a')], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:91: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "def (int, /, *Any, **Any) -> str") [assignment] +callables_annotation.py:93: error: Incompatible types in assignment (expression has type "def test_cb4(*, a: int) -> str", variable has type "def (int, /, *Any, **Any) -> str") [assignment] callables_annotation.py:157: error: Incompatible types in assignment (expression has type "Proto7", variable has type "Proto6") [assignment] callables_annotation.py:157: note: Following member(s) of "Proto7" have conflicts: callables_annotation.py:157: note: Expected: callables_annotation.py:157: note: def __call__(self, int, /, *args: Any, k: str, **kwargs: Any) -> None callables_annotation.py:157: note: Got: callables_annotation.py:157: note: def __call__(self, float, /, b: int, *, k: str, m: str) -> None -callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "Callable[[int, VarArg(Any), KwArg(Any)], str]") [assignment] -callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] -callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "Callable[[str, VarArg(Any), KwArg(Any)], str]") [assignment] +callables_annotation.py:172: error: Incompatible types in assignment (expression has type "Callable[[], str]", variable has type "def (int, /, *Any, **Any) -> str") [assignment] +callables_annotation.py:187: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "def (str, /, *Any, **Any) -> str") [assignment] +callables_annotation.py:189: error: Incompatible types in assignment (expression has type "Callable[[int, str], str]", variable has type "def (str, /, *Any, **Any) -> str") [assignment] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/callables_kwargs.toml b/conformance/results/mypy/callables_kwargs.toml index 39eaad11..f2203860 100644 --- a/conformance/results/mypy/callables_kwargs.toml +++ b/conformance/results/mypy/callables_kwargs.toml @@ -15,12 +15,12 @@ callables_kwargs.py:63: error: "func1" gets multiple values for keyword argument callables_kwargs.py:64: error: "func2" gets multiple values for keyword argument "v3" [misc] callables_kwargs.py:64: error: Argument 1 to "func2" has incompatible type "int"; expected "str" [arg-type] callables_kwargs.py:65: error: "func2" gets multiple values for keyword argument "v1" [misc] -callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol3") [assignment] -callables_kwargs.py:101: note: "TDProtocol3.__call__" has type "Callable[[NamedArg(int, 'v1'), NamedArg(int, 'v2'), NamedArg(str, 'v3')], None]" -callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol4") [assignment] -callables_kwargs.py:102: note: "TDProtocol4.__call__" has type "Callable[[NamedArg(int, 'v1')], None]" -callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "Callable[[KwArg(TD2)], None]", variable has type "TDProtocol5") [assignment] -callables_kwargs.py:103: note: "TDProtocol5.__call__" has type "Callable[[Arg(int, 'v1'), Arg(str, 'v3')], None]" +callables_kwargs.py:101: error: Incompatible types in assignment (expression has type "def func1(**kwargs: Unpack[TD2]) -> None", variable has type "TDProtocol3") [assignment] +callables_kwargs.py:101: note: "TDProtocol3.__call__" has type "def __call__(self, *, v1: int, v2: int, v3: str) -> None" +callables_kwargs.py:102: error: Incompatible types in assignment (expression has type "def func1(**kwargs: Unpack[TD2]) -> None", variable has type "TDProtocol4") [assignment] +callables_kwargs.py:102: note: "TDProtocol4.__call__" has type "def __call__(self, *, v1: int) -> None" +callables_kwargs.py:103: error: Incompatible types in assignment (expression has type "def func1(**kwargs: Unpack[TD2]) -> None", variable has type "TDProtocol5") [assignment] +callables_kwargs.py:103: note: "TDProtocol5.__call__" has type "def __call__(self, v1: int, v3: str) -> None" callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" [misc] callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict [misc] """ diff --git a/conformance/results/mypy/callables_protocol.toml b/conformance/results/mypy/callables_protocol.toml index 0f2f4213..8fc8dcea 100644 --- a/conformance/results/mypy/callables_protocol.toml +++ b/conformance/results/mypy/callables_protocol.toml @@ -1,36 +1,36 @@ conformant = "Pass" output = """ -callables_protocol.py:35: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(int | None, 'max_items')], list[bytes]]", variable has type "Proto1") [assignment] -callables_protocol.py:35: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" -callables_protocol.py:36: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], list[bytes]]", variable has type "Proto1") [assignment] -callables_protocol.py:36: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" -callables_protocol.py:37: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), NamedArg(str | None, 'max_len')], list[bytes]]", variable has type "Proto1") [assignment] -callables_protocol.py:37: note: "Proto1.__call__" has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]" -callables_protocol.py:67: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:67: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" -callables_protocol.py:68: error: Incompatible types in assignment (expression has type "Callable[[VarArg(str), KwArg(str)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:68: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" -callables_protocol.py:69: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), KwArg(bytes)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:69: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" -callables_protocol.py:70: error: Incompatible types in assignment (expression has type "Callable[[KwArg(str)], Any]", variable has type "Proto2") [assignment] -callables_protocol.py:70: note: "Proto2.__call__" has type "Callable[[VarArg(bytes), KwArg(str)], None]" +callables_protocol.py:35: error: Incompatible types in assignment (expression has type "def cb1_bad1(*vals: bytes, max_items: int | None) -> list[bytes]", variable has type "Proto1") [assignment] +callables_protocol.py:35: note: "Proto1.__call__" has type "def __call__(self, *vals: bytes, max_len: int | None = ...) -> list[bytes]" +callables_protocol.py:36: error: Incompatible types in assignment (expression has type "def cb1_bad2(*vals: bytes) -> list[bytes]", variable has type "Proto1") [assignment] +callables_protocol.py:36: note: "Proto1.__call__" has type "def __call__(self, *vals: bytes, max_len: int | None = ...) -> list[bytes]" +callables_protocol.py:37: error: Incompatible types in assignment (expression has type "def cb1_bad3(*vals: bytes, max_len: str | None) -> list[bytes]", variable has type "Proto1") [assignment] +callables_protocol.py:37: note: "Proto1.__call__" has type "def __call__(self, *vals: bytes, max_len: int | None = ...) -> list[bytes]" +callables_protocol.py:67: error: Incompatible types in assignment (expression has type "def cb2_bad1(*a: bytes) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:67: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" +callables_protocol.py:68: error: Incompatible types in assignment (expression has type "def cb2_bad2(*a: str, **b: str) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:68: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" +callables_protocol.py:69: error: Incompatible types in assignment (expression has type "def cb2_bad3(*a: bytes, **b: bytes) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:69: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" +callables_protocol.py:70: error: Incompatible types in assignment (expression has type "def cb2_bad4(**b: str) -> Any", variable has type "Proto2") [assignment] +callables_protocol.py:70: note: "Proto2.__call__" has type "def __call__(self, *vals: bytes, **kwargs: str) -> None" callables_protocol.py:97: error: Incompatible types in assignment (expression has type "Callable[[int], None]", variable has type "Proto4") [assignment] callables_protocol.py:97: note: "function" is missing following "Proto4" protocol member: callables_protocol.py:97: note: other_attribute -callables_protocol.py:121: error: Incompatible types in assignment (expression has type "Callable[[VarArg(bytes), DefaultNamedArg(int | None, 'max_len')], list[bytes]]", variable has type "NotProto6") [assignment] +callables_protocol.py:121: error: Incompatible types in assignment (expression has type "def cb6_bad1(*vals: bytes, max_len: int | None = ...) -> list[bytes]", variable has type "NotProto6") [assignment] callables_protocol.py:169: error: Incompatible types in assignment (expression has type "Callable[[int], Any]", variable has type "Proto8") [assignment] callables_protocol.py:169: note: "Proto8.__call__" has type overloaded function callables_protocol.py:186: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] callables_protocol.py:187: error: "Proto9[P, R]" has no attribute "xxx" [attr-defined] callables_protocol.py:197: error: "Proto9[[int], str]" has no attribute "other_attribute2"; maybe "other_attribute"? [attr-defined] callables_protocol.py:238: error: Incompatible types in assignment (expression has type "Callable[[int, str], Any]", variable has type "Proto11") [assignment] -callables_protocol.py:238: note: "Proto11.__call__" has type "Callable[[int, Arg(str, 'y')], Any]" -callables_protocol.py:260: error: Incompatible types in assignment (expression has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0')], None]", variable has type "Proto12") [assignment] -callables_protocol.py:260: note: "Proto12.__call__" has type "Callable[[VarArg(Any), NamedArg(Any, 'kwarg0'), NamedArg(Any, 'kwarg1')], None]" +callables_protocol.py:238: note: "Proto11.__call__" has type "def __call__(self, int, /, y: str) -> Any" +callables_protocol.py:260: error: Incompatible types in assignment (expression has type "def cb12_bad1(*args: Any, kwarg0: Any) -> None", variable has type "Proto12") [assignment] +callables_protocol.py:260: note: "Proto12.__call__" has type "def __call__(self, *args: Any, kwarg0: Any, kwarg1: Any) -> None" callables_protocol.py:284: error: Incompatible types in assignment (expression has type "Callable[[str], str]", variable has type "Proto13_Default") [assignment] -callables_protocol.py:284: note: "Proto13_Default.__call__" has type "Callable[[DefaultArg(str, 'path')], str]" -callables_protocol.py:311: error: Incompatible types in assignment (expression has type "Callable[[NamedArg(str, 'path')], str]", variable has type "Proto14_Default") [assignment] -callables_protocol.py:311: note: "Proto14_Default.__call__" has type "Callable[[DefaultNamedArg(str, 'path')], str]" +callables_protocol.py:284: note: "Proto13_Default.__call__" has type "def __call__(self, path: str = ...) -> str" +callables_protocol.py:311: error: Incompatible types in assignment (expression has type "def cb14_no_default(*, path: str) -> str", variable has type "Proto14_Default") [assignment] +callables_protocol.py:311: note: "Proto14_Default.__call__" has type "def __call__(self, *, path: str = ...) -> str" """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_converter.toml b/conformance/results/mypy/dataclasses_transform_converter.toml index cc316bee..fc5633e5 100644 --- a/conformance/results/mypy/dataclasses_transform_converter.toml +++ b/conformance/results/mypy/dataclasses_transform_converter.toml @@ -13,7 +13,7 @@ Line 121: Unexpected errors ['dataclasses_transform_converter.py:121: error: Arg """ output = """ dataclasses_transform_converter.py:48: error: Argument "converter" to "model_field" has incompatible type "Callable[[], int]"; expected "Callable[[Never], int]" [arg-type] -dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[Never], int]" [arg-type] +dataclasses_transform_converter.py:49: error: Argument "converter" to "model_field" has incompatible type "def bad_converter2(*, x: int) -> int"; expected "Callable[[Never], int]" [arg-type] dataclasses_transform_converter.py:107: error: Argument 2 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:107: error: Argument 3 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:107: error: Argument 4 to "DC2" has incompatible type "bytes"; expected "ConverterClass" [arg-type] diff --git a/conformance/results/mypy/generics_paramspec_semantics.toml b/conformance/results/mypy/generics_paramspec_semantics.toml index eb5b744e..7dc429c7 100644 --- a/conformance/results/mypy/generics_paramspec_semantics.toml +++ b/conformance/results/mypy/generics_paramspec_semantics.toml @@ -3,14 +3,14 @@ output = """ generics_paramspec_semantics.py:26: error: Unexpected keyword argument "a" [call-arg] generics_paramspec_semantics.py:26: error: Unexpected keyword argument "b" [call-arg] generics_paramspec_semantics.py:27: error: Argument 2 has incompatible type "str"; expected "bool" [arg-type] -generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "Callable[[NamedArg(int, 'y')], int]"; expected "Callable[[NamedArg(int, 'x')], int]" [arg-type] +generics_paramspec_semantics.py:61: error: Argument 2 to "func1" has incompatible type "def keyword_only_y(*, y: int) -> int"; expected "def (*, x: int) -> int" [arg-type] generics_paramspec_semantics.py:98: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] generics_paramspec_semantics.py:108: error: Argument 1 has incompatible type "int"; expected "bool" [arg-type] generics_paramspec_semantics.py:120: error: Argument 1 has incompatible type "int"; expected "str" [arg-type] generics_paramspec_semantics.py:127: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] generics_paramspec_semantics.py:127: note: This is likely because "one" has named arguments: "x". Consider marking them positional-only -generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[NamedArg(int, 'x')], int]"; expected "Callable[[int, NamedArg(int, 'x')], int]" [arg-type] -generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "Callable[[KwArg(int)], int]"; expected "Callable[[int, KwArg(int)], int]" [arg-type] +generics_paramspec_semantics.py:132: error: Argument 1 to "expects_int_first" has incompatible type "def two(*, x: int) -> int"; expected "def (int, /, *, x: int) -> int" [arg-type] +generics_paramspec_semantics.py:137: error: Argument 1 to "expects_int_first" has incompatible type "def three(**kwargs: int) -> int"; expected "def (int, /, **kwargs: int) -> int" [arg-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/generics_syntax_scoping.toml b/conformance/results/mypy/generics_syntax_scoping.toml index 1d6ad3e6..2e249720 100644 --- a/conformance/results/mypy/generics_syntax_scoping.toml +++ b/conformance/results/mypy/generics_syntax_scoping.toml @@ -3,8 +3,7 @@ notes = """ Does not following runtime scoping rules for type parameters in all cases. """ output = """ -generics_syntax_scoping.py:14: error: Variable "generics_syntax_scoping.S" is not valid as a type [valid-type] -generics_syntax_scoping.py:14: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_scoping.py:14: error: Name "S" is not defined [name-defined] generics_syntax_scoping.py:18: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:35: error: Cannot determine type of "T" [has-type] diff --git a/conformance/results/mypy/narrowing_typeguard.toml b/conformance/results/mypy/narrowing_typeguard.toml index 12cc80af..4c4f0952 100644 --- a/conformance/results/mypy/narrowing_typeguard.toml +++ b/conformance/results/mypy/narrowing_typeguard.toml @@ -4,7 +4,7 @@ narrowing_typeguard.py:102: error: TypeGuard functions must have a positional ar narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument [valid-type] narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" [arg-type] -narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" +narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "def __call__(self, val: object) -> str" """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/narrowing_typeis.toml b/conformance/results/mypy/narrowing_typeis.toml index b913aa17..5000a5bf 100644 --- a/conformance/results/mypy/narrowing_typeis.toml +++ b/conformance/results/mypy/narrowing_typeis.toml @@ -4,7 +4,7 @@ narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argume narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument [valid-type] narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" [arg-type] -narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" +narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "def __call__(self, val: object) -> str" narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" [arg-type] narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] diff --git a/conformance/results/mypy/typeddicts_type_consistency.toml b/conformance/results/mypy/typeddicts_type_consistency.toml index e0e0ba7f..3ddab2c9 100644 --- a/conformance/results/mypy/typeddicts_type_consistency.toml +++ b/conformance/results/mypy/typeddicts_type_consistency.toml @@ -8,8 +8,6 @@ typeddicts_type_consistency.py:76: error: Incompatible types in assignment (expr typeddicts_type_consistency.py:77: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[str, object]") [assignment] typeddicts_type_consistency.py:78: error: Incompatible types in assignment (expression has type "B3", variable has type "dict[Any, Any]") [assignment] typeddicts_type_consistency.py:82: error: Incompatible types in assignment (expression has type "B3", variable has type "Mapping[str, int]") [assignment] -typeddicts_type_consistency.py:101: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") [assignment] -typeddicts_type_consistency.py:107: error: Incompatible types in assignment (expression has type "int | str", variable has type "int") [assignment] typeddicts_type_consistency.py:126: error: Incompatible types (expression has type "int", TypedDict item "inner_key" has type "str") [typeddict-item] """ conformance_automated = "Pass" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 7ce901e6..e0afe12c 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 1.18.2" +version = "mypy 1.19.0" diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index 6e489a28..e6476ef7 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -4,7 +4,7 @@ errors_diff = """ """ output = """ ERROR aliases_explicit.py:67:9-28: `TypeAlias[GoodTypeAlias2, type[int | None]]` is not subscriptable [unsupported-operation] -ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[int | None]]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[GoodTypeAlias2]]]` is not subscriptable [unsupported-operation] ERROR aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml index 033e0c71..b8dea415 100644 --- a/conformance/results/pyrefly/aliases_implicit.toml +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -12,7 +12,7 @@ Line 117: Expected 1 errors """ output = """ ERROR aliases_implicit.py:76:9-28: `type[int | None]` is not subscriptable [unsupported-operation] -ERROR aliases_implicit.py:77:9-28: `type[list[int | None]]` is not subscriptable [unsupported-operation] +ERROR aliases_implicit.py:77:9-28: `type[list[GoodTypeAlias2]]` is not subscriptable [unsupported-operation] ERROR aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml index ea7fa432..92e2be0d 100644 --- a/conformance/results/pyrefly/callables_kwargs.toml +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -9,16 +9,13 @@ ERROR callables_kwargs.py:52:11-12: Expected argument `v1` to be passed by name ERROR callables_kwargs.py:52:11-12: Expected 0 positional arguments, got 3 in function `func1` [bad-argument-count] ERROR callables_kwargs.py:52:14-16: Expected argument `v3` to be passed by name in function `func1` [unexpected-positional-argument] ERROR callables_kwargs.py:58:11-20: Unpacked keyword argument `str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] -ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v1` with type `int` in function `func1` [bad-argument-type] -ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v2` with type `str` in function `func1` [bad-argument-type] -ERROR callables_kwargs.py:61:11-15: Unpacked keyword argument `int | str` is not assignable to parameter `v3` with type `str` in function `func1` [bad-argument-type] ERROR callables_kwargs.py:63:17-22: Multiple values for argument `v1` in function `func1` [bad-keyword-argument] ERROR callables_kwargs.py:64:11-12: Argument `Literal[1]` is not assignable to parameter `v3` with type `str` in function `func2` [bad-argument-type] ERROR callables_kwargs.py:64:14-19: Multiple values for argument `v3` in function `func2` [bad-keyword-argument] ERROR callables_kwargs.py:65:17-22: Multiple values for argument `v1` in function `func2` [bad-keyword-argument] -ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] -ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] -ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] +ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TD2]) -> None` is not assignable to `TDProtocol3` [bad-assignment] +ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TD2]) -> None` is not assignable to `TDProtocol4` [bad-assignment] +ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TD2]) -> None` is not assignable to `TDProtocol5` [bad-assignment] ERROR callables_kwargs.py:111:20-41: TypedDict key 'v1' in **kwargs overlaps with parameter 'v1' [bad-function-definition] ERROR callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] ERROR callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] diff --git a/conformance/results/pyrefly/dataclasses_final.toml b/conformance/results/pyrefly/dataclasses_final.toml index eed3df1b..5c34cd6f 100644 --- a/conformance/results/pyrefly/dataclasses_final.toml +++ b/conformance/results/pyrefly/dataclasses_final.toml @@ -2,13 +2,13 @@ conformant = "Partial" notes = """ Allows assignment to final attributes that are not initialized on the class """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 35: Expected 1 errors -Line 37: Expected 1 errors """ output = """ ERROR dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] +ERROR dataclasses_final.py:35:1-19: Cannot set field `final_no_default` [read-only] ERROR dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] +ERROR dataclasses_final.py:37:1-19: Cannot set field `final_no_default` [read-only] ERROR dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_transform_converter.toml b/conformance/results/pyrefly/dataclasses_transform_converter.toml index c3b990de..eca9d49c 100644 --- a/conformance/results/pyrefly/dataclasses_transform_converter.toml +++ b/conformance/results/pyrefly/dataclasses_transform_converter.toml @@ -4,9 +4,7 @@ errors_diff = """ """ output = """ ERROR dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] -ERROR dataclasses_transform_converter.py:48:41-55: Argument `() -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] ERROR dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> int` in function `model_field` [bad-argument-type] -ERROR dataclasses_transform_converter.py:49:41-55: Argument `(*, x: int) -> int` is not assignable to parameter `converter` with type `(@_) -> @_` in function `model_field` [bad-argument-type] ERROR dataclasses_transform_converter.py:107:5-6: Argument `Literal[1]` is not assignable to parameter `field0` with type `str` in function `DC2.__init__` [bad-argument-type] ERROR dataclasses_transform_converter.py:108:23-24: Argument `Literal[1]` is not assignable to parameter `field3` with type `bytes | str` in function `DC2.__init__` [bad-argument-type] ERROR dataclasses_transform_converter.py:109:29-31: Argument `complex` is not assignable to parameter `field4` with type `list[str] | str` in function `DC2.__init__` [bad-argument-type] diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index 3216033d..2bef8963 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -11,7 +11,7 @@ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot ERROR generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefaults`, got 1 [bad-specialization] ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] -ERROR generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] +ERROR generics_defaults.py:131:12-27: assert_type(int, Any) failed [assert-type] ERROR generics_defaults.py:142:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] ERROR generics_defaults.py:170:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml index f569cc93..b02d9808 100644 --- a/conformance/results/pyrefly/generics_syntax_scoping.toml +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -2,11 +2,8 @@ conformant = "Partial" notes = """ Does not implement some scoping restrictions for PEP695 generic syntax """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 98: Expected 1 errors """ output = """ ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] @@ -14,4 +11,7 @@ ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] +ERROR generics_syntax_scoping.py:92:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:95:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] +ERROR generics_syntax_scoping.py:98:17-18: Type parameter `T` shadows a type parameter of the same name from an enclosing scope [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_concat.toml b/conformance/results/pyrefly/generics_typevartuple_concat.toml index 042e0a2e..59f488b6 100644 --- a/conformance/results/pyrefly/generics_typevartuple_concat.toml +++ b/conformance/results/pyrefly/generics_typevartuple_concat.toml @@ -2,10 +2,8 @@ conformant = "Partial" notes = """ Fails to handle move_first_element_to_last example """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 56: Unexpected errors ['Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return]'] """ output = """ -ERROR generics_typevartuple_concat.py:56:12-30: Returned type `tuple[*tuple[object | T, ...], object | T]` is not assignable to declared return type `tuple[*Ts, T]` [bad-return] """ diff --git a/conformance/results/pyrefly/literals_interactions.toml b/conformance/results/pyrefly/literals_interactions.toml index 4e5d984e..6dc3d75c 100644 --- a/conformance/results/pyrefly/literals_interactions.toml +++ b/conformance/results/pyrefly/literals_interactions.toml @@ -8,10 +8,10 @@ Line 71: Unexpected errors ['`@` is not supported between `Matrix[Literal[2], Li Line 72: Unexpected errors ['assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type]'] """ output = """ -ERROR literals_interactions.py:15:5-9: Index 5 out of range for tuple with 3 elements [bad-index] -ERROR literals_interactions.py:16:5-9: Index -5 out of range for tuple with 3 elements [bad-index] -ERROR literals_interactions.py:17:5-9: Index 4 out of range for tuple with 3 elements [bad-index] -ERROR literals_interactions.py:18:5-10: Index -4 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:15:7-8: Index 5 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:16:7-8: Index -5 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:17:7-8: Index 4 out of range for tuple with 3 elements [bad-index] +ERROR literals_interactions.py:18:7-9: Index -4 out of range for tuple with 3 elements [bad-index] ERROR literals_interactions.py:71:9-14: `@` is not supported between `Matrix[Literal[2], Literal[3]]` and `Matrix[Literal[3], Literal[7]]` [unsupported-operation] ERROR literals_interactions.py:72:16-51: assert_type(Matrix[Literal[2], int], Matrix[Literal[2], Literal[7]]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/namedtuples_define_class.toml b/conformance/results/pyrefly/namedtuples_define_class.toml index 0c845656..706bce8f 100644 --- a/conformance/results/pyrefly/namedtuples_define_class.toml +++ b/conformance/results/pyrefly/namedtuples_define_class.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR namedtuples_define_class.py:32:7-12: Index 3 out of range for tuple with 3 elements [bad-index] -ERROR namedtuples_define_class.py:33:7-13: Index -4 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_define_class.py:32:10-11: Index 3 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_define_class.py:33:10-12: Index -4 out of range for tuple with 3 elements [bad-index] ERROR namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument] ERROR namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument] ERROR namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type] diff --git a/conformance/results/pyrefly/namedtuples_usage.toml b/conformance/results/pyrefly/namedtuples_usage.toml index 14f8163d..fb3a165a 100644 --- a/conformance/results/pyrefly/namedtuples_usage.toml +++ b/conformance/results/pyrefly/namedtuples_usage.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR namedtuples_usage.py:34:7-11: Index 3 out of range for tuple with 3 elements [bad-index] -ERROR namedtuples_usage.py:35:7-12: Index -4 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_usage.py:34:9-10: Index 3 out of range for tuple with 3 elements [bad-index] +ERROR namedtuples_usage.py:35:9-11: Index -4 out of range for tuple with 3 elements [bad-index] ERROR namedtuples_usage.py:40:1-4: Cannot set field `x` [read-only] ERROR namedtuples_usage.py:41:1-5: Cannot set item in `Point` [unsupported-operation] ERROR namedtuples_usage.py:42:5-8: Cannot delete field `x` [read-only] diff --git a/conformance/results/pyrefly/protocols_class_objects.toml b/conformance/results/pyrefly/protocols_class_objects.toml index 68cdca5c..e18c3614 100644 --- a/conformance/results/pyrefly/protocols_class_objects.toml +++ b/conformance/results/pyrefly/protocols_class_objects.toml @@ -4,16 +4,14 @@ Does not require concrete classes to be passed to type[Proto] """ conformance_automated = "Fail" errors_diff = """ -Line 29: Expected 1 errors -Line 34: Expected 1 errors Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 26: Unexpected errors ['Cannot instantiate `Proto` because it is a protocol [bad-instantiation]'] """ output = """ -ERROR protocols_class_objects.py:26:15-17: Cannot instantiate `Proto` because it is a protocol [bad-instantiation] +ERROR protocols_class_objects.py:29:5-10: Argument `type[Proto]` is not assignable to parameter `cls` with type `type[Proto]` in function `fun` [bad-argument-type] +ERROR protocols_class_objects.py:34:7-12: `type[Proto]` is not assignable to variable `var` with type `type[Proto]` [bad-assignment] ERROR protocols_class_objects.py:58:16-25: `type[ConcreteA]` is not assignable to `ProtoA1` [bad-assignment] ERROR protocols_class_objects.py:74:16-25: `type[ConcreteB]` is not assignable to `ProtoB1` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index cff8b33c..3986491f 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -5,10 +5,10 @@ Does not detect stub methods inherited from protocols as abstract. """ conformance_automated = "Fail" errors_diff = """ -Line 27: Expected 1 errors Line 89: Expected 1 errors """ output = """ +ERROR protocols_explicit.py:27:16-28: Method `draw` inherited from class `PColor` has no implementation and cannot be accessed via `super()` [missing-attribute] ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity`, `transparency` [bad-instantiation] ERROR protocols_explicit.py:134:15-17: Cannot instantiate `Concrete5` because the following members are abstract: `method1` [bad-instantiation] diff --git a/conformance/results/pyrefly/protocols_runtime_checkable.toml b/conformance/results/pyrefly/protocols_runtime_checkable.toml index 2566b2a4..7c47faff 100644 --- a/conformance/results/pyrefly/protocols_runtime_checkable.toml +++ b/conformance/results/pyrefly/protocols_runtime_checkable.toml @@ -2,14 +2,16 @@ conformant = "Partial" notes = """ Does not check for unsafe overlap in runtime_checkable protocols """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 88: Expected 1 errors -Line 92: Expected 1 errors -Line 96: Expected 1 errors """ output = """ ERROR protocols_runtime_checkable.py:23:22-28: Protocol `Proto1` is not decorated with @runtime_checkable and cannot be used with isinstance() [invalid-argument] ERROR protocols_runtime_checkable.py:55:22-34: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] ERROR protocols_runtime_checkable.py:61:22-53: Protocol `DataProtocol` has non-method members and cannot be used with issubclass() [invalid-argument] +ERROR protocols_runtime_checkable.py:88:33-39: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [invalid-argument] +ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3B` [invalid-argument] +ERROR protocols_runtime_checkable.py:92:23-48: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3B` [invalid-argument] +ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `Proto3` has an unsafe overlap with type `Concrete3A` [invalid-argument] +ERROR protocols_runtime_checkable.py:96:31-56: Runtime checkable protocol `NonDataProtocol` has an unsafe overlap with type `Concrete3A` [invalid-argument] """ diff --git a/conformance/results/pyrefly/typeddicts_class_syntax.toml b/conformance/results/pyrefly/typeddicts_class_syntax.toml index c620b102..4fec5a41 100644 --- a/conformance/results/pyrefly/typeddicts_class_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_class_syntax.toml @@ -3,9 +3,9 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_class_syntax.py:29:9-16: TypedDict item `method1` may not be initialized [bad-class-definition] -ERROR typeddicts_class_syntax.py:34:9-16: TypedDict item `method2` may not be initialized [bad-class-definition] -ERROR typeddicts_class_syntax.py:39:9-16: TypedDict item `method3` may not be initialized [bad-class-definition] +ERROR typeddicts_class_syntax.py:29:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] +ERROR typeddicts_class_syntax.py:34:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] +ERROR typeddicts_class_syntax.py:39:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition] ERROR typeddicts_class_syntax.py:44:7-20: Typed dictionary definitions may not specify a metaclass [invalid-inheritance] ERROR typeddicts_class_syntax.py:49:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict] """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 6dd41085..1f75ab69 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -20,15 +20,15 @@ ERROR typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [bad-typed-dict-key] -ERROR typeddicts_extra_items.py:215:22-30: `TypedDict[MovieDetails]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] -ERROR typeddicts_extra_items.py:222:22-30: `TypedDict[MovieWithYear2]` is not assignable to `TypedDict[MovieBase2]` [bad-assignment] -ERROR typeddicts_extra_items.py:242:19-27: `TypedDict[MovieDetails5]` is not assignable to `TypedDict[MovieSI]` [bad-assignment] -ERROR typeddicts_extra_items.py:256:13-22: `TypedDict[MovieExtraStr]` is not assignable to variable `extra_int` with type `TypedDict[MovieExtraInt]` [bad-assignment] -ERROR typeddicts_extra_items.py:257:13-22: `TypedDict[MovieExtraInt]` is not assignable to variable `extra_str` with type `TypedDict[MovieExtraStr]` [bad-assignment] -ERROR typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not assignable to variable `extra_int2` with type `TypedDict[MovieExtraInt]` [bad-assignment] -ERROR typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] -ERROR typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] -ERROR typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] -ERROR typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] +ERROR typeddicts_extra_items.py:215:22-30: `MovieDetails` is not assignable to `MovieBase2` [bad-assignment] +ERROR typeddicts_extra_items.py:222:22-30: `MovieWithYear2` is not assignable to `MovieBase2` [bad-assignment] +ERROR typeddicts_extra_items.py:242:19-27: `MovieDetails5` is not assignable to `MovieSI` [bad-assignment] +ERROR typeddicts_extra_items.py:256:13-22: `MovieExtraStr` is not assignable to variable `extra_int` with type `MovieExtraInt` [bad-assignment] +ERROR typeddicts_extra_items.py:257:13-22: `MovieExtraInt` is not assignable to variable `extra_str` with type `MovieExtraStr` [bad-assignment] +ERROR typeddicts_extra_items.py:268:14-24: `MovieNotClosed` is not assignable to variable `extra_int2` with type `MovieExtraInt` [bad-assignment] +ERROR typeddicts_extra_items.py:278:15-57: No matching overload found for function `NonClosedMovie.__init__` called with arguments: (name=Literal['No Country for Old Men'], year=Literal[2007]) [no-matching-overload] +ERROR typeddicts_extra_items.py:285:11-62: No matching overload found for function `ExtraMovie.__init__` called with arguments: (name=Literal['No Country for Old Men'], language=Literal['English']) [no-matching-overload] +ERROR typeddicts_extra_items.py:293:12-54: No matching overload found for function `ClosedMovie.__init__` called with arguments: (name=Literal['No Country for Old Men'], year=Literal[2007]) [no-matching-overload] +ERROR typeddicts_extra_items.py:303:34-44: `MovieExtraInt` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `IntDict` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml index 90edd6de..9f8e01d8 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_consistency.toml @@ -3,11 +3,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_consistency.py:37:14-15: `TypedDict[A1]` is not assignable to `TypedDict[B1]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:38:14-15: `TypedDict[C1]` is not assignable to `TypedDict[B1]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:40:14-15: `TypedDict[A1]` is not assignable to `TypedDict[C1]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:81:14-15: `TypedDict[A2]` is not assignable to `TypedDict[B2]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:82:14-15: `TypedDict[C2]` is not assignable to `TypedDict[B2]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:84:14-15: `TypedDict[A2]` is not assignable to `TypedDict[C2]` [bad-assignment] -ERROR typeddicts_readonly_consistency.py:85:14-15: `TypedDict[B2]` is not assignable to `TypedDict[C2]` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:37:14-15: `A1` is not assignable to `B1` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:38:14-15: `C1` is not assignable to `B1` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:40:14-15: `A1` is not assignable to `C1` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:81:14-15: `A2` is not assignable to `B2` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:82:14-15: `C2` is not assignable to `B2` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:84:14-15: `A2` is not assignable to `C2` [bad-assignment] +ERROR typeddicts_readonly_consistency.py:85:14-15: `B2` is not assignable to `C2` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 12866032..c7d1f621 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -2,9 +2,8 @@ conformant = "Partial" notes = """ Does not restrictions around overriding for ReadOnly fields """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 119: Expected 1 errors """ output = """ ERROR typeddicts_readonly_inheritance.py:36:4-10: Key `name` in TypedDict `Album2` is read-only [read-only] @@ -16,5 +15,6 @@ ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` fo ERROR typeddicts_readonly_inheritance.py:94:5-6: TypedDict field `a` in `F3` cannot be marked read-only; parent TypedDict `F1` defines it as mutable [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:98:5-6: TypedDict field `a` in `F4` must remain required because parent TypedDict `F1` defines it as required [bad-typed-dict-key] ERROR typeddicts_readonly_inheritance.py:106:5-6: TypedDict field `c` in `F6` cannot be made non-required; parent TypedDict `F1` defines it as required [bad-typed-dict-key] +ERROR typeddicts_readonly_inheritance.py:119:7-11: Field `x` is declared `float` in ancestor `class TD_A2: ... ERROR typeddicts_readonly_inheritance.py:132:7-11: TypedDict field `x` in `TD_B` cannot be made non-required; parent TypedDict `TD_B2` defines it as required [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_update.toml b/conformance/results/pyrefly/typeddicts_readonly_update.toml index a56c02f8..44bc1487 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_update.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_update.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` called with arguments: (TypedDict[A]) [no-matching-overload] +ERROR typeddicts_readonly_update.py:23:10-14: No matching overload found for function `A.update` called with arguments: (A) [no-matching-overload] """ diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml index 8af58214..87749507 100644 --- a/conformance/results/pyrefly/typeddicts_required.toml +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -2,9 +2,8 @@ conformant = "Partial" notes = """ Does not handle recursive typed dicts in functional syntax """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 71: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] """ output = """ ERROR typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] @@ -12,5 +11,4 @@ ERROR typeddicts_required.py:16:8-19: `NotRequired` is only allowed inside a cla ERROR typeddicts_required.py:16:8-24: `NotRequired` is not allowed in this context [invalid-annotation] ERROR typeddicts_required.py:59:8-31: Duplicate qualifier `Required` [invalid-annotation] ERROR typeddicts_required.py:60:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] -ERROR typeddicts_required.py:71:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] """ diff --git a/conformance/results/pyrefly/typeddicts_type_consistency.toml b/conformance/results/pyrefly/typeddicts_type_consistency.toml index bc1273de..3003ae79 100644 --- a/conformance/results/pyrefly/typeddicts_type_consistency.toml +++ b/conformance/results/pyrefly/typeddicts_type_consistency.toml @@ -3,13 +3,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_type_consistency.py:21:10-12: `TypedDict[B1]` is not assignable to `TypedDict[A1]` [bad-assignment] -ERROR typeddicts_type_consistency.py:38:10-12: `TypedDict[B2]` is not assignable to `TypedDict[A2]` [bad-assignment] -ERROR typeddicts_type_consistency.py:65:6-8: `TypedDict[A3]` is not assignable to variable `b3` with type `TypedDict[B3]` [bad-assignment] +ERROR typeddicts_type_consistency.py:21:10-12: `B1` is not assignable to `A1` [bad-assignment] +ERROR typeddicts_type_consistency.py:38:10-12: `B2` is not assignable to `A2` [bad-assignment] +ERROR typeddicts_type_consistency.py:65:6-8: `A3` is not assignable to variable `b3` with type `B3` [bad-assignment] ERROR typeddicts_type_consistency.py:69:21-24: Key `y` is not defined in TypedDict `A3` [bad-typed-dict-key] -ERROR typeddicts_type_consistency.py:76:22-24: `TypedDict[B3]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR typeddicts_type_consistency.py:77:25-27: `TypedDict[B3]` is not assignable to `dict[str, object]` [bad-assignment] -ERROR typeddicts_type_consistency.py:78:22-24: `TypedDict[B3]` is not assignable to `dict[Any, Any]` [bad-assignment] -ERROR typeddicts_type_consistency.py:82:25-27: `TypedDict[B3]` is not assignable to `Mapping[str, int]` [bad-assignment] +ERROR typeddicts_type_consistency.py:76:22-24: `B3` is not assignable to `dict[str, int]` [bad-assignment] +ERROR typeddicts_type_consistency.py:77:25-27: `B3` is not assignable to `dict[str, object]` [bad-assignment] +ERROR typeddicts_type_consistency.py:78:22-24: `B3` is not assignable to `dict[Any, Any]` [bad-assignment] +ERROR typeddicts_type_consistency.py:82:25-27: `B3` is not assignable to `Mapping[str, int]` [bad-assignment] ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [bad-typed-dict-key] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index e0f0cc51..3c6261d6 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.39.4" +version = "pyrefly 0.44.2" diff --git a/conformance/results/results.html b/conformance/results/results.html index 8570f7c6..768fc041 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,13 +158,13 @@

Python Type System Conformance Test Results

- - -
 
mypy 1.18.2
+
mypy 1.19.0
pyright 1.1.407
zuban 0.2.1
+
zuban 0.3.0
pyrefly 0.39.4
+
pyrefly 0.44.2
diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index 73d4e185..30b51eb1 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -2,9 +2,8 @@ conformant = "Pass" notes = """ Does not support tuple narrowing based on `len()` type guard (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 111, 112: Expected error (tag 'func6_3') """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -18,6 +17,7 @@ tuples_type_compat.py:81: error: Expression is of type "tuple[str, str] | tuple[ tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:102: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:107: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:112: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:127: error: Expression is of type "tuple[int | str, str]", not "tuple[int | str, int | str]" [misc] tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" [misc] tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index eeff6b71..7c3e030d 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.2.1" +version = "zuban 0.3.0" diff --git a/conformance/src/main.py b/conformance/src/main.py index 62a827bc..390d61b6 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -3,15 +3,14 @@ """ import os -from pathlib import Path import re import sys +from pathlib import Path from time import time from typing import Sequence import tomli import tomlkit - from options import parse_options from reporting import generate_summary from test_groups import get_test_cases, get_test_groups @@ -262,10 +261,14 @@ def main(): for type_checker in TYPE_CHECKERS: if options.only_run and options.only_run != type_checker.name: continue - if not type_checker.install(): - print(f"Skipping tests for {type_checker.name}") + if options.skip_install_check: + print("Skipping install check") else: - run_tests(root_dir, type_checker, test_cases) + if not type_checker.install(): + print(f"Skipping tests for {type_checker.name}") + continue + + run_tests(root_dir, type_checker, test_cases) # Generate a summary report. generate_summary(root_dir) diff --git a/conformance/src/options.py b/conformance/src/options.py index 76c2c5be..2d72eb61 100644 --- a/conformance/src/options.py +++ b/conformance/src/options.py @@ -7,10 +7,12 @@ from type_checker import TYPE_CHECKERS + @dataclass class _Options: report_only: bool | None only_run: str | None + skip_install_check: bool | None def parse_options(argv: list[str]) -> _Options: @@ -24,7 +26,13 @@ def parse_options(argv: list[str]) -> _Options: reporting_group.add_argument( "--only-run", help="Only runs the type checker", - choices=[tc.name for tc in TYPE_CHECKERS] + choices=[tc.name for tc in TYPE_CHECKERS], ) + reporting_group.add_argument( + "--skip-install-check", + action="store_true", + help="Skips the check for whether type checkers are installed", + ) + ret = _Options(**vars(parser.parse_args(argv))) return ret