-
Notifications
You must be signed in to change notification settings - Fork 115
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
Bump pylint
to 2.8.0
#295
Bump pylint
to 2.8.0
#295
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
[MESSAGES CONTROL] | ||
# For all codes, run 'pylint --list-msgs' or go to 'http://pylint-messages.wikidot.com/all-codes' | ||
disable= | ||
invalid-name, | ||
cyclic-import, | ||
fixme, | ||
import-outside-toplevel, | ||
invalid-name, | ||
missing-docstring, | ||
too-many-arguments, | ||
raise-missing-from, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
too-few-public-methods, | ||
cyclic-import, | ||
useless-object-inheritance, | ||
useless-import-alias, | ||
useless-suppression, | ||
import-outside-toplevel, | ||
wrong-import-order | ||
too-many-arguments, | ||
|
||
[TYPECHECK] | ||
# For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,9 +46,8 @@ def _get_azext_metadata(ext_dir): | |
def get_ext_metadata(ext_dir, ext_file, ext_name): | ||
# Modification of https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension.py#L89 | ||
WHL_METADATA_FILENAME = 'metadata.json' | ||
zip_ref = zipfile.ZipFile(ext_file, 'r') | ||
zip_ref.extractall(ext_dir) | ||
zip_ref.close() | ||
with zipfile.ZipFile(ext_file, 'r') as zip_ref: | ||
zip_ref.extractall(ext_dir) | ||
Comment on lines
+49
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix:
|
||
metadata = {} | ||
dist_info_dirs = [f for f in os.listdir(ext_dir) if f.endswith('.dist-info')] | ||
azext_metadata = _get_azext_metadata(ext_dir) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,7 @@ def benchmark(commands=None, runs=20): | |
for raw_command in commands: | ||
logger.info("Measuring %s...", raw_command) | ||
|
||
# pylint: disable=consider-using-with | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
pool = multiprocessing.Pool(multiprocessing.cpu_count(), _benchmark_process_pool_init) | ||
|
||
# try/except like this because of a bug of Python multiprocessing.Pool (https://bugs.python.org/issue8296) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,8 +131,8 @@ def test_benchmark_with_zero_runs(self): | |
# """ | ||
|
||
# with mock.patch( | ||
# "multiprocessing.pool.Pool.map_async", # pylint: disable=bad-continuation | ||
# lambda self, _, iterable, chunksize=None, callback=None, error_callback=None: _MockedMapResultCounter( # pylint: disable=bad-continuation | ||
# "multiprocessing.pool.Pool.map_async", | ||
# lambda self, _, iterable, chunksize=None, callback=None, error_callback=None: _MockedMapResultCounter( | ||
# _, iterable, | ||
# ), | ||
# ): | ||
|
@@ -142,13 +142,13 @@ def test_benchmark_with_zero_runs(self): | |
|
||
def test_benchmark_with_help_command(self): | ||
with mock.patch( | ||
"azdev.operations.performance._benchmark_cmd_timer", # pylint: disable=bad-continuation | ||
return_value=1, # pylint: disable=bad-continuation | ||
"azdev.operations.performance._benchmark_cmd_timer", | ||
return_value=1, | ||
), mock.patch( | ||
"multiprocessing.pool.Pool.map_async", | ||
lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( | ||
func, iterable | ||
), # pylint: disable=bad-continuation | ||
), | ||
): | ||
|
||
commands = ["network applicaiton-gateway create -h", "version", "find"] | ||
|
@@ -158,8 +158,8 @@ def test_benchmark_with_help_command(self): | |
|
||
def test_benchmark_in_actual_running(self): | ||
with mock.patch( | ||
"multiprocessing.pool.Pool.map_async", # pylint: disable=bad-continuation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( # pylint: disable=bad-continuation | ||
"multiprocessing.pool.Pool.map_async", | ||
lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( | ||
func, iterable | ||
), | ||
): | ||
|
@@ -182,8 +182,8 @@ def test_benchmark_in_actual_running(self): | |
|
||
def test_benchmark_with_specific_runs(self): | ||
with mock.patch( | ||
"multiprocessing.pool.Pool.map_async", # pylint: disable=bad-continuation | ||
lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( # pylint: disable=bad-continuation | ||
"multiprocessing.pool.Pool.map_async", | ||
lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( | ||
func, iterable | ||
), | ||
): | ||
|
@@ -207,11 +207,11 @@ def test_benchmark_with_specific_runs(self): | |
# time.sleep(2) | ||
|
||
# with mock.patch( | ||
# "azdev.operations.performance._benchmark_cmd_timer", # pylint: disable=bad-continuation | ||
# side_effect=mocked_benchmark_timeout_func, # pylint: disable=bad-continuation | ||
# "azdev.operations.performance._benchmark_cmd_timer", | ||
# side_effect=mocked_benchmark_timeout_func, | ||
# ), mock.patch( | ||
# "multiprocessing.pool.Pool.map_async", # pylint: disable=bad-continuation | ||
# lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( # pylint: disable=bad-continuation | ||
# "multiprocessing.pool.Pool.map_async", | ||
# lambda self, func, iterable, chunksize=None, callback=None, error_callback=None: _MockedPoolMapResult( | ||
# func, iterable | ||
# ), | ||
# ): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,23 +61,21 @@ | |
'azdev.utilities', | ||
], | ||
install_requires=[ | ||
'azure-multiapi-storage', | ||
'docutils', | ||
'flake8', | ||
'gitpython', | ||
'jinja2', | ||
'knack', | ||
'mock', | ||
'pylint==2.3.0', | ||
'astroid==2.4.2', # pylint 2.3 doesn't support astroid 2.5 | ||
'pylint==2.8.0', | ||
'pytest-xdist', # depends on pytest-forked | ||
'pytest>=5.0.0', | ||
'pytest-xdist', # depends on pytest-forked | ||
'pyyaml', | ||
'requests', | ||
'sphinx==1.6.7', | ||
'tox', | ||
'wheel==0.30.0', | ||
'azure-multiapi-storage', | ||
'isort==4.3.21' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove 'isort==4.3.21' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
'wheel==0.30.0' | ||
], | ||
package_data={ | ||
'azdev.config': ['*.*', 'cli_pylintrc', 'ext_pylintrc'], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend adding explanation of why disable them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, but let's keep it for now as this is only for
azdev
. CLI'spylintrc
has detailed explanation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed unused items. The rest of them is self-explanatory.