Beispiel #1
0
    def get_package_dir(self, package):
        pkg_dir = build_py.get_package_dir(self, package)

        if self.workaround_pkgdir and pkg_dir == "":
            return "."

        return pkg_dir
 def run(self):
     base_class_2.run(self)
     if self.inplace:
         # from get_ext_fullpath() in distutils/command/build_ext.py
         module_path = module_name.split('.')
         package = '.'.join(module_path[:-1])
         build_py = self.get_finalized_command('build_py')
         package_dir = build_py.get_package_dir(package)
         file_name = module_path[-1] + '.py'
         generate_mod(os.path.join(package_dir, file_name))
Beispiel #3
0
 def run(self):
     base_class_2.run(self)
     if self.inplace:
         # from get_ext_fullpath() in distutils/command/build_ext.py
         module_path = module_name.split('.')
         package = '.'.join(module_path[:-1])
         build_py = self.get_finalized_command('build_py')
         package_dir = build_py.get_package_dir(package)
         file_name = module_path[-1] + '.py'
         generate_mod(os.path.join(package_dir, file_name))
Beispiel #4
0
    def copy_extensions_to_source(self):
        build_py = self.get_finalized_command('build_py')
        for ext in self.extensions:
            fullname = self.get_ext_fullname(ext.name)
            modpath = fullname.split('.')
            package = '.'.join(modpath[:-1])
            package_dir = build_py.get_package_dir(package)
            src = os.path.join(self.build_lib, package_dir)

            # copy whole directory
            copy_tree(src, package_dir)
Beispiel #5
0
 def build_extension(self, ext):
     build_py = self.get_finalized_command('build_py')
     package_dir = os.path.abspath(build_py.get_package_dir(''))
     bin_path = os.path.join(package_dir, self.get_ext_filename(ext.name))
     target_path = self.get_ext_fullpath(ext.name)
     self.copy_file(bin_path, target_path)
Beispiel #6
0
 def run(self):
     base_class_2.run(self)
     if self.inplace:
         build_py = self.get_finalized_command('build_py')
         output_path = build_py.get_package_dir(module_name)
         generate_mod(self, output_path)