[Freeipa-devel] [PATCHES] 0270-0271 Support for Pylint 1.0

Alexander Bokovoy abokovoy at redhat.com
Fri Sep 6 12:22:48 UTC 2013


On Fri, 06 Sep 2013, Petr Viktorin wrote:
>On 09/06/2013 10:35 AM, Alexander Bokovoy wrote:
>>On Thu, 05 Sep 2013, Petr Viktorin wrote:
>>>On 09/05/2013 08:08 AM, Alexander Bokovoy wrote:
>>>>On Wed, 04 Sep 2013, Petr Viktorin wrote:
>>>>>On 08/19/2013 12:29 PM, Petr Viktorin wrote:
>>>>>>Hello,
>>>>>>The first patch fixes a minor problem that Pylint 1.0 finds in our
>>>>>>code.
>>>>>>
>>>>>>The second patch makes make-lint compatible with Pylint 1.0. It
>>>>>>contains
>>>>>>a workaround for a Pylint bug; before pushing this we should wait
>>>>>>for a
>>>>>>while to see if a fixed Pylint is released.
>>>>>>
>>>>>
>>>>>A fixed version of Pylint was released, bug workarounds are no longer
>>>>>necessary.
>>>>>
>>>>>Updated patches attached.
>>>>>
>>>>>https://fedorahosted.org/freeipa/ticket/3865
>>>>I tried the patches and still see an error on up to date Fedora 19
>>>>(including updates-testing):
>>>>
>>>>./make-lint Traceback (most recent call last):
>>>[...]
>>>>TypeError: unbound method infer() must be called with Tuple instance as
>>>>first argument (got InferenceContext instance instead)
>>>>
>>>>
>>>>At this point I'm not sure whether it is astroid's issue or ours...
>>>>Astroid did change from 0.24 to 1.0 on August 13th in Fedora (even in
>>>>Fedora 19 where version updates after release are generally
>>>>discouraged, especially in case of ABI change).
>>>
>>>Hello,
>>>Please use Pylint 1.0.0-2. It seems it hasn't reached the mirrors yet,
>>>you have the earlier buggy version.
>>I do have pylint 1.0.0-2.fc19 and yet it fails with the same error
>>message. Nothing works, I had to disable make-lint call in Makefile to
>>continue development.
>>
>
>That is strange; I've confirmed on several machines that the -2.fc19 
>release fixes this bug.
>
>If you run pylint on the following code, do you also get the "unbound 
>method infer()" error? (It's the upstream bug reproducer)
>
>import collections
>Point = collections.namedtuple('Point', ['x', 'y'])
>p = Point(x=1.0, y=2.0)
>print "Area: %.1f" % (p.x * p.y,)
Here is clean Fedora 19 VM, created few hours ago:
# rpm -q pylint python-astroid
pylint-1.0.0-2.fc19.noarch
python-astroid-1.0.0-2.fc19.noarch
# pylint test.py 
No config file found, using default configuration
************* Module test
C:  1, 0: Missing module docstring (missing-docstring)
C:  3, 0: Invalid constant name "p" (invalid-name)
Traceback (most recent call last):
   File "/usr/bin/pylint", line 9, in <module>
     load_entry_point('pylint==1.0.0', 'console_scripts', 'pylint')()
   File "/usr/lib/python2.7/site-packages/pylint/__init__.py", line 21, in run_pylint
     Run(sys.argv[1:])
   File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 1010, in __init__
     linter.check(args)
   File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 599, in check
     self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
   File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 685, in check_astroid_module
     walker.walk(astroid)
   File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 662, in walk
     self.walk(child)
   File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 662, in walk
     self.walk(child)
   File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 662, in walk
     self.walk(child)
   File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 662, in walk
     self.walk(child)
   File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 662, in walk
     self.walk(child)
   File "/usr/lib/python2.7/site-packages/pylint/utils.py", line 659, in walk
     cb(astroid)
   File "/usr/lib/python2.7/site-packages/pylint/checkers/typecheck.py", line 174, in visit_getattr
     if is_super(owner) or getattr(owner, 'type', None) == 'metaclass':
   File "/usr/lib/python2.7/site-packages/astroid/bases.py", line 51, in __getattr__
     return getattr(self._proxied, name)
   File "/usr/lib/python2.7/site-packages/astroid/scoped_nodes.py", line 680, in _class_type
     for base in klass.ancestors(recurs=False):
   File "/usr/lib/python2.7/site-packages/astroid/scoped_nodes.py", line 801, in ancestors
     for baseobj in stmt.infer(context):
TypeError: unbound method infer() must be called with Tuple instance as
first argument (got InferenceContext instance instead)

Then I've ran 'yum upgrade' again, and python-astroid-1.0.0-3.fc19.noarch was
installed which finally fixed the problem.

So the actual problem was split across both pylint and python-astroid.

That means ACK for your patches.

-- 
/ Alexander Bokovoy




More information about the Freeipa-devel mailing list