Unverified Commit e8916685 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[python] copy files silently during the installation (#1617)

parent c5156fe0
...@@ -36,7 +36,7 @@ def copy_files(use_gpu=False): ...@@ -36,7 +36,7 @@ def copy_files(use_gpu=False):
if os.path.exists(src): if os.path.exists(src):
dst = os.path.join(CURRENT_DIR, 'compile', folder_name) dst = os.path.join(CURRENT_DIR, 'compile', folder_name)
shutil.rmtree(dst, ignore_errors=True) shutil.rmtree(dst, ignore_errors=True)
distutils.dir_util.copy_tree(src, dst) distutils.dir_util.copy_tree(src, dst, verbose=0)
else: else:
raise Exception('Cannot copy {0} folder'.format(src)) raise Exception('Cannot copy {0} folder'.format(src))
...@@ -46,15 +46,19 @@ def copy_files(use_gpu=False): ...@@ -46,15 +46,19 @@ def copy_files(use_gpu=False):
if not os.path.exists(os.path.join(CURRENT_DIR, "compile", "windows")): if not os.path.exists(os.path.join(CURRENT_DIR, "compile", "windows")):
os.makedirs(os.path.join(CURRENT_DIR, "compile", "windows")) os.makedirs(os.path.join(CURRENT_DIR, "compile", "windows"))
distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.sln"), distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.sln"),
os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.sln")) os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.sln"),
verbose=0)
distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.vcxproj"), distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "windows", "LightGBM.vcxproj"),
os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.vcxproj")) os.path.join(CURRENT_DIR, "compile", "windows", "LightGBM.vcxproj"),
verbose=0)
if use_gpu: if use_gpu:
copy_files_helper('compute') copy_files_helper('compute')
distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "CMakeLists.txt"), distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "CMakeLists.txt"),
os.path.join(CURRENT_DIR, "compile", "CMakeLists.txt")) os.path.join(CURRENT_DIR, "compile", "CMakeLists.txt"),
verbose=0)
distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "LICENSE"), distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, "LICENSE"),
os.path.join(CURRENT_DIR, "LICENSE")) os.path.join(CURRENT_DIR, "LICENSE"),
verbose=0)
def clear_path(path): def clear_path(path):
...@@ -242,7 +246,8 @@ if __name__ == "__main__": ...@@ -242,7 +246,8 @@ if __name__ == "__main__":
LOG_NOTICE = "The full version of error log was saved into {0}".format(LOG_PATH) LOG_NOTICE = "The full version of error log was saved into {0}".format(LOG_PATH)
if os.path.isfile(os.path.join(CURRENT_DIR, os.path.pardir, 'VERSION.txt')): if os.path.isfile(os.path.join(CURRENT_DIR, os.path.pardir, 'VERSION.txt')):
distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, 'VERSION.txt'), distutils.file_util.copy_file(os.path.join(CURRENT_DIR, os.path.pardir, 'VERSION.txt'),
os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt')) os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'),
verbose=0)
version = io.open(os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'), encoding='utf-8').read().strip() version = io.open(os.path.join(CURRENT_DIR, 'lightgbm', 'VERSION.txt'), encoding='utf-8').read().strip()
readme = io.open(os.path.join(CURRENT_DIR, 'README.rst'), encoding='utf-8').read() readme = io.open(os.path.join(CURRENT_DIR, 'README.rst'), encoding='utf-8').read()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment