Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK Automation] Python script fails with 'ModuleNotFoundError' when generate the SDK #7957

Closed
Tracked by #8039
raych1 opened this issue Mar 27, 2024 · 1 comment
Closed
Tracked by #8039
Assignees

Comments

@raych1
Copy link
Member

raych1 commented Mar 27, 2024

Two issues identified for this spec PR:

  • Node 18 has been installed in the spec PR pipeline and each SDK language automation script should not need to re-install it.
    The following is the pipeline log:
01:20:23.663 command 	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
01:20:23.663 info 	Config: {"stderr":{"showInComment":true},"stdout":{"showInComment":"^\\[Autorest\\]"},"envs":[],"exitCode":{"showInComment":true,"result":"error"}}
01:20:33.792 cmdout 	[automation_generate.sh] changed 1 package in 3s
01:20:33.793 cmderr 	[automation_generate.sh]  
01:20:33.793 cmderr 	[automation_generate.sh] npm notice New minor version of npm available! 10.2.4 -> 10.5.0
01:20:33.793 cmderr 	[automation_generate.sh] npm notice Changelog: <[https://github.com/npm/cli/releases/tag/v10.5.0>](https://github.com/npm/cli/releases/tag/v10.5.0%3E)
01:20:33.793 cmderr 	[automation_generate.sh] npm notice Run `npm install -g npm@10.5.0` to update!
01:20:33.794 cmderr 	[automation_generate.sh] npm notice 
01:20:33.850 cmdout 	[automation_generate.sh]   installing : node-v18.19.0
01:20:33.895 cmdout 	[automation_generate.sh]        mkdir : /usr/local/n/versions/node/18.19.0
01:20:33.897 cmdout 	[automation_generate.sh]        fetch : https://nodejs.org/dist/v18.19.0/node-v18.19.0-linux-x64.tar.xz
01:20:35.552 cmdout 	[automation_generate.sh]      copying : node/18.19.0
01:20:37.155 cmdout 	[automation_generate.sh]    installed : v18.19.0 (with npm 10.2.3)
  • it fails to generated SDK due to ModuleNotFoundError for github module.
01:20:37.263 cmdout 	[automation_generate.sh] Traceback (most recent call last):
01:20:37.263 cmdout 	[automation_generate.sh]   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/runpy.py", line 196, in _run_module_as_main
01:20:37.279 cmdout 	[automation_generate.sh]     return _run_code(code, main_globals, None,
01:20:37.279 cmdout 	[automation_generate.sh]   File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/runpy.py", line 86, in _run_code
01:20:37.279 cmdout 	[automation_generate.sh]     exec(code, run_globals)
01:20:37.280 cmdout 	[automation_generate.sh]   File "/mnt/vss/_work/1/s/azure-sdk-for-python/tools/azure-sdk-tools/packaging_tools/sdk_generator.py", line 18, in <module>
01:20:37.280 cmdout 	[automation_generate.sh]     from .swaggertosdk.SwaggerToSdkCore import (
01:20:37.280 cmdout 	[automation_generate.sh]   File "/mnt/vss/_work/1/s/azure-sdk-for-python/tools/azure-sdk-tools/packaging_tools/swaggertosdk/SwaggerToSdkCore.py", line 18, in <module>
01:20:37.280 cmdout 	[automation_generate.sh]     from ci_tools.github_tools import get_files, GithubLink
01:20:37.280 cmdout 	[automation_generate.sh]   File "/mnt/vss/_work/1/s/azure-sdk-for-python/tools/azure-sdk-tools/ci_tools/github_tools.py", line 13, in <module>
01:20:37.280 cmdout 	[automation_generate.sh]     from github import Github, GithubException
01:20:37.280 cmdout 	[automation_generate.sh] ModuleNotFoundError: No module named 'github'
01:20:37.292 cmdout 	[automation_generate.sh] [Generate] codegen done!!!
01:20:37.292 cmdout 	[automation_generate.sh] [Autorest]/mnt/vss/_work/1/s/azure-sdk-for-python_tmp/venv-sdk/auto_temp.json does not exist!!!Error happened during codegen
01:20:37.293 error C 	Script return with result [failed] code [1] signal [null] cwd [azure-sdk-for-python]: sh scripts/automation_generate.sh
01:20:37.293 endsection 	Call generateScript

CC: @msyyc

@msyyc
Copy link
Member

msyyc commented Mar 28, 2024

It is fixed by Azure/azure-sdk-for-python#34967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants