python / python/mypy

Stubgen fails with timeout for locust

Offen
#9,103 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

topic-stubgen
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Hi,
I'm trying to generate type stubs for Locust and stubgen fails with a timeout (see details below).
I was wondering if someone has any insight into what causes this or how to fix it.

Please provide more information to help us understand the issue:

  • Are you reporting a bug, or opening a feature request?
    Bug

  • 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.

    pip install mypy locust
    stubgen -p locust
    
  • What is the actual behavior/output?

    Traceback (most recent call last):
    File "./venv/bin/stubgen", line 10, in <module>
        sys.exit(main())
    File "mypy/stubgen.py", line 1564, in main
    File "mypy/stubgen.py", line 1422, in generate_stubs
    File "mypy/stubgen.py", line 1183, in collect_build_targets
    File "mypy/stubgen.py", line 1217, in find_module_paths_using_imports
    File "mypy/stubutil.py", line 62, in walk_packages
    File "mypy/moduleinspect.py", line 137, in get_package_properties
    File "mypy/moduleinspect.py", line 163, in _get_from_queue
    RuntimeError: Timeout waiting for subprocess
    
  • What is the behavior/output you expect?
    No console output and generated stubs in out/.

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

    • Python v3.8.2
    • mypy 0.782
  • Do you see the same issue after installing mypy from Git master?
    Yes:

    Traceback (most recent call last):
    File "./venv/bin/stubgen", line 33, in <module>
        sys.exit(load_entry_point('mypy', 'console_scripts', 'stubgen')())
    File "/Users/simon/work/locust-test/mypy/mypy/stubgen.py", line 1564, in main
        generate_stubs(options)
    File "/Users/simon/work/locust-test/mypy/mypy/stubgen.py", line 1422, in generate_stubs
        py_modules, c_modules = collect_build_targets(options, mypy_opts)
    File "/Users/simon/work/locust-test/mypy/mypy/stubgen.py", line 1183, in collect_build_targets
        py_modules, c_modules = find_module_paths_using_imports(options.modules,
    File "/Users/simon/work/locust-test/mypy/mypy/stubgen.py", line 1217, in find_module_paths_using_imports
        found = list(walk_packages(inspect, packages, verbose))
    File "/Users/simon/work/locust-test/mypy/mypy/stubutil.py", line 62, in walk_packages
        prop = inspect.get_package_properties(package_name)
    File "/Users/simon/work/locust-test/mypy/mypy/moduleinspect.py", line 137, in get_package_properties
        res = self._get_from_queue()
    File "/Users/simon/work/locust-test/mypy/mypy/moduleinspect.py", line 163, in _get_from_queue
        raise RuntimeError('Timeout waiting for subprocess')
    RuntimeError: Timeout waiting for subprocess
    

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem mit stubgen -p locust, nachdem du mypy und locust installiert hast. Beginne in mypy/stubgen.py bei collect_build_targets und find_module_paths_using_imports und verfolge dann die Aufrufe durch mypy/stubutil.py und mypy/moduleinspect.py bis zum Timeout des Subprozesses. Fertig ist es, wenn der Befehl ohne das Timeout abgeschlossen wird und Stubs in out/ erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.