diff --git a/buildtools/config.py b/buildtools/config.py index 0c50fc07..25f6c05e 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -36,9 +36,10 @@ class Configuration(object): SIPFILES = 'sip' # where to find other sip files for %Include or %Import SIPOUT = 'sip/cpp' # where to put the generated C++ code - SIPOPTS = ' '.join(['-e', # turn on exceptions support - '-k', # turn on keyword args support + SIPOPTS = ' '.join(['-k', # turn on keyword args support '-o', # turn on auto-docstrings + '-e', # turn on exceptions support + '-T', # turn off writing the timestamp to the generated files #'-g', # always release and reaquire the GIL #'-r', # turn on function call tracing '-I', 'src' diff --git a/buildtools/distutils_hacks.py b/buildtools/distutils_hacks.py index aaa5804f..12499570 100644 --- a/buildtools/distutils_hacks.py +++ b/buildtools/distutils_hacks.py @@ -367,9 +367,25 @@ class etgsip_build_ext(build_ext): # cmd.append('--verbose') self.spawn(cmd) - if '%Module ' in file(sipfile).read(): + if '%Module(' in file(sipfile).read(): other_sources.append(sipfile) # now call the base class version of this method return build_ext.swig_sources(self, other_sources, extension) + + def _sip_compile(self, sip_bin, source, sbf): + other_opts = [] + base = os.path.basename(source) + if base.startswith('_'): + cfg = Config() + pycode = os.path.splitext(base[1:])[0] + '.py' + pycode = os.path.join(cfg.PKGDIR, pycode) + other_opts = ['-X', 'pycode:'+pycode] + self.spawn([sip_bin] + self.sip_opts + + other_opts + + ["-c", self._sip_output_dir(), + "-b", sbf, + "-I", self._sip_sipfiles_dir(), + source]) + diff --git a/src/__init__.py b/src/__init__.py index 57ad5006..6c99956d 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -8,4 +8,4 @@ #--------------------------------------------------------------------------- -from _core import * +from core import *