def build_module(self, module, source, args):
keys, values = list(zip(*args.env)) or ((), ())
env = dict(zip(map(str.strip, keys), values))
with override_vars(os.environ, **env):
workdir = cache_path(module)
os.makedirs(workdir, exist_ok=True)
script_args = ['-v' if args.verbose else '-q']
script_args += ['build_ext', '--inplace', '--build-temp', workdir]
if args.force:
script_args.append('--force')
if args.compiler is not None:
script_args += ['--compiler', args.compiler]
warnings.filterwarnings('ignore', 'To exit')
setuptools.setup(
name=module,
ext_modules=[self.make_extension(module, source, args)],
script_args=script_args,
cmdclass={'build_ext': build_ext}
)
评论列表
文章目录