Skip to content

Commit

Permalink
update to latest pylint (2.0.0) and appease it
Browse files Browse the repository at this point in the history
  • Loading branch information
jab committed Jul 17, 2018
1 parent 28a4936 commit 20e1c18
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions .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
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bidict/_orderedbase.py
Expand Up @@ -114,7 +114,7 @@ def __getitem__(self, key_or_val):
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)

Expand Down
2 changes: 1 addition & 1 deletion bidict/compat.py
Expand Up @@ -82,7 +82,7 @@

# 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:
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Expand Up @@ -68,12 +68,12 @@
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(
Expand Down
5 changes: 4 additions & 1 deletion tests/test_class_relationships.py
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion tests/test_hypothesis.py
Expand Up @@ -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
Expand Down

0 comments on commit 20e1c18

Please sign in to comment.