Skip to content

Commit

Permalink
Upgrade pylint to 2.12.2 (#1297)
Browse files Browse the repository at this point in the history
* Upgrade pylint to 2.12.2

* Default Python in the CI is now python 3.8

* Remove useless suppression for python 3.8

* Disable no-member for false positive with zipimport
  • Loading branch information
Pierre-Sassoulas authored Dec 15, 2021
1 parent 6879a45 commit 415bbb7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
CACHE_VERSION: 3
DEFAULT_PYTHON: 3.6
DEFAULT_PYTHON: 3.8
PRE_COMMIT_CACHE: ~/.cache/pre-commit

jobs:
Expand Down
1 change: 1 addition & 0 deletions astroid/interpreter/_import/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def _precache_zipimporters(path=None):
req_paths = tuple(path or sys.path)
cached_paths = tuple(pic)
new_paths = _cached_set_diff(req_paths, cached_paths)
# pylint: disable=no-member
for entry_path in new_paths:
try:
pic[entry_path] = zipimport.zipimporter(entry_path)
Expand Down
2 changes: 1 addition & 1 deletion astroid/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def zip_import_data(self, filepath):
except ValueError:
continue
try:
# pylint: disable-next=no-member
importer = zipimport.zipimporter(eggpath + ext)
# pylint: enable=no-member
zmodname = resource.replace(os.path.sep, ".")
if importer.is_package(resource):
zmodname = zmodname + ".__init__"
Expand Down
5 changes: 2 additions & 3 deletions astroid/nodes/node_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
from astroid import nodes

if sys.version_info >= (3, 6, 2):
# To be fixed with https://github.com/PyCQA/pylint/pull/5316
from typing import NoReturn # pylint: disable=unused-import
from typing import NoReturn
else:
from typing_extensions import NoReturn

Expand Down Expand Up @@ -445,7 +444,7 @@ def _fixed_source_line(self) -> Optional[int]:
We need this method since not all nodes have :attr:`lineno` set.
"""
line = self.lineno
_node: Optional[NodeNG] = self # pylint: disable = used-before-assignment
_node: Optional[NodeNG] = self
try:
while line is None:
_node = next(_node.get_children())
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black==21.7b0
pylint==2.12.1
pylint==2.12.2
isort==5.9.2
flake8==4.0.1
flake8-typing-imports==1.11.0
Expand Down

0 comments on commit 415bbb7

Please sign in to comment.