Commit f540e95c authored by Jérome Perrin's avatar Jérome Perrin

stack/erp5,component/pylint: version up astroid 1.4.0 pylint 1.5.0

This should fix `redundant-keyword-arg` false positive that we observe
in ERP5 coding style test for erp5_core
parent b336f593
Pipeline #21354 canceled with stage
in 0 seconds
......@@ -10,21 +10,27 @@ Date: Sun Jan 7 14:28:42 2018 -0700
astroid/brain/pysix_moves.py | 38 ++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/astroid/brain/pysix_moves.py b/astroid/brain/pysix_moves.py
index 548d9761..1db6566a 100644
--- a/astroid/brain/pysix_moves.py
+++ b/astroid/brain/pysix_moves.py
@@ -23,7 +23,8 @@
---
The original patch have been amended to support the names of astroid 1.4.0
(because the patch was written for a more recent version of astroid) and
to also support six.moves.cPickle which was missing for python 2.
diff --git a/astroid/brain/brain_six.py b/astroid/brain/brain_six.py
index 9596a6c8..0935beb2 100644
--- a/astroid/brain/brain_six.py
+++ b/astroid/brain/brain_six.py
@@ -23,7 +23,7 @@ from textwrap import dedent
from astroid import MANAGER, register_module_extender
from astroid.builder import AstroidBuilder
-from astroid.exceptions import AstroidBuildingException
+from astroid.exceptions import AstroidBuildingException, NotFoundError
+from astroid import nodes
-from astroid.exceptions import AstroidBuildingException, InferenceError
+from astroid.exceptions import AstroidBuildingException, InferenceError, NotFoundError
from astroid import nodes
def _indent(text, prefix, predicate=None):
"""Adds 'prefix' to the beginning of selected lines in 'text'.
@@ -48,6 +49,7 @@
@@ -53,6 +53,7 @@ if sys.version_info[0] == 2:
import CGIHTTPServer
import SimpleHTTPServer
......@@ -32,7 +38,7 @@ index 548d9761..1db6566a 100644
from StringIO import StringIO
from cStringIO import StringIO as cStringIO
from UserDict import UserDict
@@ -194,7 +196,7 @@
@@ -199,7 +199,7 @@ else:
import html.entities as html_entities
import html.parser as html_parser
import http.client as http_client
......@@ -41,7 +47,7 @@ index 548d9761..1db6566a 100644
BaseHTTPServer = CGIHTTPServer = SimpleHTTPServer = http.server
import pickle as cPickle
import queue
@@ -225,7 +227,8 @@
@@ -230,7 +230,8 @@ else:
import tkinter.filedialog as tkinter_tkfiledialog
import tkinter.font as tkinter_font
import tkinter.messagebox as tkinter_messagebox
......@@ -51,7 +57,7 @@ index 548d9761..1db6566a 100644
import urllib.robotparser as urllib_robotparser
import urllib.parse as urllib_parse
import urllib.error as urllib_error
@@ -248,10 +251,38 @@
@@ -253,10 +254,38 @@ def six_moves_transform():
def _six_fail_hook(modname):
......@@ -90,4 +96,4 @@ index 548d9761..1db6566a 100644
+ # This will cause an Uninferable result, which is okay
return module
def transform_six_add_metaclass(node):
......@@ -9,7 +9,7 @@ extends =
recipe = zc.recipe.egg:custom
egg = astroid
patches =
${:_profile_base_location_}/astroid-six_moves_import_error.patch#377beb0c50f52b9608bb6be7bf93096e
${:_profile_base_location_}/astroid-six_moves_import_error.patch#35f50b5434c5c2c73b9cc206d87f3371
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
......@@ -17,7 +17,7 @@ patch-binary = ${patch:location}/bin/patch
recipe = zc.recipe.egg:custom
egg = pylint
patches =
${:_profile_base_location_}/pylint-super_on_old_class.patch#cb0c3f8c091bf4980be395c917edc435
${:_profile_base_location_}/pylint-redefining-builtins-modules.patch#043defc6e9002ac48b40e078797d4d17
${:_profile_base_location_}/pylint-super_on_old_class.patch#49935b4af0a9b26558175d7ba3bff649
${:_profile_base_location_}/pylint-redefining-builtins-modules.patch#bbf4c2783e4a9d36a76d08170e4298a1
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
......@@ -3,10 +3,10 @@ From: Claudiu Popa <pcmanticore@gmail.com>
Date: Fri, 25 Mar 2016 14:36:31 +0000
Subject: [PATCH] Backport of new option, 'redefining-builtins-modules'.
commit 5674ff98a6cd090578910c2c3bb02e1328f8e6d2
commit bcad9bafedd9e8a46be784293c8dc57920a0ea1e
Author: Claudiu Popa <pcmanticore@gmail.com>
Date: Wed Apr 4 20:56:59 2018 +0200
builtins is allowed to redefine builtins. Close #1966
Date: Thu Apr 12 15:14:38 2018 +0200
io can redefine builtins. Close #2014
commit 5674ff98a6cd090578910c2c3bb02e1328f8e6d2
Author: Claudiu Popa <pcmanticore@gmail.com>
......@@ -32,10 +32,10 @@ Date: Fri Mar 25 14:36:31 2016 +0000
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index 8f6f9574..3223f8f0 100644
index 7629a7bb..acb9efa1 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -309,7 +309,13 @@ builtins. Remember that you should avoid to define new builtins when possible.'
@@ -326,7 +326,13 @@ builtins. Remember that you should avoid to define new builtins when possible.'
'help' : 'List of strings which can identify a callback '
'function by name. A callback name must start or '
'end with one of those strings.'}
......@@ -50,7 +50,7 @@ index 8f6f9574..3223f8f0 100644
)
def __init__(self, linter=None):
BaseChecker.__init__(self, linter)
@@ -323,7 +329,8 @@ builtins. Remember that you should avoid to define new builtins when possible.'
@@ -340,7 +346,8 @@ builtins. Remember that you should avoid to define new builtins when possible.'
self._to_consume = [(copy(node.locals), {}, 'module')]
for name, stmts in six.iteritems(node.locals):
if is_builtin(name) and not is_inside_except(stmts[0]):
......@@ -60,17 +60,17 @@ index 8f6f9574..3223f8f0 100644
self.add_message('redefined-builtin', args=name, node=stmts[0])
@check_messages('unused-import', 'unused-wildcard-import',
@@ -496,7 +503,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
dummy_rgx = self.config.dummy_variables_rgx
@@ -537,7 +544,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
if not dummy_rgx.match(name):
self.add_message('redefined-outer-name', args=(name, line), node=stmt)
self.add_message('redefined-outer-name',
args=(name, line), node=stmt)
- elif is_builtin(name):
+ elif is_builtin(name) and not self._should_ignore_redefined_builtin(stmt):
# do not print Redefining builtin for additional builtins
self.add_message('redefined-builtin', args=name, node=stmt)
@@ -688,6 +695,11 @@ builtins. Remember that you should avoid to define new builtins when possible.'
and not ass.statement() is node.statement():
@@ -732,6 +739,11 @@ builtins. Remember that you should avoid to define new builtins when possible.'
and assign.statement() is not node.statement()):
self.add_message('undefined-loop-variable', args=name, node=node)
+ def _should_ignore_redefined_builtin(self, stmt):
......
......@@ -9,15 +9,18 @@ Date: Sun Dec 6 14:54:52 2015 +0200
which isn't used enough to merit its existence.
Closes issue #721.
--- a/pylint/checkers/newstyle.py 2019-12-25 13:51:01.611586402 +0900
+++ b/pylint/checkers/newstyle.py 2019-12-25 13:50:31.861542768 +0900
@@ -127,12 +127,9 @@
if isinstance(call, astroid.CallFunc) and \
isinstance(call.func, astroid.Name) and \
call.func.name == 'super':
diff --git a/pylint/checkers/newstyle.py b/pylint/checkers/newstyle.py
index 489c22fe..5cc8f13c 100644
--- a/pylint/checkers/newstyle.py
+++ b/pylint/checkers/newstyle.py
@@ -128,12 +128,10 @@ class NewStyleConflictChecker(BaseChecker):
isinstance(call.func, astroid.Name) and
call.func.name == 'super'):
continue
- confidence = (INFERENCE if has_known_bases(klass)
- else INFERENCE_FAILURE)
- if not klass.newstyle:
+
+ if not klass.newstyle and has_known_bases(klass):
# super should not be used on an old style class
- self.add_message('super-on-old-class', node=node,
......@@ -26,7 +29,7 @@ Date: Sun Dec 6 14:54:52 2015 +0200
else:
# super first arg should be the class
if not call.args and sys.version_info[0] == 3:
@@ -146,8 +143,7 @@
@@ -147,8 +145,7 @@ class NewStyleConflictChecker(BaseChecker):
continue
if supcls is None:
......@@ -36,13 +39,13 @@ Date: Sun Dec 6 14:54:52 2015 +0200
continue
if klass is not supcls:
@@ -163,8 +159,7 @@
@@ -162,8 +159,7 @@ class NewStyleConflictChecker(BaseChecker):
if hasattr(call.args[0], 'name'):
name = call.args[0].name
if name is not None:
self.add_message('bad-super-call',
node=call,
- args=(name, ),
- self.add_message('bad-super-call', node=call, args=(name, ),
- confidence=confidence)
+ args=(name, ))
+ self.add_message('bad-super-call', node=call, args=(name, ))
def register(linter):
......@@ -636,9 +636,11 @@ python-magic = 0.4.12+SlapOSPatched001
PyPDF2 = 1.26.0+SlapOSPatched001
Zope2 = 2.13.30+SlapOSPatched001
## https://lab.nexedi.com/nexedi/slapos/merge_requests/648
pylint = 1.4.4+SlapOSPatched002
pylint = 1.5.0+SlapOSPatched002
# astroid 1.4.1 breaks testDynamicClassGeneration
astroid = 1.3.8+SlapOSPatched001
astroid = 1.4.0+SlapOSPatched001
wrapt = 1.14.1
lazy-object-proxy = 1.6.0:whl
# use newer version than specified in ZTK
PasteDeploy = 1.5.2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment