Linter fails with OSError if multiple repos are used
Version
(azdev-env) frp $ azdev --version
0.1.28
Python (Darwin) 3.8.5 (default, Aug 25 2020, 13:30:25)
[Clang 11.0.3 (clang-1103.0.32.62)]
Configuration
[ext]
repo_paths = <path>/frp/az-cli/.azdev/azure-cli-extensions,<path>/frp
[cli]
repo_path = _NONE_
Command
azdev linter livedata
Error
Running pylint on extensions...
Traceback (most recent call last):
File "<home>/.pyenv/versions/3.8.5/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "<home>.pyenv/versions/3.8.5/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "<path>/frp/az-cli/.azdev/azdev-env/lib/python3.8/site-packages/pylint/__main__.py", line 8, in <module>
pylint.run_pylint()
File "<path>/frp/az-cli/.azdev/azdev-env/lib/python3.8/site-packages/pylint/__init__.py", line 20, in run_pylint
Run(sys.argv[1:])
File "<path>/frp/az-cli/.azdev/azdev-env/lib/python3.8/site-packages/pylint/lint.py", line 1573, in __init__
linter.read_config_file(verbose=self.verbose)
File "<path>/frp/az-cli/.azdev/azdev-env/lib/python3.8/site-packages/pylint/config.py", line 721, in read_config_file
raise IOError("The config file {:s} doesn't exist!".format(config_file))
OSError: The config file <path>/frp/az-cli/.azdev/azure-cli-extensions,<path>/frp/pylintrc doesn't exist!
I think the issue is that https://github.com/Azure/azure-cli-dev-tools/blob/87605f5d941e0a17e5adccc3f373463fffa4857c/azdev/operations/style.py#L204 splits the repo_paths on whitespace instead of a comma
@haroldrandom I can start to pick up communication for this ticket, as @TimMullender has left our team.
He kindly forwarded on your message to me regarding the azdev version that we are using.
The issue is present in:
azdev --version 0.1.28
We are able to work around it by using:
azdev --version 0.1.21
@TimMullender Thank you for your feedback. Can you give us a more of a description the scenario here?
I noticed that: repo_path = NONE
Did you run "azdev setup" without specifying a CLI? Did you run azdev setup with the version 0.1.28 or a earlier version?
What is the use case for having multiple extension repos? It seems you want to run the linter all both repos. Are you developing on two separate extensions repos?
Thanks!
@bquantump, we setup a script to automate this this on an older version (pre 0.1.28) where we run both:
azdev setup -r "${EXTENSIONS_DIR}"(where EXTENSIONS_DIR is a clone of https://github.com/Azure/azure-cli-extensions.git)- and then later
azdev extension repo add "${OUR_EXTENSION_REPO}"
We only have the one repository which we are developing against and wish to run linter on. However, the adzev setup -r option followed by repo add results in 2 repos being configured.
Has the setup changed in this version (0.1.28)?
I'm starting to suspect that there's been a misunderstanding on our side regarding how the adzev is meant to be setup.
We have a line in our manual steps docs that reads:
Path (RETURN to use current directory): Path/To/Your/azure-cli-extensions/Repo
This has been interpreted to mean https://github.com/Azure/azure-cli-extensions.git, but I am thinking now that we do not need this at all.
I ran our automated setup again and modified the command to be: azdev setup -r "${OUR_REPO}" -e livedata, which now appears to work correctly.
@dafunker I noticed that master as of now is also version 0.1.28, are you using master or are you using the official release of 0.1.28 from August 25th?
We missed bumping the version in master after the release with new commits. These new commits after the August 25th won't be backward compatible with previous versions.
So, multiple extensions repos per virtual environment is not yet supported in that version for example (which is 0.1.29 beta).
Also this new version will allow multiple CLI version to run inside separate virtual environments.
That is, env1 can have a version of the cli and extensions different from env2's cli version and extensions.
This required the azdev setup to change, and hence if you are using code after the release on August 25th, which is in master, then the setup must be completely re-run with only one or zero extensions repo specified or added later.
I'm starting to suspect that there's been a misunderstanding on our side regarding how the adzev is meant to be setup.
We have a line in our manual steps docs that reads:
Path (RETURN to use current directory): Path/To/Your/azure-cli-extensions/RepoThis has been interpreted to mean https://github.com/Azure/azure-cli-extensions.git, but I am thinking now that we do not need this at all.
I ran our automated setup again and modified the command to be:
azdev setup -r "${OUR_REPO}" -e livedata, which now appears to work correctly.
Yes, -r should be pointing to a local extensions repo on the file system.
@bquantump, please feel free to go ahead and close this ticket as not a bug. We've changed our setup steps to use -r correctly, so this is no longer an issue.