[PATCH] import-checker: exclude dist-packages tree from stdlib as well

Yuya Nishihara yuya at tcha.org
Fri Jul 3 21:32:31 CDT 2015


On Fri, 3 Jul 2015 17:27:46 -0400, Augie Fackler wrote:
> 
> > On Jul 3, 2015, at 12:57 PM, Gregory Szorc <gregory.szorc at gmail.com> wrote:
> > 
> > On Fri, Jul 3, 2015 at 8:00 AM, Augie Fackler <raf at durin42.com> wrote:
> > 
> > > On Jul 3, 2015, at 9:48 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> > >
> > > # HG changeset patch
> > > # User Yuya Nishihara <yuya at tcha.org>
> > > # Date 1435929436 -32400
> > > #      Fri Jul 03 22:17:16 2015 +0900
> > > # Node ID 506956b94ca90eec47dfd7d9746e129bc3ccf884
> > > # Parent  d3d2ba265e17af1d9700e3e99de4d012b1b31ab8
> > > import-checker: exclude dist-packages tree from stdlib as well
> > >
> > > On Debian, packaged modules are installed into dist-packages, not to
> > > site-packages. Because of this, if we have mercurial installed, the test
> > > failed as 'mercurial.node' was listed in stdlib_modules:
> > 
> > Hmm. I think this means that the import-checker is running with too many things on its sys.path - does that make sense to you?
> > 
> > I’m not sure what we should do about it, but it definitely seems a bit undesirable to pick things up from diet-packages when we’re trying to analyze a working tree. Thoughts?
> > 
> > Having recently touched this code, I believe the only place where "is stdlib module" comes into play is when checking for mixed imports between mercurial modules and stdlib modules on the same line. Instead of worrying about sys.path, site-packages, etc, how about simply excluding "mercurial.*" and "hgext.*" modules from the stdlib modules list?
> > 
> 
> That works for me. Yuya, does that work for you?

Worked fine. I'll send V2 soon.


More information about the Mercurial-devel mailing list