我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用distutils.command.build_ext.build_ext.finalize_options()。
def finalize_options(self): if self.parallel: try: self.parallel = int(self.parallel) except ValueError: raise ValueError("--parallel/-j argument must be an integer") # Ensure that self.include_dirs and self.distribution.include_dirs # refer to the same list object. finalize_options will modify # self.include_dirs, but self.distribution.include_dirs is used # during the actual build. # self.include_dirs is None unless paths are specified with # --include-dirs. # The include paths will be passed to the compiler in the order: # numpy paths, --include-dirs paths, Python include path. if isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) incl_dirs = self.include_dirs or [] if self.distribution.include_dirs is None: self.distribution.include_dirs = [] self.include_dirs = self.distribution.include_dirs self.include_dirs.extend(incl_dirs) old_build_ext.finalize_options(self) self.set_undefined_options('build', ('parallel', 'parallel'))
def finalize_options (self): if self.library_dirs is None: self.library_dirs = [] elif isinstance(self.library_dirs, basestring): self.library_dirs = self.library_dirs.split(os.pathsep) self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs")) old_build_ext.finalize_options(self)
def finalize_options(self): build = self.get_finalized_command('build') self.build_purelib = build.build_purelib self.build_platlib = build.build_platlib
def finalize_options(self): pass
def finalize_options(self): build.finalize_options(self)
def finalize_options(self): """Set final values for all build_pg options.""" build_ext.finalize_options(self) if self.direct_access: define_macros.append(('DIRECT_ACCESS', None)) if self.large_objects: define_macros.append(('LARGE_OBJECTS', None)) if self.default_vars: define_macros.append(('DEFAULT_VARS', None)) if self.escaping_funcs and pg_version[0] >= 9: define_macros.append(('ESCAPING_FUNCS', None)) if sys.platform == 'win32': bits = platform.architecture()[0] if bits == '64bit': # we need to find libpq64 for path in os.environ['PATH'].split(os.pathsep) + [ r'C:\Program Files\PostgreSQL\libpq64']: library_dir = os.path.join(path, 'lib') if not os.path.isdir(library_dir): continue lib = os.path.join(library_dir, 'libpqdll.') if not (os.path.exists(lib + 'lib') or os.path.exists(lib + 'a')): continue include_dir = os.path.join(path, 'include') if not os.path.isdir(include_dir): continue if library_dir not in library_dirs: library_dirs.insert(1, library_dir) if include_dir not in include_dirs: include_dirs.insert(1, include_dir) libraries[0] += 'dll' # libpqdll instead of libpq break compiler = self.get_compiler() if compiler == 'mingw32': # MinGW if bits == '64bit': # needs MinGW-w64 define_macros.append(('MS_WIN64', None)) elif compiler == 'msvc': # Microsoft Visual C++ libraries[0] = 'lib' + libraries[0] extra_compile_args[1:] = ['-J', '-W3', '-WX']