Skip to content
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

Unpin mypy #35667

Open
kdmccormick opened this issue Oct 17, 2024 · 1 comment
Open

Unpin mypy #35667

kdmccormick opened this issue Oct 17, 2024 · 1 comment
Assignees

Comments

@kdmccormick
Copy link
Member

kdmccormick commented Oct 17, 2024

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:

--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

@bmtcril
Copy link
Contributor

bmtcril commented Oct 17, 2024

This actually seems to be an issue with us pinning django-stubs here: #35275 I think we can move forward with this unpinning, but am not certain enough to do it today.

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

No branches or pull requests

2 participants