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

I tried running azdev style <YOUR_EXT> in a codespace, but it crashes. #6794

Open
jessehouwing opened this issue Sep 21, 2023 · 4 comments · May be fixed by #6850
Open

I tried running azdev style <YOUR_EXT> in a codespace, but it crashes. #6794

jessehouwing opened this issue Sep 21, 2023 · 4 comments · May be fixed by #6850
Assignees
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@jessehouwing
Copy link

I tried running azdev style <YOUR_EXT> in the codespace, but it crashes.

@jessehouwing ➜ /workspaces/azure-cli-extensions (patch-1) $ azdev style init
Traceback (most recent call last):
  File "/home/codespace/.python/current/bin/azdev", line 8, in <module>
    sys.exit(main())
  File "/usr/local/python/3.10.8/lib/python3.10/site-packages/azdev/__main__.py", line 39, in main
    config_dir=get_azdev_config_dir())
  File "/usr/local/python/3.10.8/lib/python3.10/site-packages/azdev/utilities/config.py", line 24, in get_azdev_config_dir
    _, env_name = os.path.splitdrive(get_env_path())
  File "/usr/local/python/3.10.8/lib/python3.10/posixpath.py", line 134, in splitdrive
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

had to run pip install azdev, it would be nice if the default codespace config for this repo included azdev by default.

Originally posted by @jessehouwing in #6793 (comment)

@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Sep 21, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Sep 21, 2023

Thank you for opening this issue, we will look into it.

@jessehouwing
Copy link
Author

I tried reproducing the steps to sucessfully built the repo, but failed. I got beyond this error by this specific error, but now it can't find azure-cli. I'd love a devcontainer.json that will be able to build the extensions inside this repo upon launch.

@yonzhan yonzhan added this to the Backlog milestone Sep 21, 2023
@yonzhan yonzhan added the Azure CLI Team The command of the issue is owned by Azure CLI team label Sep 21, 2023
@jessehouwing
Copy link
Author

Ok, I got a bit further, but still encounter all kind sof strange errors left and right.

what I did so far, and this should really be part of the devcontainer.json

cd /workspaces
git clone https://github.com/Azure/azure-cli.git azure-cli
python3 -m venv env
source env/bin/activate
python -m pip install -U pip
pip install azdev
azdev setup --cli ./azure-cli --repo ./azure-cli-extensions

and then to scan my changes to the init extension:

azdev extension add init
azdev style init

************* Module /workspaces/azure-cli-extensions/pylintrc
azure-cli-extensions/pylintrc:1:0: E0015: Unrecognized option found: module-name-hint, const-name-hint, class-name-hint, class-attribute-name-hint, attr-name-hint, method-name-hint, function-name-hint, argument-name-hint, variable-name-hint, inlinevar-name-hint (unrecognized-option)
************* Module azext_init
azure-cli-extensions/src/init/azext_init/__init__.py:17:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
************* Module azext_init._utils
azure-cli-extensions/src/init/azext_init/_utils.py:37:43: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/_utils.py:72:49: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/_utils.py:74:49: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
************* Module azext_init.custom
azure-cli-extensions/src/init/azext_init/custom.py:57:43: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:59:71: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:76:43: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:79:71: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:115:42: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:116:42: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:133:54: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:182:42: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
azure-cli-extensions/src/init/azext_init/custom.py:189:27: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)

------------------------------------------------------------------
Your code has been rated at 9.42/10 (previous run: 9.42/10, +0.00)


Pylint: FAILED

Running flake8 on extensions...
Traceback (most recent call last):
  File "/home/codespace/.python/current/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/codespace/.python/current/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/__main__.py", line 7, in <module>
    raise SystemExit(main())
  File "/workspaces/env/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/options/parse_args.py", line 53, in parse_args
    opts = aggregator.aggregate_options(option_manager, cfg, cfg_dir, rest)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/options/aggregator.py", line 30, in aggregate_options
    parsed_config = config.parse_config(manager, cfg, cfg_dir)
  File "/workspaces/env/lib/python3.10/site-packages/flake8/options/config.py", line 131, in parse_config
    raise ValueError(
ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'

Flake8: FAILED

@wangzelin007 wangzelin007 linked a pull request Oct 10, 2023 that will close this issue
3 tasks
@wangzelin007
Copy link
Member

Hi @jessehouwing
Sorry for replying so late.
I have been so busy recently that I just took the time to look into this issue today.
Next I will delve into codespace and plan to add support for the Azure CLI repository and the Azure CLI extension repository.

@jessehouwing jessehouwing linked a pull request Nov 2, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants