diff --git a/.pylintrc b/.pylintrc index 8a4c0fe..f2ac3c9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,6 +1,7 @@ # https://docs.pylint.org/en/latest/technical_reference/features.html [MESSAGES CONTROL] +disable = useless-object-inheritance # bidict/_version.py is generated by setuptools_scm ignore = _version.py diff --git a/.travis.yml b/.travis.yml index 50daa0c..0fa12e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,11 +102,11 @@ matrix: - travis_retry make linkcheck - env: TASK=flake8 before_install: skip - install: travis_retry pip install flake8 + install: travis_retry pip install 'flake8<3.6' # keep in sync with the pin in setup.py script: flake8 $LINT_SRC - env: TASK=pylint - before_install: travis_retry pip install .[test] - install: travis_retry pip install pylint + before_install: skip + install: travis_retry pip install 'pylint<2.1' 'hypothesis<4' 'pytest<4' # keep in sync with the pins in setup.py script: pylint --jobs=0 $LINT_SRC - env: TASK=test-with-optimization-flag # make sure there are no relied-on side effects in assert statements before_install: skip diff --git a/bidict/_orderedbase.py b/bidict/_orderedbase.py index 9554747..f1ac8a7 100644 --- a/bidict/_orderedbase.py +++ b/bidict/_orderedbase.py @@ -114,7 +114,7 @@ class _Node(object): # pylint: disable=too-few-public-methods vork = self._vork if key_or_val == korv: return vork - elif key_or_val == vork: + if key_or_val == vork: return korv raise KeyError(key_or_val) diff --git a/bidict/compat.py b/bidict/compat.py index 42bb439..5ce4b09 100644 --- a/bidict/compat.py +++ b/bidict/compat.py @@ -82,7 +82,7 @@ if PY2: # In Python 3, the collections ABCs were moved into collections.abc, which does not exist in # Python 2. Support for importing them directly from collections is dropped in Python 3.8. - from collections import ( # noqa: F401 (imported but unused) + from collections import ( # pylint: disable=no-name-in-module; noqa: F401 (imported but unused) Mapping, MutableMapping, KeysView, ItemsView) else: diff --git a/setup.cfg b/setup.cfg index b076203..0b8a232 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [aliases] test=pytest -; https://flake8.readthedocs.io/en/latest/config.html +; http://flake8.pycqa.org/en/latest/user/configuration.html [flake8] ignore = E126,E128,E265,E731 max-line-length = 100 diff --git a/setup.py b/setup.py index 566dc21..c049719 100644 --- a/setup.py +++ b/setup.py @@ -68,12 +68,12 @@ DOCS_REQS = [ DEV_REQ = SETUP_REQS + TEST_REQS + COVERAGE_REQS + DOCS_REQS + [ 'pre-commit<2', 'tox<4', - # Peg to more specific versions of the following dependencies since they'd - # have a higher chance of breaking CI otherwise. Upgrade to newer versions - # manually to have a chance to fix any resulting breakage. + # The following dependencies have a higher chance of suddenly causing CI to fail after updating + # even between minor versions so pin to currently-working minor versions. Upgrade to newer + # minor versions manually to have a chance to fix any resulting breakage before it hits CI. 'flake8<3.6', 'pydocstyle<2.2', - 'pylint<1.9', + 'pylint<2.1', ] setup( diff --git a/tests/test_class_relationships.py b/tests/test_class_relationships.py index 5af2631..1b18e9d 100644 --- a/tests/test_class_relationships.py +++ b/tests/test_class_relationships.py @@ -7,7 +7,10 @@ """Test various issubclass checks.""" -from collections import Hashable +try: + from collections import Hashable +except ImportError: # Python >= 3.7 + from collections.abc import Hashable import pytest diff --git a/tests/test_hypothesis.py b/tests/test_hypothesis.py index 1fe23ca..c13f25a 100644 --- a/tests/test_hypothesis.py +++ b/tests/test_hypothesis.py @@ -10,10 +10,13 @@ import gc import pickle import re -from collections import Hashable, Iterable, Mapping, MutableMapping, OrderedDict from operator import itemgetter from os import getenv from weakref import ref +try: + from collections import Hashable, Iterable, Mapping, MutableMapping, OrderedDict +except ImportError: # Python >= 3.7 + from collections.abc import Hashable, Iterable, Mapping, MutableMapping, OrderedDict import pytest from hypothesis import HealthCheck, assume, given, settings, strategies as strat, unlimited