From 24974b07ba7fabcc9c93fbf5bcb7aa0ac6e69c04 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 17 Apr 2018 22:03:20 +0200 Subject: [PATCH] Safer to pylint on Python 3 --- .pylintrc | 2 +- linter_plugin.py | 8 +++++--- setup.py | 6 ++---- tox.ini | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.pylintrc b/.pylintrc index 36d8c286f..43c45b04a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -22,7 +22,7 @@ persistent=yes # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins=linter_plugin +load-plugins= [MESSAGES CONTROL] diff --git a/linter_plugin.py b/linter_plugin.py index 4938755cf..85896a36b 100644 --- a/linter_plugin.py +++ b/linter_plugin.py @@ -9,6 +9,8 @@ from astroid import nodes def register(unused_linter): """Register this module as PyLint plugin.""" + pass + def _transform(cls): # fix the "no-member" error on instances of @@ -17,9 +19,9 @@ def _transform(cls): # TODO: this is too broad and applies to any tested class... - if cls.slots() is not None: - for slot in cls.slots(): - cls.locals[slot.value] = [nodes.EmptyNode()] + #if cls.slots() is not None: + # for slot in cls.slots(): + # cls.locals[slot.value] = [nodes.EmptyNode()] if cls.name == 'JSONObjectWithFields': # _fields is magically introduced by JSONObjectWithFieldsMeta diff --git a/setup.py b/setup.py index 3760fd35b..082df7070 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ import codecs import os import re -import sys from setuptools import setup from setuptools import find_packages @@ -52,14 +51,13 @@ install_requires = [ ] dev_extras = [ - # Pin astroid==1.3.5, pylint==1.4.2 as a workaround for #289 - 'astroid==1.3.5', + 'astroid', 'coverage', 'ipdb', 'pytest', 'pytest-cov', 'pytest-xdist', - 'pylint==1.4.2', # upstream #248 + 'pylint>=1.8.4', 'tox', 'twine', 'wheel', diff --git a/tox.ini b/tox.ini index 38d4e6ae1..140b7b65d 100644 --- a/tox.ini +++ b/tox.ini @@ -117,6 +117,7 @@ basepython = python2.7 # continue, but tox return code will reflect previous error commands = {[base]install_packages} + pip install --upgrade astroid pylint # required! pylint --reports=n --rcfile=.pylintrc {[base]source_paths} [testenv:mypy]