Patchwork [03,of,10] import-checker: allow importing symbols from pure modules

login
register
mail settings
Submitter Yuya Nishihara
Date May 28, 2017, 1:05 p.m.
Message ID <0b6c894cdedba02033c1.1495976708@mimosa>
Download mbox | patch
Permalink /patch/20976/
State Accepted
Headers show

Comments

Yuya Nishihara - May 28, 2017, 1:05 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1493731497 -32400
#      Tue May 02 22:24:57 2017 +0900
# Node ID 0b6c894cdedba02033c1238e7106d10244eaf881
# Parent  1402f57f72fef5df62d6d2200db567ea39f6eb04
import-checker: allow importing symbols from pure modules

This allows us to re-export pure functions from cffi modules:

  # mercurial/cffi/base85.py
  from ..pure.base85 import *

Patch

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -22,6 +22,13 @@  allowsymbolimports = (
     'mercurial.hgweb.request',
     'mercurial.i18n',
     'mercurial.node',
+    # for cffi modules to re-export pure functions
+    'mercurial.pure.base85',
+    'mercurial.pure.bdiff',
+    'mercurial.pure.diffhelpers',
+    'mercurial.pure.mpatch',
+    'mercurial.pure.osutil',
+    'mercurial.pure.parsers',
 )
 
 # Whitelist of symbols that can be directly imported.