On Fri, Jul 1, 2011 at 6:38 PM, Dan Stromberg <[email protected]> wrote:

>
> I decided to reorganize
> http://stromberg.dnsalias.org/~dstromberg/backshift/ into a "package"
> (into a directory with an __init__.py), but started encountering pylint
> errors afterward that I'm not sure what to do with.


I created a tiny example of a package with two submodules inside it - and it
runs and pylints fine.

Backshift, a rather larger project, seems to run mostly OK (I still have
some relative imports to change to absolute), but has problems pylinting
now, where prior to trying to make it a package it was pylinting nicely.

I'm at a bit of a loss to see what the difference is between the two; it
_feels_ like it should be the same mechanics in each.

I've got a version of backshift at
http://stromberg.dnsalias.org/svn/backshift/branches/no-pylint (svn) that
can at least list a backup repository, but it fails pylint in a pretty big
way; pylint seems to think that a bunch of modules that are there, aren't.
 I hope someone can check it out and see why it's failing to pylint.  (All
the externals are "internalized" for the sake of having a stationary target)

BTW, I'm using pylint 0.21.3 with CPython 2.[567].

I figured out that things were working fine on 3.x, but not 2.x, when using
absolute imports.  Changing my code to try an absolute import first, then
fall back on a relative import, seems to run well (a little clunky, but
functional) on 2.x and 3.x.  However, pylint is warning about the relative
imports, suggesting that it believes absolute imports should work in 2.x.

What's the deal?

Even from __future__import absolute_import doesn't seem to help.

Thanks!

-- 
Dan Stromberg
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to