Skip to content

Unpin mypy #35667

Description

@kdmccormick

mypy was recently upgraded to 1.12.0, and CI ran on that upgrade PR without issue.

Once that PR was merged in with the changes from this collections PR, though, mypy on master started failing with:

openedx/core/djangoapps/content_libraries/api.py:737: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues
version: 1.12.0
openedx/core/djangoapps/content_libraries/api.py:737: : note: please use --show-traceback to print a traceback when reporting a bug

The "offending" line does not have anything obviously wrong with it: https://github.com/openedx/edx-platform/blob/ecbedbcf78cd74c907f18d76b77a64e31ccf78fe/openedx/core/djangoapps/content_libraries/api.py#L737

--show-traceback adds more details:

app@4995b0c986b2:~/edx-platform$ mypy --show-traceback
openedx/core/djangoapps/content_libraries/api.py:737: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.12.0
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5847, in accept
  File "mypy/nodes.py", line 1969, in accept
  File "mypy/checkexpr.py", line 480, in visit_call_expr
  File "mypy/checkexpr.py", line 614, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1471, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1565, in check_call
  File "mypy/checkexpr.py", line 1811, in check_callable_call
  File "mypy/checkexpr.py", line 1262, in apply_function_plugin
  File "/openedx/venv/lib/python3.11/site-packages/mypy_django_plugin/transformers/querysets.py", line 305, in extract_proper_type_queryset_values
    row_type = helpers.make_typeddict(ctx.api, column_types, set(column_types.keys()))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/openedx/venv/lib/python3.11/site-packages/mypy_django_plugin/lib/helpers.py", line 307, in make_typeddict
    typed_dict_type = TypedDictType(fields, required_keys=required_keys, fallback=object_type)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: __init__() missing required argument 'readonly_keys' (pos 3)
openedx/core/djangoapps/content_libraries/api.py:737: : note: use --pdb to drop into pdb

We are pinning mypy back to 1.11.2 here: #35666

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions