From 741fbf47c456b7844d3f98087ad5a580073fa347 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Mon, 21 Oct 2019 16:40:57 -0700 Subject: [PATCH] [CI] Update lint configuration to support latest pylint convention (#4971) * Update lint configuration * Use gcc 8 consistently in build instruction --- doc/build.rst | 2 +- python-package/.pylintrc | 2 +- python-package/xgboost/core.py | 4 ++-- python-package/xgboost/tracker.py | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/build.rst b/doc/build.rst index 8f66b100f..519a725bd 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -375,7 +375,7 @@ Create the ``build/`` directory and invoke CMake with option ``R_LIB=ON``. Make mkdir build cd build - CC=gcc-7 CXX=g++-7 cmake .. -DR_LIB=ON + CC=gcc-8 CXX=g++-8 cmake .. -DR_LIB=ON make -j4 make install diff --git a/python-package/.pylintrc b/python-package/.pylintrc index 8049662c7..da0ff6ad8 100644 --- a/python-package/.pylintrc +++ b/python-package/.pylintrc @@ -4,7 +4,7 @@ ignore=tests extension-pkg-whitelist=numpy -disable=unexpected-special-method-signature,too-many-nested-blocks,useless-object-inheritance +disable=unexpected-special-method-signature,too-many-nested-blocks,useless-object-inheritance,import-outside-toplevel,unsubscriptable-object dummy-variables-rgx=(unused|)_.* diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index cf9293829..060117407 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -984,7 +984,7 @@ class DMatrix(object): # validate feature name try: if not isinstance(feature_names, str): - feature_names = [n for n in iter(feature_names)] + feature_names = list(feature_names) else: feature_names = [feature_names] except TypeError: @@ -1028,7 +1028,7 @@ class DMatrix(object): try: if not isinstance(feature_types, str): - feature_types = [n for n in iter(feature_types)] + feature_types = list(feature_types) else: feature_types = [feature_types] except TypeError: diff --git a/python-package/xgboost/tracker.py b/python-package/xgboost/tracker.py index ad21c5408..017d28bb9 100644 --- a/python-package/xgboost/tracker.py +++ b/python-package/xgboost/tracker.py @@ -153,8 +153,7 @@ class RabitTracker(object): except socket.error as e: if e.errno in [98, 48]: continue - else: - raise + raise sock.listen(256) self.sock = sock self.hostIP = hostIP