def run(self):
build_py.create_version_file()
setuptools.command.develop.develop.run(self)
python类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)
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")