我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用setuptools.command.develop()。
def run(self): build_py.create_version_file() setuptools.command.develop.develop.run(self)
def run(self): build_py.create_version_file() setuptools.command.develop.develop.run(self) self.create_compile_commands()
def create_compile_commands(self): def load(filename): with open(filename) as f: return json.load(f) ninja_files = glob.glob('build/*_compile_commands.json') cmake_files = glob.glob('torch/lib/build/*/compile_commands.json') all_commands = [entry for f in ninja_files + cmake_files for entry in load(f)] with open('compile_commands.json', 'w') as f: json.dump(all_commands, f, indent=2) if not WITH_NINJA: print("WARNING: 'develop' is not building C++ code incrementally") print("because ninja is not installed. Run this to enable it:") print(" > pip install ninja")