MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / copy_files

Function copy_files

python-package/setup.py:31–60  ·  view source on GitHub ↗
(use_gpu=False)

Source from the content-addressed store, hash-verified

29
30
31def copy_files(use_gpu=False):
32
33 def copy_files_helper(folder_name):
34 src = os.path.join(CURRENT_DIR, os.path.pardir, folder_name)
35 if os.path.exists(src):
36 dst = os.path.join(CURRENT_DIR, 'compile', folder_name)
37 shutil.rmtree(dst, ignore_errors=True)
38 distutils.dir_util.copy_tree(src, dst, verbose=0)
39 else:
40 raise Exception('Cannot copy {0} folder'.format(src))
41
42 if not os.path.isfile(os.path.join(CURRENT_DIR, '_IS_SOURCE_PACKAGE.txt')):
43 copy_files_helper('include')
44 copy_files_helper('src')
45 if not os.path.exists(os.path.join(CURRENT_DIR, "compile", "windows")):
46 os.makedirs(os.path.join(CURRENT_DIR, "compile", "windows"))
47 distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.sln"),
48 os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.sln"),
49 verbose=0)
50 distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.vcxproj"),
51 os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.vcxproj"),
52 verbose=0)
53 if use_gpu:
54 copy_files_helper('compute')
55 distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "CMakeLists.txt"),
56 os.path.join(CURRENT_DIR, "compile", "CMakeLists.txt"),
57 verbose=0)
58 distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "LICENSE"),
59 os.path.join(CURRENT_DIR, "LICENSE"),
60 verbose=0)
61
62
63def clear_path(path):

Callers 2

runMethod · 0.85
runMethod · 0.85

Calls 2

copy_files_helperFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected