Description
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
Activity
lmbelo commentedon Sep 26, 2023
It seems dylib is not supported.