Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azdev/operations/extensions/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_whl_from_url(url, filename, tmp_dir, whl_cache=None):
if url in whl_cache:
return whl_cache[url]
import requests
r = requests.get(url, stream=True)
r = requests.get(url, stream=True) # pylint: disable=missing-timeout
try:
assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code)
except AssertionError:
Expand Down
2 changes: 1 addition & 1 deletion azdev/operations/help/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def _get_whl_from_url(url, filename, tmp_dir, whl_cache=None):
if url in whl_cache:
return whl_cache[url]
import requests
r = requests.get(url, stream=True)
r = requests.get(url, stream=True) # pylint: disable=missing-timeout
assert r.status_code == 200, "Request to {} failed with {}".format(url, r.status_code)
ext_file = os.path.join(tmp_dir, filename)
with open(ext_file, 'wb') as f:
Expand Down
14 changes: 7 additions & 7 deletions azdev/operations/help/refdoc/common/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def handle_signature(self, sig, signode):
signode += addnodes.desc_addname(sig, sig)
return sig

def needs_arglist(self): # pylint: disable=no-self-use
def needs_arglist(self):
return False

def add_target_and_index(self, name, sig, signode):
signode['ids'].append(name)

def get_index_text(self, modname, name): # pylint: disable=unused-argument, no-self-use
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it raises azdev/operations/help/refdoc/common/directives.py:46:0: R0022: Useless option value for 'disable', 'no-self-use' was moved to an optional extension, see https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers. (useless-option-value)

def get_index_text(self, modname, name): # pylint: disable=unused-argument
return name


Expand All @@ -53,7 +53,7 @@ class CliGroupDirective(CliBaseDirective):
Field('docsource', label='Doc Source', has_arg=False,
names=('docsource', 'documentsource')),
Field('deprecated', label='Deprecated', has_arg=False,
names=('deprecated'))
names=('deprecated',))
Copy link
Contributor Author

@bebound bebound Feb 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

])


Expand All @@ -63,23 +63,23 @@ class CliCommandDirective(CliBaseDirective):
Field('docsource', label='Doc Source', has_arg=False,
names=('docsource', 'documentsource')),
Field('deprecated', label='Deprecated', has_arg=False,
names=('deprecated'))
names=('deprecated',))
])


class CliArgumentDirective(CliBaseDirective):
doc_field_types = copy.copy(_CLI_FIELD_TYPES)
doc_field_types.extend([
Field('required', label='Required', has_arg=False,
names=('required')),
names=('required',)),
Field('values', label='Allowed values', has_arg=False,
names=('values', 'choices', 'options')),
Field('default', label='Default value', has_arg=False,
names=('default')),
names=('default',)),
Field('source', label='Values from', has_arg=False,
names=('source', 'sources')),
Field('deprecated', label='Deprecated', has_arg=False,
names=('deprecated'))
names=('deprecated',))
])


Expand Down
2 changes: 1 addition & 1 deletion azdev/operations/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def _benchmark_cmd_staticstic(time_series: list):
avg_time = sum(time_series) / size

std_deviation = sqrt(
sum([(t - avg_time) * (t - avg_time) for t in time_series]) / size
sum((t - avg_time) * (t - avg_time) for t in time_series) / size
)

return {
Expand Down
2 changes: 1 addition & 1 deletion azdev/operations/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import re
import sys

from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module
from distutils.version import LooseVersion # pylint:disable=import-error,no-name-in-module,deprecated-module
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporally disable this warning.
I will create another PR to fix this like Azure/azure-cli#17667

from docutils import core, io

from knack.log import get_logger
Expand Down
2 changes: 1 addition & 1 deletion azdev/operations/tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_statistic_ok(self):
max_num = round(rands[-1], 4)
min_num = round(rands[0], 4)
avg_num = round(sum(rands) / len(rands), 4)
std_num = round(sqrt(sum([(t - avg_num) ** 2 for t in rands]) / len(rands)), 4)
std_num = round(sqrt(sum((t - avg_num) ** 2 for t in rands) / len(rands)), 4)

stats = _benchmark_cmd_staticstic(rands)

Expand Down
2 changes: 1 addition & 1 deletion azdev/operations/testtool/tests/test_profile_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ def test_unsupported_profile(self):
def test_raise_inner_exception(self):
with self.assertRaises(Exception):
with ProfileContext('latest'):
raise Exception('inner Exception')
raise Exception('inner Exception') # pylint: disable=broad-exception-raised
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'gitpython',
'jinja2',
'knack',
'pylint==2.11.1',
'pylint==2.16.1',
'pytest-xdist', # depends on pytest-forked
'pytest-forked',
'pytest>=5.0.0',
Expand Down