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

[Interactive] Compatible with argcomplete 2.0.0 #5669

Merged
merged 6 commits into from
Dec 29, 2022

Conversation

bebound
Copy link
Contributor

@bebound bebound commented Dec 28, 2022


In Azure/azure-cli#24903, argcomplete update to 2.0.0. When run az interactive, this error raises:

❯ az interactive
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:
No module named 'argcomplete.compat'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/interactive/custom.py", line 41, in start_shell
    azext_interactive.start_shell(cmd, style=style)
  File "/root/.azure/cliextensions/interactive/azext_interactive/__init__.py", line 10, in start_shell
    from .azclishell.app import AzInteractiveShell
  File "/root/.azure/cliextensions/interactive/azext_interactive/azclishell/app.py", line 38, in <module>
    from .az_completer import AzCompleter
  File "/root/.azure/cliextensions/interactive/azext_interactive/azclishell/az_completer.py", line 19, in <module>
    from .argfinder import ArgsFinder
  File "/root/.azure/cliextensions/interactive/azext_interactive/azclishell/argfinder.py", line 9, in <module>
    from argcomplete.compat import USING_PYTHON2, ensure_bytes
ModuleNotFoundError: No module named 'argcomplete.compat'

As argcomplete.compat is removed, I copy its content to compat.py.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify src/index.json.

@bebound bebound requested a review from jiasli as a code owner December 28, 2022 06:30
@bebound bebound changed the title [interactive] Compatible with argcomplete 2.0.0 [Interactive] Compatible with argcomplete 2.0.0 Dec 28, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 28, 2022

Interactive fix

@yonzhan yonzhan requested a review from kairu-ms December 28, 2022 07:47
@yonzhan yonzhan added this to the Dec 2022 (2023-01-10) milestone Dec 28, 2022
@kairu-ms
Copy link
Contributor

kairu-ms commented Dec 29, 2022

Can this change compatible with previous version?
If not, please update min cli core version as well

@bebound
Copy link
Contributor Author

bebound commented Dec 29, 2022

It's compatible with previous version.

@bebound bebound merged commit 3cb9678 into Azure:main Dec 29, 2022
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ interactive ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=22779&view=results

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

Successfully merging this pull request may close these issues.

4 participants