示例#1
0
文件: setup.py 项目: ymt123/brotli
 def get_source_files(self):
     filenames = build_ext.get_source_files(self)
     for ext in self.extensions:
         filenames.extend(ext.depends)
     return filenames
示例#2
0
文件: setup.py 项目: nemequ/brotli
 def get_source_files(self):
     filenames = build_ext.get_source_files(self)
     for ext in self.extensions:
         filenames.extend(ext.depends)
     return filenames
示例#3
0
 def get_file_list(self, no_pdf=False):
     # Our own version, based on the 2.7 version plus special sauce
     self.filelist.findall()
     source_dir = self.distribution.source_dir
     if os.path.exists(os.path.join(source_dir, "README")):
         self.filelist.append(os.path.join(source_dir, "README"))
     elif os.path.exists(os.path.join(source_dir, "README.txt")):
         self.filelist.append(os.path.join(source_dir, "README.txt"))
     else:
         self.warn("standard file not found: should have one of "
                   "'README', 'README.txt'")
     if os.path.exists(os.path.join(source_dir, "GPL.txt")):
         self.filelist.append(os.path.join(source_dir, "GPL.txt"))
     else:
         self.warn("standard file 'GPL.txt' not found")
     if os.path.exists(os.path.join(source_dir, "LICENSE-OPENSOURCE.txt")):
         self.filelist.append(os.path.join(source_dir,
                                           "LICENSE-OPENSOURCE.txt"))
     else:
         self.warn("standard file 'LICENSE-OPENSOURCE.txt' not found")
     if os.path.exists(os.path.join(source_dir, "setup.py")):
         self.filelist.append(os.path.join(source_dir, "setup.py"))
     else:
         self.warn("standard file 'setup.py' not found")
     if os.path.exists(os.path.join(source_dir, "setup.cfg")):
         self.filelist.append(os.path.join(source_dir, "setup.cfg"))
     build_py = self.get_finalized_command('build_py')
     if self.distribution.has_pure_modules():
         self.filelist.extend(build_py.get_source_files())
     for pkg, src_dir, build_dir, filenames in build_py.data_files:
         for filename in filenames:
             self.filelist.append(os.path.join(src_dir, filename))
     if self.distribution.has_data_files():
         for item in self.distribution.data_files:
             if isinstance(item, str):
                 item = distutils.util.convert_path(item)
                 if os.path.isfile(item):
                     self.filelist.append(item)
             else:
                 dirname, filenames = item
                 for f in filenames:
                     f = distutils.util.convert_path(f)
                     if os.path.isfile(f):
                         self.filelist.append(f)
     if self.distribution.has_ext_modules():
         build_ext = self.get_finalized_command('build_ext')
         self.filelist.extend(build_ext.get_source_files())
     if self.distribution.has_scripts():
         build_scripts = self.get_finalized_command('build_scripts')
         for sc in build_scripts.get_source_files():
             self.filelist.append(os.path.join(source_dir, sc))
     for g in self.distribution.netsa_extra_globs:
         g = distutils.util.convert_path(g)
         g = os.path.join(source_dir, g)
         for f in glob(g):
             if os.path.isfile(f):
                 self.filelist.append(f)
             elif os.path.isdir(f):
                 self.filelist.extend(distutils.filelist.findall(f))
     for (f, _) in self.distribution.netsa_version_files:
         self.filelist.append(f)
     if not no_pdf:
         gen_doc_pdf_cmd = self.get_finalized_command('gen_doc_pdf')
         self.run_command('gen_doc_pdf')
         self.filelist.extend(gen_doc_pdf_cmd.get_source_files())
         self.filelist.extend(gen_doc_pdf_cmd.get_generated_files())
     
     self.prune_file_list()
     self.filelist.sort()
     self.filelist.remove_duplicates()