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

Crash with mypy plugin on mypy 0.961 #1433

Open
emosenkis opened this issue Jun 29, 2022 · 3 comments
Open

Crash with mypy plugin on mypy 0.961 #1433

emosenkis opened this issue Jun 29, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@emosenkis
Copy link

Bug report

What's wrong

Traceback (most recent call last):
  File "mypy/checkexpr.py", line 3991, in accept
  File "mypy/nodes.py", line 1760, in accept
  File "mypy/checkexpr.py", line 305, in visit_call_expr
  File "mypy/checkexpr.py", line 383, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 892, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 957, in check_call
  File "mypy/checkexpr.py", line 1085, in check_callable_call
  File "mypy/checkexpr.py", line 763, in apply_function_plugin
  File ".pyenv/versions/3.9.7/envs/venv/lib/python3.9/site-packages/returns/contrib/mypy/_features/partial.py", line 62, in analyze
    return _PartialFunctionReducer(
  File ".pyenv/versions/3.9.7/envs/venv/lib/python3.9/site-packages/returns/contrib/mypy/_features/partial.py", line 131, in new_partial
    fallback, intermediate = self._create_intermediate(case_function)
  File ".pyenv/versions/3.9.7/envs/venv/lib/python3.9/site-packages/returns/contrib/mypy/_features/partial.py", line 150, in _create_intermediate
    return intermediate, analyze_call(
  File ".pyenv/versions/3.9.7/envs/venv/lib/python3.9/site-packages/returns/contrib/mypy/_typeops/analtype.py", line 55, in analyze_call
    messages = checker.msg if show_errors else checker.msg.clean_copy()
AttributeError: 'MessageBuilder' object has no attribute 'clean_copy'

How is that should be

Don't use MessageBuilder.clean_copy (removed in python/mypy#12631)

System information

  • python version: 3.9

  • returns version: 0.19

  • mypy version: 0.961

  • hypothesis version (if any):

  • pytest version (if any):

@emosenkis emosenkis added the bug Something isn't working label Jun 29, 2022
@sobolevn
Copy link
Member

Yes, this is a known issue. Please, use supported mypy version for now.
https://github.com/dry-python/returns/blob/master/pyproject.toml#L75

@LeuschkeTressa
Copy link

Is there a workaround, other than disabling the plugin?

Or is a fix allowing a later mypy version on the way?

(For me, not using latest mypy crashes mypy due to other bugs, so currently I'm unable to use the returns plugin. As a consequence I'm currently lacking much of the typing support that is critical to me.)

@sobolevn
Copy link
Member

sobolevn commented Nov 5, 2022

I will refactor our plugin to work with mypy@0.99

Plugin API is changing too fast :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants