KEMBAR78
Error analyzing spacy · Issue #10542 · python/mypy · GitHub
Skip to content

Error analyzing spacy #10542

@ZeeD

Description

@ZeeD

Bug Report

mypy hangs and (after a long time) report an error trying to analyze code using spacy

To Reproduce

I'm using latest versions of spacy and mypy. Analyzing in strict mode raise an AssertionError inside mypy

> type foo.py
from spacy import load
> type mypy.ini
[mypy]
strict = True
> mypy foo.py
Traceback (most recent call last):
  File "c:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\vito.detullio\Desktop\DELME\venv\Scripts\mypy.exe\__main__.py", line 7, in <module>
  File "c:\users\vito.detullio\desktop\delme\venv\lib\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 2962, in process_graph
  File "mypy\build.py", line 3079, in process_stale_scc
  File "mypy\build.py", line 2251, in write_cache
  File "mypy\build.py", line 1461, in write_cache
  File "mypy\nodes.py", line 313, in serialize
  File "mypy\nodes.py", line 3140, in serialize
  File "mypy\nodes.py", line 3076, in serialize
AssertionError

I'm on windows 10 (20H2), using python and this is my setup:

> python --version
Python 3.9.1
> python -mpip freeze
blis==0.7.4
catalogue==2.0.4
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
cymem==2.0.5
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
idna==2.10
Jinja2==3.0.1
MarkupSafe==2.0.1
murmurhash==1.0.5
mypy==0.812
mypy-extensions==0.4.3
numpy==1.20.3
packaging==20.9
pathy==0.5.2
preshed==3.0.5
pydantic==1.7.4
pyparsing==2.4.7
requests==2.25.1
smart-open==3.0.0
spacy==3.0.6
spacy-legacy==3.0.5
srsly==2.4.1
thinc==8.0.3
tqdm==4.61.0
typed-ast==1.4.3
typer==0.3.2
typing-extensions==3.10.0.0
urllib3==1.26.5
wasabi==0.8.2

mypy foo.py should return "Success: no issues found in 1 source file" as espected from the content of the file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions