Changeset 92df9cbd in sasview for installers/setup_exe.py
- Timestamp:
- Sep 20, 2017 7:27:53 PM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 488f3a5
- Parents:
- 1693141
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
installers/setup_exe.py
r460d3a1 r92df9cbd 25 25 from distutils.filelist import findall 26 26 from distutils.sysconfig import get_python_lib 27 import py2exe28 27 29 28 #from idlelib.PyShell import warning_stream 30 29 30 # Need the installer dir on the python path to find helper modules 31 installer_dir = os.path.abspath(os.path.dirname(__file__)) 32 if installer_dir != os.path.abspath(os.getcwd()): 33 raise RuntimeError("Must run setup_exe from the installers directory") 34 sys.path.append(installer_dir) 35 36 # Need the installer dir on the python path to find helper modules 31 37 if os.path.abspath(os.path.dirname(__file__)) != os.path.abspath(os.getcwd()): 32 38 raise RuntimeError("Must run setup_exe from the installers directory") 39 sys.path.append(installer_dir) 33 40 34 41 # put the build directory at the front of the path … … 159 166 self.name = "SasView" 160 167 161 #162 # Adapted from http://www.py2exe.org/index.cgi/MatPlotLib163 # to use the MatPlotLib.164 #165 matplotlibdatadir = matplotlib.get_data_path()166 matplotlibdata = findall(matplotlibdatadir)167 168 168 data_files = [] 169 169 … … 175 175 data_files += periodictable.data_files() 176 176 177 for f in matplotlibdata: 178 dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:]) 179 data_files.append((os.path.split(dirname)[0], [f])) 177 # 178 # Adapted from http://www.py2exe.org/index.cgi/MatPlotLib 179 # to use the MatPlotLib. 180 # 181 mpl_dir = matplotlib.get_data_path() 182 for dirpath, dirnames, filenames in os.walk(mpl_dir): 183 target_dir = os.path.join("mpl-data", os.path.relpath(dirpath, mpl_dir)) 184 source_files = [os.path.join(dirpath, f) for f in filenames] 185 data_files.append((target_dir, source_files)) 180 186 181 187 import sasmodels … … 219 225 220 226 # Copying the images directory to the distribution directory. 221 images_dir = local_config.icon_path 222 for f in findall(images_dir): 223 data_files.append(("images", [f])) 227 data_files.append(("images", findall(local_config.icon_path))) 224 228 225 229 # Copying the HTML help docs 226 media_dir = local_config.media_path 227 for f in findall(media_dir): 228 data_files.append(("media", [f])) 230 data_files.append(("media", findall(local_config.media_path))) 229 231 230 232 # Copying the sample data user data 231 233 test_dir = local_config.test_path 232 for f in findall(os.path.join(test_dir, "1d_data")): 233 data_files.append((os.path.join("test", "1d_data"), [f])) 234 for f in findall(os.path.join(test_dir, "2d_data")): 235 data_files.append((os.path.join("test", "2d_data"), [f])) 236 for f in findall(os.path.join(test_dir, "save_states")): 237 data_files.append((os.path.join("test", "save_states"), [f])) 238 for f in findall(os.path.join(test_dir, "upcoming_formats")): 239 data_files.append((os.path.join("test", "upcoming_formats"), [f])) 234 for dirpath, dirnames, filenames in os.walk(test_dir): 235 target_dir = os.path.join("test", os.path.relpath(dirpath, test_dir)) 236 source_files = [os.path.join(dirpath, f) for f in filenames] 237 data_files.append((target_dir, source_files)) 240 238 241 239 # See if the documentation has been built, and if so include it. 242 240 if os.path.exists(doc_path): 243 241 for dirpath, dirnames, filenames in os.walk(doc_path): 244 for filename in filenames:245 sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path))246 data_files.append((sub_dir, [os.path.join(dirpath, filename)]))242 target_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 243 source_files = [os.path.join(dirpath, f) for f in filenames] 244 data_files.append((target_dir, source_files)) 247 245 else: 248 246 raise Exception("You must first build the documentation before creating an installer.") 249 247 250 248 # Copying opencl include files 251 site_loc = get_python_lib() 252 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 253 for f in findall(opencl_include_dir): 254 data_files.append((os.path.join("includes", "pyopencl"), [f])) 249 opencl_source = os.path.join(get_python_lib(), "pyopencl", "cl") 250 opencl_target = os.path.join("includes", "pyopencl") 251 data_files.append((opencl_target, findall(opencl_source))) 255 252 256 253 # Numerical libraries … … 357 354 #CategoryInstaller.check_install(s) 358 355 356 #import pprint; pprint.pprint(data_files); sys.exit() 357 358 import py2exe 359 359 setup( 360 360 windows=[target_wx_client],
Note: See TracChangeset
for help on using the changeset viewer.