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

Linter fails with OSError if multiple repos are used #272

Open
TimMullender opened this issue Nov 18, 2020 · 8 comments · May be fixed by #273
Open

Linter fails with OSError if multiple repos are used #272

TimMullender opened this issue Nov 18, 2020 · 8 comments · May be fixed by #273
Assignees

Comments

@TimMullender
Copy link

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!
@TimMullender
Copy link
Author

I think the issue is that

get_azdev_config().get("ext", "repo_paths").split(),
splits the repo_paths on whitespace instead of a comma

@dafunker
Copy link

@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

@bquantump
Copy link
Member

@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!

@dafunker
Copy link

dafunker commented Dec 16, 2020

@bquantump, we setup a script to automate this this on an older version (pre 0.1.28) where we run both:

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)?

@dafunker
Copy link

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.

@bquantump
Copy link
Member

@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.

@bquantump
Copy link
Member

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.

Yes, -r should be pointing to a local extensions repo on the file system.

@dafunker
Copy link

@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.

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 a pull request may close this issue.

5 participants