changeset 47797:42e2cdb50db0 stable

check-module-imports: ignore non-stdlib module installed by distribution Previously, the check script would detect breezy as part of the stdlib if installed using the debian package manager. This silence the following complains: tests/test-convert-bzr.t:117: imports not lexically sorted: breezy.bzr.bzrdir < sys tests/test-convert-bzr.t:117: stdlib import "breezy.bzr.bzrdir" follows local import: breezy tests/test-convert-bzr-ghosts.t:7: imports not lexically sorted: breezy.bzr.bzrdir < sys tests/test-convert-bzr-ghosts.t:7: stdlib import "breezy.bzr.bzrdir" follows local import: breezy tests/test-convert-bzr-treeroot.t:7: imports not lexically sorted: breezy.bzr.bzrdir < sys tests/test-convert-bzr-treeroot.t:7: stdlib import "breezy.bzr.bzrdir" follows local import: breezy Differential Revision: https://phab.mercurial-scm.org/D11249
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 03 Aug 2021 18:29:31 +0200
parents 6802422a1ae0
children 580bca200874
files contrib/import-checker.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/import-checker.py	Mon Aug 02 08:06:27 2021 -0400
+++ b/contrib/import-checker.py	Tue Aug 03 18:29:31 2021 +0200
@@ -278,6 +278,8 @@
         ):
             continue
         for top, dirs, files in os.walk(libpath):
+            if 'dist-packages' in top.split(os.path.sep):
+                continue
             for i, d in reversed(list(enumerate(dirs))):
                 if (
                     not os.path.exists(os.path.join(top, d, '__init__.py'))