Skip to content

AssertionError on version 0.960 #12868

Closed
@Apakottur

Description

@Apakottur

Bug Report

We are using the ddtrace Python package.
Consider the following file:

# test.py
import ddtrace

Running mypy test.py passes without issues on version 0.950 but when run on version 0.960 the following is printed:

Traceback (most recent call last):
  File ".../bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File ".../python3.10/site-packages/mypy/__main__.py", line 12, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "mypy/main.py", line 96, in main
  File "mypy/main.py", line 173, in run_build
  File "mypy/build.py", line 154, in build
  File "mypy/build.py", line 230, in _build
  File "mypy/build.py", line 2729, in dispatch
  File "mypy/build.py", line 3087, in process_graph
  File "mypy/build.py", line 3179, in process_stale_scc
  File "mypy/semanal_main.py", line 88, in semantic_analysis_for_scc
  File "mypy/semanal_main.py", line 414, in apply_class_plugin_hooks
  File "mypy/semanal_main.py", line 434, in apply_hooks_to_class
  File "mypy/plugins/attrs.py", line 309, in attr_class_maker_callback
  File "mypy/plugins/attrs.py", line 372, in _analyze_class
  File "mypy/plugins/attrs.py", line 498, in _attributes_from_assignment
  File "mypy/plugins/attrs.py", line 594, in _attribute_from_attrib_maker
  File "mypy/semanal.py", line 5450, in anal_type
  File "mypy/types.py", line 765, in accept
  File "mypy/typeanal.py", line 172, in visit_unbound_type
  File "mypy/typeanal.py", line 263, in visit_unbound_type_nonoptional
  File "mypy/typeanal.py", line 1168, in anal_array
  File "mypy/typeanal.py", line 1177, in anal_type
  File "mypy/types.py", line 765, in accept
  File "mypy/typeanal.py", line 172, in visit_unbound_type
  File "mypy/typeanal.py", line 180, in visit_unbound_type_nonoptional
  File "mypy/semanal.py", line 4563, in lookup_qualified
  File "mypy/semanal.py", line 4458, in lookup
  File "mypy/semanal.py", line 4508, in is_active_symbol_in_class_body
AssertionError

I tried using the --pdb and --tb flags to get the traceback, or see which part of the library is causing this but was unable to do so.
I tried clearing the mypy cache, which didn't help as well.

Is this an issue with mypy, the library or both?

Your Environment

  • Mypy version used: 0.960
  • Python version used: 3.10
  • Operating system and version: Ubuntu 22.04

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions