stubgen timeout on building docs on MacOS
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
stubgen timeout on building docs on MacOS
python -m mypy.stubgen -m mypackage -o ./stubs --include-docstrings
The stubgen tool always reports a timeout waiting for queued package properties. The timeout happens in the following code block:
-> moduleinspect.py
(155) def _get_from_queue(self) -> ModuleProperties | str | None:
It seems the subprocess never queues package properties.
To Reproduce
This error occurs on MacOS only.
python -m mypy.stubgen -m mypackage -o ./stubs --include-docstrings
Expected Behavior
It should work as smooth as on Windows and Linux, outputting the stub file without further issues.
Actual Behavior
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/stubgen.py", line 2077, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/stubgen.py", line 2073, in main
generate_stubs(options)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/stubgen.py", line 1883, in generate_stubs
py_modules, c_modules = collect_build_targets(options, mypy_opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/stubgen.py", line 1626, in collect_build_targets
py_modules, c_modules = find_module_paths_using_imports(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/stubgen.py", line 1660, in find_module_paths_using_imports
result = find_module_path_and_all_py3(inspect, mod, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/stubutil.py", line 83, in find_module_path_and_all_py3
mod = inspect.get_package_properties(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/moduleinspect.py", line 138, in get_package_properties
res = self._get_from_queue()
^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mypy/moduleinspect.py", line 164, in _get_from_queue
raise RuntimeError("Timeout waiting for subprocess")
RuntimeError: Timeout waiting for subprocess
Error: Process completed with exit code 1.
Your Environment
- Mypy version used: 1.7.0+dev
- Mypy command-line flags: --include-docstrings -p myextmodule
- Mypy configuration options from mypy.ini (and other config files):
- Python version used: cp3.11
- Platform: MacOS
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con mypy/moduleinspect.py, especialmente con ModuleInspect._get_from_queue(), y reproduce el fallo con el comando stubgen proporcionado en macOS. Compara el comportamiento de subprocess y queue con Windows o Linux y, después, verifica que el comando termina y escribe los stubs esperados sin timeout.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- cli, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100