[Python-projects] mismatch Python-2.5, common-0.19.0,
astng-0.16.0 and pylint-0.12.0
Sylvain Thénault
sylvain.thenault at logilab.fr
Sat Sep 23 11:49:12 CEST 2006
On Thursday 21 September à 16:47, Marien Zwart wrote:
> On Thu, Sep 21, 2006 at 02:05:51PM +0200, duncan.gibson at xs4all.nl wrote:
> >
> > I've just intalled Python-2.5, common-0.19.0, astng-0.16.0 and pylint-0.12.0
> >
> > Apart from a minor problem with a typo on the common download page where link
> > is "tp://ftp.logilab.fr/pub/common/common-0.19.0.tar.gz" instead of "ftp..."
> > either there's a mismatch and this combination of releases doesn't work, or
> > I've screwed something during installation (see below).
>
> <snip>
>
> > File "/usr/lib/python2.5/site-packages/logilab/astng/raw_building.py", line 54, in attach_import_node
> > _attach_local_node(node, nodes.From(modname, ( (membername, None), ) ),
> > TypeError: __init__() takes at least 4 arguments (3 given)
>
> This is caused by a change in the python stdlib compiler.ast module:
> From.__init__ now takes a "level" argument (presumably to support
> relative imports ("from .here import something")). Fixing this is
> straightforward: just add an argument of "0" in two places in astng.
> Attached should be a diff doing that. It also makes most of the tests
> pass (three changes, two because subclasses of Exception now also have
> BaseException and object as a base and one because things like
> OSError.strerror are now data descriptors on the class instead of
> entries in the __dict__ of an instance).
a patch, great ! :) I'll check in this one an make a release of astng
including it asap.
> Also attached is a diff to make logilab-common's tests pass with
> python 2.5. I probably broke them for python 2.3 (since according to
> the ChangeLog python 2.3 does not include the default value in the
> --help output) but cannot conveniently test for python 2.3, so will
> leave that to someone who can :). Also had to disable
> test_load_module_set_attribute in unittest_modutils because with that
> test enabled the import of textutils a few tests later mysteriously
> fails. I guess python does not like the "del
> sys.modules['logilab.common']".
>
> Also spotted a bug in logilab.common.testlib.find_tests: between
> common-0.15.0 and logilab-common-0.19.0 "name = name[:-len(suffix)]"
> changed to "name = name.rstrip(suffix)", but rstrip does not take a
> string suffix to strip, it takes a sequence of characters to strip. So
> now it turns "unittest_lookup.py" into "unittest_looku", which does
> not work very well (astng's tests still fail because of this).
great great, I'll include your test fixes and correct this as well !
> Pylint (0.12.0) fails its tests but does seem to mostly work (ran it
> on a not too tiny project and it got pretty far before failing with a
> traceback ending in
>
> File "/usr/lib/python2.5/site-packages/pylint/lint.py", line 597,
> in astng_events
> self.astng_events(child, checkers, _reversed_checkers)
> File "/usr/lib/python2.5/site-packages/pylint/lint.py", line 594,
> in astng_events
> checker.visit(astng)
> File "/usr/lib/python2.5/site-packages/logilab/astng/utils.py", line 86,
> in visit
> method(node)
> File "/usr/lib/python2.5/site-packages/pylint/checkers/typecheck.py",
> line 117, in visit_getattr
> and owner.has_dynamic_getattr():
> File "/usr/lib/python2.5/site-packages/logilab/astng/__init__.py", line 196,
> in Const___getattr__
> raise AttributeError(name)
> AttributeError: has_dynamic_getattr
>
> ).
>
> Will investigate pylint's tests next (and provide a minimal failing
> testcase for the above traceback if it still fails after getting
> pylint's tests to pass).
this one's already fixed in the repository. Hopefully I'll release all
this plus pending works in our repository, now pending for a too long
time, in a near future.
Thank you very much for your contribution!
--
Sylvain Thénault LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Python et calcul scientifique: http://www.logilab.fr/science
More information about the Python-Projects
mailing list