Ejemplo n.º 1
0
 def run(self):
     """ Distutils calls this method to run the command """
     from Cython.Build import cythonize
     self.extensions.extend(
         cythonize(
             self._get_cython_ext(),
             compiler_directives={'language_level': sys.version_info[0]}))
     _build_ext.run(self)  # actually do the build
Ejemplo n.º 2
0
    def run(self):
        if self.distribution.has_c_libraries():
            self.run_command('build_clib')
            build_clib = self.get_finalized_command('build_clib')
            self.include_dirs += build_clib.include_dirs
            self.library_dirs += build_clib.compiler.library_dirs

        # copy data files from temp to classlssy package directory
        shutil.rmtree(os.path.join(self.build_lib, 'classylss', 'data'), ignore_errors=True)
        shutil.copytree(os.path.join(self.build_temp, 'data'), os.path.join(self.build_lib, 'classylss', 'data'))

        build_ext.run(self)
Ejemplo n.º 3
0
    def run(self):
        if self.distribution.has_c_libraries():
            self.run_command('build_clib')
            build_clib = self.get_finalized_command('build_clib')
            self.include_dirs += build_clib.include_dirs
            self.library_dirs += build_clib.compiler.library_dirs

        # copy data files from temp to pyRSD package directory
        shutil.rmtree(os.path.join(self.build_lib, 'pyRSD', 'data', 'class'),
                      ignore_errors=True)
        shutil.copytree(os.path.join(self.build_temp, 'data'),
                        os.path.join(self.build_lib, 'pyRSD', 'data', 'class'))

        build_ext.run(self)
Ejemplo n.º 4
0
 def run(self, *args, **kwargs):
     global build_ext_ran
     build_ext_ran = True
     try:
         build_ext.run(self, *args, **kwargs)
         # copy the weird extra dll dir on windows (fortran)
         flibdll_dir = os.path.join(self.build_lib, 'viscid', '.libs')
         if os.path.isdir(flibdll_dir):
             self.copy_tree(
                 flibdll_dir,
                 os.path.join(os.path.dirname(__file__), 'viscid', '.libs'))
     except Exception as e:
         global build_ext_failed
         build_ext_failed = True
         print(e, file=sys.stderr)
Ejemplo n.º 5
0
    def run(self):
        if not self.distribution.pypp_ext_modules:
            return
        environ = self.distribution.environment

        ## Make sure that extension sources are complete.
        self.run_command('build_src')
        build = self.get_finalized_command('build')
        if self.distribution.verbose:
            print('Creating Py++ code generators ...')

        my_build_temp = os.path.join(os.path.abspath(build.build_base), 'pypp')
        builders = []
        for pext in self.distribution.pypp_ext_modules:
            builder = os.path.basename(pext.pyppdef)[:-6]  ## assumes '.py.in'
            pext.builder = builder
            builders.append(builder)
            builder_py = os.path.join(my_build_temp, builder + '.py')
            if is_out_of_date(pext.pyppdef, builder_py):
                configure_file(environ, pext.pyppdef, builder_py)

        init = open(os.path.join(my_build_temp, '__init__.py'), 'w')
        init.write('__all__ = ' + str(builders) + '\n\n')
        init.close()
        main = open(os.path.join(my_build_temp, '__main__.py'), 'w')
        main.write('for m in __all__:\n    m.generate()\n\n')
        main.close()
        init = open(os.path.join(os.path.abspath(build.build_base),
                                 '__init__.py'), 'w')
        init.write("__all__ = ['" + os.path.basename(my_build_temp) + "']\n\n")
        init.close()

        self.extensions = []
        for pext in self.distribution.pypp_ext_modules:
            if is_out_of_date(os.path.join(my_build_temp,
                                           pext.builder + '.py'),
                              pext.binding_file):
                if self.distribution.verbose:
                    print('\tfor ' + pext.name)
                build_mod = my_build_temp.replace(os.sep, '.')
                full_qual = build_mod + '.' + pext.builder
                __import__(full_qual)
                generator = sys.modules[full_qual]
                pext.sources += generator.generate()
                self.extensions.append(pext)
                    
        build_ext.run(self)
Ejemplo n.º 6
0
 def run(self):
     has_fortran = False
     has_cython = False
     for ext in self.extensions:
         has_fortran = has_fortran or has_f_sources(ext.sources)
         for isource, source in enumerate(ext.sources):
             if source.endswith('.pyx'):
                 if USE_CYTHON:
                     has_cython = True
                 else:
                     ext.sources[isource] = source[:-3] + 'c'
     if has_cython:
         self.extensions = cythonize(self.extensions, force=True)
     if has_fortran:
         with open(os.path.join(root, '.f2py_f2cmap'), 'w') as f:
             f.write(repr(F2PY_TABLE))
     build_ext.run(self)
Ejemplo n.º 7
0
 def run(self):
     build_ext.run(self)
     data_install_msgs()
Ejemplo n.º 8
0
 def run(self):
     build_ext.run(self)
     data_install_msgs()
Ejemplo n.º 9
0
 def run(self):
     self.run_command("mbuild")
     numpy_build_ext.run(self)
Ejemplo n.º 10
0
 def run(self):
     """ Distutils calls this method to run the command """
     from Cython.Build import cythonize
     self.extensions.extend(cythonize(self._get_cython_ext()))
     _build_ext.run(self) # actually do the build
Ejemplo n.º 11
0
 def run(self):
     """ Distutils calls this method to run the command """
     from Cython.Build import cythonize
     self.extensions.extend(cythonize(self._get_cython_ext()))
     _build_ext.run(self)  # actually do the build