mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
check_python_dependencies: If overriding requirements.txt path, provide a pip command line
Advice about install.sh/install.bat, etc only works for the default requirements.txt
This commit is contained in:
parent
d03af45731
commit
c7209b110e
@ -39,10 +39,12 @@ def escape_backslash(path):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
idf_path = os.getenv("IDF_PATH")
|
idf_path = os.getenv("IDF_PATH")
|
||||||
|
|
||||||
|
default_requirements_path = os.path.join(idf_path, 'requirements.txt')
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='ESP32 Python package dependency checker')
|
parser = argparse.ArgumentParser(description='ESP32 Python package dependency checker')
|
||||||
parser.add_argument('--requirements', '-r',
|
parser.add_argument('--requirements', '-r',
|
||||||
help='Path to the requrements file',
|
help='Path to the requrements file',
|
||||||
default=os.path.join(idf_path, 'requirements.txt'))
|
default=default_requirements_path)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
not_satisfied = []
|
not_satisfied = []
|
||||||
@ -64,7 +66,10 @@ if __name__ == "__main__":
|
|||||||
print('The following Python requirements are not satisfied:')
|
print('The following Python requirements are not satisfied:')
|
||||||
for requirement in not_satisfied:
|
for requirement in not_satisfied:
|
||||||
print(requirement)
|
print(requirement)
|
||||||
if os.environ.get('IDF_PYTHON_ENV_PATH'):
|
if os.path.realpath(args.requirements) != os.path.realpath(default_requirements_path):
|
||||||
|
# we're using this script to check non-default requirements.txt, so tell the user to run pip
|
||||||
|
print('Please check the documentation for the feature you are using, or run "%s -m pip install -r %s"' % (sys.executable, args.requirements))
|
||||||
|
elif os.environ.get('IDF_PYTHON_ENV_PATH'):
|
||||||
# We are running inside a private virtual environment under IDF_TOOLS_PATH,
|
# We are running inside a private virtual environment under IDF_TOOLS_PATH,
|
||||||
# ask the user to run install.bat again.
|
# ask the user to run install.bat again.
|
||||||
if sys.platform == "win32" and not os.environ.get("MSYSTEM"):
|
if sys.platform == "win32" and not os.environ.get("MSYSTEM"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user