Skip to content

Commit

Permalink
Increased pylint to >=2.10 on Python >=3.6 to pick up fixes
Browse files Browse the repository at this point in the history
Details:

* Increased pylint to >=2.10 on Python >=3.6 to pick up fixes in similarity
  checker (issues #2672, #2673)

* Enabled the similarity chcker of pylint again on pylint >=2.10.

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Mar 13, 2022
1 parent 7f91693 commit 8d08553
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@ pylint_rc_file := pylintrc
pylint_todo_opts := --disable=fixme
pylint_no_todo_opts := --enable=fixme

# Disable the similarity checker on pylint <2.10 due to issues #2672, #2673
ifeq ($(python_mn_version),2.7)
pylint_sc_opts := --disable=R801
else
ifeq ($(python_mn_version),3.5)
pylint_sc_opts := --disable=R801
else
pylint_sc_opts :=
endif
endif

# Flake8 config file
flake8_rc_file := .flake8

Expand Down Expand Up @@ -822,8 +833,8 @@ else
@echo "Makefile: Running Pylint"
-$(call RM_FUNC,$@)
pylint --version
pylint $(pylint_no_todo_opts) --rcfile=$(pylint_rc_file) $(py_src_files)
pylint $(pylint_todo_opts) --rcfile=$(pylint_rc_file) $(py_test_files)
pylint $(pylint_sc_opts) $(pylint_no_todo_opts) --rcfile=$(pylint_rc_file) $(py_src_files)
pylint $(pylint_sc_opts) $(pylint_todo_opts) --rcfile=$(pylint_rc_file) $(py_test_files)
echo "done" >$@
@echo "Makefile: Done running Pylint"
endif
Expand Down
7 changes: 5 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ Babel>=2.7.0
# Pylint requires astroid
# Pylint 1.x / astroid 1.x supports py27 and py34/35/36
# Pylint 2.0 / astroid 2.0 removed py27, added py37
# Pylint 2.10 / astroid 2.7 fixes issues in similarity checker (issues #2672, #2673)
pylint>=1.6.4,<2.0.0; python_version == '2.7'
pylint>=2.5.2; python_version >= '3.5'
pylint>=2.5.2; python_version == '3.5'
pylint>=2.10.0; python_version >= '3.6'
astroid>=1.4.9,<2.0.0; python_version == '2.7'
astroid>=2.4.0; python_version >= '3.5'
astroid>=2.4.0; python_version == '3.5'
astroid>=2.7.2; python_version >= '3.6'
typed-ast>=1.4.0,<1.5.0; python_version >= '3.6' and python_version < '3.8' and implementation_name=='cpython'
# lazy-object-proxy is used by astroid
lazy-object-proxy>=1.4.3; python_version == '2.7'
Expand Down
4 changes: 4 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Released: not yet

* Re-enabled pylint on Python 3.5 (issue #2674)

* Increased pylint to >=2.10 on Python >=3.6 to pick up fixes in similarity
checker and enabled similarity checker again on pylint >=2.10
(issues #2672, #2673)

**Enhancements:**

* Added support for the new 'CIM_WBEMServerNamespace' class used in the
Expand Down
6 changes: 4 additions & 2 deletions minimum-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ Babel==2.7.0

# PyLint (no imports, invoked via pylint script):
pylint==1.6.4; python_version == '2.7'
pylint==2.5.2; python_version >= '3.5'
pylint==2.5.2; python_version == '3.5'
pylint==2.10.0; python_version >= '3.6'
astroid==1.4.9; python_version == '2.7'
astroid==2.4.0; python_version >= '3.5'
astroid==2.4.0; python_version == '3.5'
astroid==2.7.2; python_version >= '3.6'
typed-ast==1.4.0; python_version >= '3.6' and python_version < '3.8' and implementation_name=='cpython'
lazy-object-proxy==1.4.3; python_version == '2.7'
lazy-object-proxy==1.4.3; python_version >= '3.5'
Expand Down
8 changes: 1 addition & 7 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,7 @@ disable=I0011, bad-option-value,
locally-enabled, superfluous-parens, useless-object-inheritance,
consider-using-set-comprehension, unnecessary-pass, useless-return,
signature-differs, raise-missing-from, super-with-arguments,
redundant-u-string-prefix, consider-using-f-string,
R0801

# Issue #2672: Disabling R0801 is a circumvention for Pylint issue
# https://github.com/PyCQA/pylint/issues/4118 that appears in Pylint 2.7.0.
# Enable it again once the Pylint issue has been addressed (expected for
# Pylint 2.10).
redundant-u-string-prefix, consider-using-f-string

# Note: "useless-object-inheritance" is python 3 only. In Python 2,
# "new-style" objects must inherit from object, or else
Expand Down

0 comments on commit 8d08553

Please sign in to comment.