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

Workaround mypy AssertionError #1959

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

hexagonrecursion
Copy link
Contributor

sometimes mypy was failing with:

AssertionError: Cannot find component '_Result@144' for 'tests.util.test_pep517._Result@144'

This is due to a bug: python/mypy#7281
I have applied the workaround suggested in the above issue

Full traceback

type run-test: commands[1] | mypy tests
Traceback (most recent call last):
  File "/home/user/tox/.tox/type/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File "/home/user/tox/.tox/type/lib/python3.9/site-packages/mypy/__main__.py", line 11, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "mypy/main.py", line 90, in main
  File "mypy/build.py", line 179, in build
  File "mypy/build.py", line 253, in _build
  File "mypy/build.py", line 2638, in dispatch
  File "mypy/build.py", line 2955, in process_graph
  File "mypy/build.py", line 3033, in process_fresh_modules
  File "mypy/build.py", line 1977, in fix_cross_refs
  File "mypy/fixup.py", line 26, in fixup_module
  File "mypy/fixup.py", line 77, in visit_symbol_table
  File "mypy/fixup.py", line 301, in lookup_qualified_stnode
  File "mypy/lookup.py", line 47, in lookup_fully_qualified
AssertionError: Cannot find component '_Result@144' for 'tests.util.test_pep517._Result@144'
ERROR: InvocationError for command /home/user/tox/.tox/type/bin/mypy tests (exited with code 1)

Contribution checklist:

(also see CONTRIBUTING.rst for details)

  • wrote descriptive pull request text
  • added yourself to CONTRIBUTORS (preserving alphabetical order)

sometimes mypy was failing with:
```
AssertionError: Cannot find component '_Result@144' for 'tests.util.test_pep517._Result@144'
```
This is due to a bug: python/mypy#7281
I have applied the workaround suggested in the above issue

Full traceback
```
type run-test: commands[1] | mypy tests
Traceback (most recent call last):
  File "/home/user/tox/.tox/type/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File "/home/user/tox/.tox/type/lib/python3.9/site-packages/mypy/__main__.py", line 11, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "mypy/main.py", line 90, in main
  File "mypy/build.py", line 179, in build
  File "mypy/build.py", line 253, in _build
  File "mypy/build.py", line 2638, in dispatch
  File "mypy/build.py", line 2955, in process_graph
  File "mypy/build.py", line 3033, in process_fresh_modules
  File "mypy/build.py", line 1977, in fix_cross_refs
  File "mypy/fixup.py", line 26, in fixup_module
  File "mypy/fixup.py", line 77, in visit_symbol_table
  File "mypy/fixup.py", line 301, in lookup_qualified_stnode
  File "mypy/lookup.py", line 47, in lookup_fully_qualified
AssertionError: Cannot find component '_Result@144' for 'tests.util.test_pep517._Result@144'
ERROR: InvocationError for command /home/user/tox/.tox/type/bin/mypy tests (exited with code 1)
```
@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #1959 (6345336) into rewrite (651e1ae) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           rewrite    #1959   +/-   ##
========================================
  Coverage    99.82%   99.82%           
========================================
  Files          143      143           
  Lines         7839     7839           
  Branches       789      789           
========================================
  Hits          7825     7825           
  Misses           3        3           
  Partials        11       11           
Flag Coverage Δ
tests 99.82% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tests/util/test_pep517.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 651e1ae...6345336. Read the comment docs.

@hexagonrecursion
Copy link
Contributor Author

hexagonrecursion commented Mar 4, 2021

This is blocking me from submitting the following PR: 308a4a7...540abae

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat gaborbernat merged commit 308a4a7 into tox-dev:rewrite Mar 4, 2021
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

Successfully merging this pull request may close these issues.

2 participants