azure-cli-dev-tools icon indicating copy to clipboard operation
azure-cli-dev-tools copied to clipboard

flake8 and pylint are pinned to old versions

Open ghost opened this issue 5 years ago • 3 comments

I'm noticing that flake8 and pylint are pinned to old versions.

pip install -e "git+https://github.com/Azure/azure-cli@dev#egg=azure-cli-dev-tools&subdirectory=tools"
...
Collecting flake8==3.5.0
...
Collecting pylint==2.0.0
...

Is there a reason for this?

Could we update these versions?

ghost avatar May 28 '20 21:05 ghost

Pinning versions of ubiquitous libraries like the flake8 and pylint linters majorly constrain the environment in which azdev is used in. This is particularly inefficient on the inner dev loop when trying to run azdev cli-lint, as we have to downgrade flake8 and pylint to the pinned azdev versions and then update the linters when we run our own projects linter checks & validation.

digimaun avatar May 28 '20 22:05 digimaun

Upgrade flake8 and pylint would also have to fix the upcoming issues from CI of Azure CLI. Azure CLI CI is using azdev.

What blocks you without upgrade those two?

haroldrandom avatar Jun 03 '20 10:06 haroldrandom

Thanks. Understood on the problem on the Azure CLI CI side.

It's not so much a blocking issue as we have ways around it (explained in my prior comment). It's an issue on the developer experience/inner dev loop making it non-optimal.

A concrete example is on the CLI extension side when the CLI extension is outside the code base of Azure CLI - which is a primary CLI model for some Azure services like IoT.

As its a separate repo owned and maintained by Azure IoT, we are able to make tooling and dependency decisions independently (in the bounds of the Azure CLI environment). This means we should be able to use the linters, and rules for those linters that are appropriate for our team. Which may include rules or configuration of newer linter versions that azdev does not support.

By pinning the linter versions of azdev , using azdev effectively constrains the linter versions of the environment, uninstalling the latest flake8 and pylint in favor of older versions.

So in order to use some of the great validation in azdev (like cli-lint) locally, for inner-dev loop validation, we have to dance around the linter packages. Downgrade for azdev validation, upgrade for normal development.

One idea/brainstorm to resolve this issue - azdev could include the pinned flake8, pylint in an extras_require way. So Azure CLI could 'opt-in' to install the pinned versions which mitigates the CI issue mentioned. For use cases like for ours we would grab the package variant which doesn't include pinned flake8/pylint.

digimaun avatar Jun 03 '20 18:06 digimaun