Azure / autorest.az

Azure CLI Code Generator
MIT License
22 stars 20 forks source link

ImportError are passed when it's not caused by manual files not exist #762

Closed fengzhou-msft closed 3 years ago

fengzhou-msft commented 3 years ago

Machine Learning Team is working on a new extension and they did a lot of manual code to use their own SDK. They have some import errors when using their own SDKs, but the current code in custom.py below will just ignore any ImportError and CLI will eventually throw an error like ModuleNotFoundError: No module named 'azure.ml'. This cost them a lot of effort finding the real issue.

It may be a good idea to only pass ImportError for the .manual.custom part.

from .generated.custom import *  # noqa: F403
try:
    from .manual.custom import *  # noqa: F403
except ImportError:
    pass
qiaozha commented 3 years ago

close it as supported in master branch. Please use latest private release to make it work.