From 56d6d2c45a4a5c7b8a53d1da25f7c8ab615e3c75 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Wed, 27 Jul 2022 11:48:02 +0200 Subject: [PATCH] Also include `Engines` sub-directories (issue #687). --- python/setup.py.in | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python/setup.py.in b/python/setup.py.in index e50d02c67..77e121284 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -214,13 +214,15 @@ for d in os.scandir('data/aircraft'): data_files.append(('share/${PROJECT_NAME}/'+dir_name, list(XML_files(dir_name)))) - # Some aircraft folders include a `Systems` sub-directory: make sure it - # is copied in the wheel archive. - systems_dir = dir_name + '/Systems' - systems_dir_fullname = os.path.join('data', systems_dir) - if os.path.exists(systems_dir_fullname) and os.path.isdir(systems_dir_fullname): - data_files.append(('share/${PROJECT_NAME}/'+systems_dir, - list(XML_files(systems_dir)))) + # Some aircraft folders include a `Systems` and/or an `Engines` + # sub-directory so make sure it is copied in the wheel archive + # (see GH issue #687) + for sub_dir in ('Systems', 'Engines'): + sub_dir_name = dir_name + '/' + sub_dir + subdir_dir_fullname = os.path.join('data', sub_dir_name) + if os.path.exists(subdir_dir_fullname) and os.path.isdir(subdir_dir_fullname): + data_files.append(('share/${PROJECT_NAME}/'+sub_dir_name, + list(XML_files(sub_dir_name)))) # Build & installation process for the JSBSim Python module setup(