tools/check_python_dependencies: print diagnostic info on failure

Helps collect more data for cases such as:
https://github.com/espressif/esp-idf/issues/5133
This commit is contained in:
Ivan Grokhotkov 2020-04-16 11:52:19 +02:00
parent d043674b2b
commit 46e9aef6c9
2 changed files with 11 additions and 2 deletions

View File

@ -79,6 +79,7 @@ function idf_export_main() {
idf_exports=$(${IDF_PATH}/tools/idf_tools.py export) || return 1
eval "${idf_exports}"
echo "Using Python interpreter in $(which python)"
echo "Checking if Python packages are up to date..."
python ${IDF_PATH}/tools/check_python_dependencies.py || return 1

View File

@ -41,9 +41,9 @@ if __name__ == "__main__":
default_requirements_path = os.path.join(idf_path, 'requirements.txt')
parser = argparse.ArgumentParser(description='ESP32 Python package dependency checker')
parser = argparse.ArgumentParser(description='ESP-IDF Python package dependency checker')
parser.add_argument('--requirements', '-r',
help='Path to the requrements file',
help='Path to the requirements file',
default=default_requirements_path)
args = parser.parse_args()
@ -100,6 +100,14 @@ if __name__ == "__main__":
else:
print('Please follow the instructions found in the "Set up the tools" section of '
'ESP-IDF Getting Started Guide')
print('Diagnostic information:')
idf_python_env_path = os.environ.get('IDF_PYTHON_ENV_PATH')
print(' IDF_PYTHON_ENV_PATH: {}'.format(idf_python_env_path or '(not set)'))
print(' Python interpreter used: {}'.format(sys.executable))
if idf_python_env_path not in sys.executable:
print(' Warning: python interpreter not running from IDF_PYTHON_ENV_PATH')
print(' PATH: {}'.format(os.getenv('PATH')))
sys.exit(1)
print('Python requirements from {} are satisfied.'.format(args.requirements))