Skip to content

MyPy 0.750 slow startup (or hang) on macOS #8055

Open
@nickwilliams-eventbrite

Description

@nickwilliams-eventbrite
  • Are you reporting a bug, or opening a feature request?
    Bug report

  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.
    This is not applicable to this bug report.

  • What is the actual behavior/output?
    Running the mypy . command hangs forever after upgrading to MyPy 0.750 on macOS. Even trying mypy --version to verify the installed version hangs forever. Both commands have to be killed with Ctrl+C (pressing that multiple times is required, actually) after several minutes of waiting for output. Also tried uninstalling and re-installing MyPy from scratch with no luck. Only downgrading to 0.740 solves it from hanging forever, but now mypy --version takes about 45 seconds instead of < 1 second like it was before upgrading and downgrading, even though it outputs 0.740. Here is example output of killing mypy --version under 0.750 after several minutes:

    $ mypy --version
    ^C^C^C^C^C^C^C^C^CTraceback (most recent call last):
      File "/Users/nwilliams/.virtualenvs/pysoa3/bin/mypy", line 6, in <module>
        from mypy.__main__ import console_entry
      File "/Users/nwilliams/.virtualenvs/pysoa3/lib/python3.7/site-packages/mypy/__main__.py", line 4, in <module>
        from mypy.main import main
      File "mypy/main.py", line 13, in <module>
      File "mypy/build.py", line 33, in <module>
      File "mypy/semanal.py", line 95, in <module>
      File "mypy/typeanal.py", line 30, in <module>
      File "<frozen importlib._bootstrap>", line 978, in _find_and_load
    KeyboardInterrupt
    
  • What is the behavior/output you expect?
    For mypy . to run in generally the same amount of time it took previously (~10-15 seconds) and for mypy --version to output and exit instantly, instead of hanging forever like they now do.

  • What are the versions of mypy and Python you are using?

    $ python --version
    Python 3.7.4
    $ cat ~/.virtualenvs/pysoa3/lib/python3.7/site-packages/mypy/version.py 
    __version__ = "0.750"
    

    The Python version was installed from Homebrew.
    Do you see the same issue after installing mypy from Git master?
    If I pip install git+https://github.com/python/[email protected], mypy . works. That's the same version (0.750), just installed from Git instead of PyPi. So this appears to be an issue with the PyPi wheel.

  • What are the mypy flags you are using? (For example --strict-optional)

    [mypy]
    python_version = 3.7
    check_untyped_defs = True
    [mypy-tasks]
    ignore_errors = True
    [mypy-(several projects listed here).*]
    ignore_missing_imports = True
    ...
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions