Merge branch 'fix/idf_py_missing_component_man' into 'master'

Tools: Detect missing component manager and print proper error message

See merge request espressif/esp-idf!19435
This commit is contained in:
Roland Dobai 2022-08-12 16:58:54 +08:00
commit c896a62e28

View File

@ -39,6 +39,8 @@ try:
from idf_py_actions.errors import FatalError # noqa: E402
from idf_py_actions.tools import (PropertyDict, executable_exists, get_target, idf_version, # noqa: E402
merge_action_lists, realpath)
if os.getenv('IDF_COMPONENT_MANAGER') != '0':
from idf_component_manager import idf_extensions
except ImportError:
# For example, importing click could cause this.
print('Please use idf.py only in an ESP-IDF shell environment.', file=sys.stderr)
@ -672,7 +674,6 @@ def init_cli(verbose_output: List=None) -> Any:
# Load component manager idf.py extensions if not explicitly disabled
if os.getenv('IDF_COMPONENT_MANAGER') != '0':
from idf_component_manager import idf_extensions
extensions.append(('component_manager_ext', idf_extensions))
# Optional load `pyclang` for additional clang-tidy related functionalities