Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
e8916685
Unverified
Commit
e8916685
authored
Aug 26, 2018
by
Nikita Titov
Committed by
GitHub
Aug 26, 2018
Browse files
[python] copy files silently during the installation (#1617)
parent
c5156fe0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
python-package/setup.py
python-package/setup.py
+11
-6
No files found.
python-package/setup.py
View file @
e8916685
...
...
@@ -36,7 +36,7 @@ def copy_files(use_gpu=False):
if
os
.
path
.
exists
(
src
):
dst
=
os
.
path
.
join
(
CURRENT_DIR
,
'compile'
,
folder_name
)
shutil
.
rmtree
(
dst
,
ignore_errors
=
True
)
distutils
.
dir_util
.
copy_tree
(
src
,
dst
)
distutils
.
dir_util
.
copy_tree
(
src
,
dst
,
verbose
=
0
)
else
:
raise
Exception
(
'Cannot copy {0} folder'
.
format
(
src
))
...
...
@@ -46,15 +46,19 @@ def copy_files(use_gpu=False):
if
not
os
.
path
.
exists
(
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"
),
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"
),
os
.
path
.
join
(
CURRENT_DIR
,
"compile"
,
"windows"
,
"LightGBM.vcxproj"
))
os
.
path
.
join
(
CURRENT_DIR
,
"compile"
,
"windows"
,
"LightGBM.vcxproj"
),
verbose
=
0
)
if
use_gpu
:
copy_files_helper
(
'compute'
)
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"
),
os
.
path
.
join
(
CURRENT_DIR
,
"LICENSE"
))
os
.
path
.
join
(
CURRENT_DIR
,
"LICENSE"
),
verbose
=
0
)
def
clear_path
(
path
):
...
...
@@ -242,7 +246,8 @@ if __name__ == "__main__":
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'
)):
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
()
readme
=
io
.
open
(
os
.
path
.
join
(
CURRENT_DIR
,
'README.rst'
),
encoding
=
'utf-8'
).
read
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment