Skip to content

Commit

Permalink
Simplify get_all_cmake_lists - get them all.. #830
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-khropov committed Mar 29, 2023
1 parent dd8383a commit aee914a
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions catboost/python-package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,11 @@ def get_setup_requires(argv):
return setup_requires


def get_all_cmake_lists(base_dir, add_android=True):
files_list = [
'CMakeLists.darwin-arm64.txt',
'CMakeLists.darwin-x86_64.txt',
'CMakeLists.linux-aarch64.txt',
'CMakeLists.linux-x86_64-cuda.txt',
'CMakeLists.linux-x86_64.txt',
'CMakeLists.windows-x86_64-cuda.txt',
'CMakeLists.windows-x86_64.txt',
'CMakeLists.txt',
def get_all_cmake_lists(topdir, sub_path):
return [
os.path.join(sub_path, f) for f in os.listdir(os.path.join(topdir, sub_path))
if f.startswith('CMakeLists')
]
if add_android:
files_list += [
'CMakeLists.android-arm.txt',
'CMakeLists.android-arm64.txt',
'CMakeLists.android-x86.txt',
'CMakeLists.android-x86_64.txt',
]
return [os.path.join(base_dir, f) for f in files_list]

def copy_catboost_sources(topdir, pkgdir, verbose, dry_run):
topnames = [
Expand All @@ -134,9 +120,9 @@ def copy_catboost_sources(topdir, pkgdir, verbose, dry_run):
'tools',
'util',
]
topnames += get_all_cmake_lists('')
topnames += get_all_cmake_lists('catboost')
topnames += get_all_cmake_lists(os.path.join('catboost', 'python-package'), add_android=False)
topnames += get_all_cmake_lists(topdir, '')
topnames += get_all_cmake_lists(topdir, 'catboost')
topnames += get_all_cmake_lists(topdir, os.path.join('catboost', 'python-package'))
for name in topnames:
src = os.path.join(topdir, name)
dst = os.path.join(pkgdir, name)
Expand Down

0 comments on commit aee914a

Please sign in to comment.