You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typing_copilot requires that the package being analyzed is installed in the virtualenv from where its command is invoked. However, this requirement is easy to miss, and if missed, will result in a fairly opaque error message (this was generated when analyzing the arviz package, https://github.com/arviz-devs/arviz ):
Traceback (most recent call last):
File ".../arviz/venv/bin/typing_copilot", line 8, in <module>
sys.exit(cli())
File ".../arviz/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File ".../arviz/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File ".../arviz/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File ".../arviz/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File ".../arviz/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/cli.py", line 245, in init
final_config_components = _make_strictest_mypy_config_components_from_errors(strict_errors)
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/cli.py", line 57, in _make_strictest_mypy_config_components_from_errors
first_party_suppressions = get_1st_party_modules_and_suppressions(strict_errors)
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/error_tracker.py", line 251, in get_1st_party_modules_and_suppressions
needed_setting_to_minimum_covering_modules: Dict[MypyErrorSetting, FrozenSet[str]] = {
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/error_tracker.py", line 252, in <dictcomp>
error_setting: _consider_replacing_child_modules_with_parent(
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/error_tracker.py", line 167, in _consider_replacing_child_modules_with_parent
unseen_child_modules_for_parent = {
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/error_tracker.py", line 168, in <dictcomp>
parent_name: _get_child_module_names_for_module(parent_name)
File ".../arviz/venv/lib/python3.8/site-packages/typing_copilot/error_tracker.py", line 135, in _get_child_module_names_for_module
module = importlib.import_module(module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'arviz'
Catch the ModuleNotFoundError error in get_1st_party_modules_and_suppressions and reraise it with a clearer error message that explains the appropriate action to take to resolve it -- simply install into your venv the package you are analyzing.
The text was updated successfully, but these errors were encountered:
typing_copilot
requires that the package being analyzed is installed in the virtualenv from where its command is invoked. However, this requirement is easy to miss, and if missed, will result in a fairly opaque error message (this was generated when analyzing thearviz
package, https://github.com/arviz-devs/arviz ):Catch the
ModuleNotFoundError
error inget_1st_party_modules_and_suppressions
and reraise it with a clearer error message that explains the appropriate action to take to resolve it -- simply install into your venv the package you are analyzing.The text was updated successfully, but these errors were encountered: