Changeset 80c2c85 in sasview for sasview/setup_exe.py
- Timestamp:
- Jun 28, 2016 3:10:33 PM (8 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:
- 3aa2f3c
- Parents:
- 899e084 (diff), 5552396 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/setup_exe.py
r5552396 r899e084 33 33 root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 34 34 platform = '%s-%s'%(get_platform(), sys.version[:3]) 35 build_path = os.path.join(root, 'build', 'lib.'+platform) 36 #build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages') 35 build_path = os.path.join(root, 'sasview-install', 'Lib', 'site-packages') 37 36 sys.path.insert(0, build_path) 38 39 import local_config 37 doc_path = os.path.join(root, 'build', 'lib.'+platform, 'doc') 38 39 from sas.sasview import local_config 40 40 from installer_generator import generate_installer 41 41 … … 174 174 path = os.getcwd() 175 175 176 media_dir = os.path.join(path, "media")177 images_dir = os.path.join(path, "images")178 test_dir = os.path.join(path, "test")179 test_1d_dir = os.path.join(path, "test\\1d_data")180 test_2d_dir = os.path.join(path, "test\\2d_data")181 test_save_dir = os.path.join(path, "test\\save_states")182 test_upcoming_dir = os.path.join(path, "test\\upcoming_formats")183 184 176 matplotlibdatadir = matplotlib.get_data_path() 185 177 matplotlibdata = findall(matplotlibdatadir) … … 188 180 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 189 181 190 data_files= []182 DATA_FILES = [] 191 183 192 184 if tinycc: 193 data_files+= tinycc.data_files()185 DATA_FILES += tinycc.data_files() 194 186 195 187 # Copying SLD data 196 188 import periodictable 197 data_files+= periodictable.data_files()198 199 import sas.sasgui.perspectives.fitting asfitting200 data_files+= fitting.data_files()201 202 import sas.sasgui.perspectives.calculator ascalculator203 data_files+= calculator.data_files()204 205 import sas.sasgui.perspectives.invariant asinvariant206 data_files+= invariant.data_files()207 208 import sas.sasgui.guiframe asguiframe209 data_files+= guiframe.data_files()189 DATA_FILES += periodictable.data_files() 190 191 from sas.sasgui.perspectives import fitting 192 DATA_FILES += fitting.data_files() 193 194 from sas.sasgui.perspectives import calculator 195 DATA_FILES += calculator.data_files() 196 197 from sas.sasgui.perspectives import invariant 198 DATA_FILES += invariant.data_files() 199 200 from sas.sasgui import guiframe 201 DATA_FILES += guiframe.data_files() 210 202 211 203 # precompile sas models into the sasview build path; doesn't matter too much … … 217 209 # include the compiled models as data; coordinate the target path for the 218 210 # data with installer_generator.py 219 data_files.append(('compiled_models', compiled_dlls))211 DATA_FILES.append(('compiled_models', compiled_dlls)) 220 212 221 213 import sasmodels 222 data_files+= sasmodels.data_files()214 DATA_FILES += sasmodels.data_files() 223 215 224 216 for f in matplotlibdata: 225 217 dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:]) 226 data_files.append((os.path.split(dirname)[0], [f]))218 DATA_FILES.append((os.path.split(dirname)[0], [f])) 227 219 228 220 # Copy the settings file for the sas.dataloader file extension associations 229 import sas.sascalc.dataloader.readers 230 f = os.path.join(sas.sascalc.dataloader.readers.get_data_path(), 'defaults.json') 231 if os.path.isfile(f): 232 data_files.append(('.', [f])) 233 f = 'custom_config.py' 234 if os.path.isfile(f): 235 data_files.append(('.', [f])) 236 data_files.append(('config', [f])) 237 f = 'local_config.py' 238 if os.path.isfile(f): 239 data_files.append(('.', [f])) 240 241 f = 'default_categories.json' 242 if os.path.isfile(f): 243 data_files.append(('.', [f])) 221 from sas.sascalc.dataloader import readers 222 reader_config = os.path.join(readers.get_data_path(), 'defaults.json') 223 if os.path.isfile(reader_config): 224 DATA_FILES.append(('.', [reader_config])) 225 226 # Copy the config files 227 sasview_path = os.path.join('..','src','sas','sasview') 228 custom_config_file = os.path.join(sasview_path, 'custom_config.py') 229 local_config_file = os.path.join(sasview_path, 'local_config.py') 230 DATA_FILES.append(('.', [custom_config_file])) 231 DATA_FILES.append(('config', [custom_config_file])) 232 DATA_FILES.append(('.', [local_config_file])) 233 234 # default_categories.json is beside the config files 235 category_config = os.path.join(os.path.dirname(local_config_file), 236 'default_categories.json') 237 if os.path.isfile(category_config): 238 DATA_FILES.append(('.', [category_config])) 244 239 245 240 if os.path.isfile("BUILD_NUMBER"): 246 data_files.append(('.', ["BUILD_NUMBER"])) 241 DATA_FILES.append(('.', ["BUILD_NUMBER"])) 242 243 images_dir = local_config.icon_path 244 media_dir = local_config.media_path 245 images_dir = local_config.icon_path 246 test_dir = local_config.test_path 247 test_1d_dir = os.path.join(test_dir, "1d_data") 248 test_2d_dir = os.path.join(test_dir, "2d_data") 249 test_save_dir = os.path.join(test_dir, "save_states") 250 test_upcoming_dir = os.path.join(test_dir, "upcoming_formats") 247 251 248 252 # Copying the images directory to the distribution directory. 249 253 for f in findall(images_dir): 250 if not ".svn" in f: 251 data_files.append(("images", [f])) 254 DATA_FILES.append(("images", [f])) 252 255 253 256 # Copying the HTML help docs 254 257 for f in findall(media_dir): 255 if not ".svn" in f: 256 data_files.append(("media", [f])) 258 DATA_FILES.append(("media", [f])) 257 259 258 260 # Copying the sample data user data 259 261 for f in findall(test_1d_dir): 260 if not ".svn" in f: 261 data_files.append(("test\\1d_data", [f])) 262 DATA_FILES.append(("test\\1d_data", [f])) 262 263 263 264 # Copying the sample data user data 264 265 for f in findall(test_2d_dir): 265 if not ".svn" in f: 266 data_files.append(("test\\2d_data", [f])) 266 DATA_FILES.append(("test\\2d_data", [f])) 267 267 268 268 # Copying the sample data user data 269 269 for f in findall(test_save_dir): 270 if not ".svn" in f: 271 data_files.append(("test\\save_states", [f])) 270 DATA_FILES.append(("test\\save_states", [f])) 272 271 273 272 # Copying the sample data user data 274 273 for f in findall(test_upcoming_dir): 275 if not ".svn" in f: 276 data_files.append(("test\\upcoming_formats", [f])) 274 DATA_FILES.append(("test\\upcoming_formats", [f])) 277 275 278 276 # Copying opencl include files 279 277 for f in findall(opencl_include_dir): 280 data_files.append(("includes\\pyopencl",[f]))278 DATA_FILES.append(("includes\\pyopencl", [f])) 281 279 282 280 # See if the documentation has been built, and if so include it. 283 doc_path = os.path.join(build_path, "doc")284 281 if os.path.exists(doc_path): 285 282 for dirpath, dirnames, filenames in os.walk(doc_path): 286 283 for filename in filenames: 287 284 sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 288 data_files.append((sub_dir, [os.path.join(dirpath, filename)]))285 DATA_FILES.append((sub_dir, [os.path.join(dirpath, filename)])) 289 286 else: 290 287 raise Exception("You must first build the documentation before creating an installer.") … … 292 289 if msvcrtdll_data_files is not None: 293 290 # install the MSVC 9 runtime dll's into the application folder 294 data_files.append(msvcrtdll_data_files)291 DATA_FILES.append(msvcrtdll_data_files) 295 292 296 293 # NOTE: … … 316 313 ]) 317 314 packages.append('periodictable.core') # not found automatically 318 #packages.append('IPython') 315 # For an interactive interpreter, SasViewCom 316 packages.extend(['IPython','pyreadline','pyreadline.unicode_helper']) 317 318 # individual models 319 319 includes = ['site', 'lxml._elementpath', 'lxml.etree'] 320 320 … … 331 331 'tcl84.dll', 'tk84.dll', 'QtGui4.dll', 'QtCore4.dll', 332 332 # numpy 1.8 openmp bindings (still seems to use all the cores without them) 333 # ... but we seem to need them when building from anaconda, so don't exclude ... 333 334 #'libiomp5md.dll', 'libifcoremd.dll', 'libmmd.dll', 'svml_dispmd.dll','libifportMD.dll', 334 335 # microsoft C runtime (not allowed to ship with the app; need to ship vcredist … … 342 343 ] 343 344 345 # extra dlls not found automatically 346 python_root = os.path.dirname(os.path.abspath(sys.executable)) 347 dll_path = os.path.join(python_root, 'Library', 'bin') 348 # the following are found already: 'mkl_intel_thread', 'libmmd', 'libifcoremd' 349 dll_includes = ['mkl_core', 'mkl_def', 'libiomp5md'] 350 dll_includes = [os.path.join(dll_path, dll+'.dll') for dll in dll_includes] 351 dll_includes = [dll for dll in dll_includes if os.path.exists(dll)] 352 if dll_includes: 353 DATA_FILES.append(('.', dll_includes)) 354 344 355 target_wx_client = Target( 345 356 description = 'SasView', 346 script = 'sasview .py',347 icon_resources = [(1, os.path.join(images_dir, "ball.ico"))],357 script = 'sasview_gui.py', 358 icon_resources = [(1, local_config.SetupIconFile_win)], 348 359 other_resources = [(24, 1, manifest)], 349 360 dest_base = "SasView" 350 361 ) 362 363 target_console_client = Target( 364 description = 'SasView console', 365 script = 'sasview_console.py', 366 icon_resources = [(1, local_config.SetupIconFile_win)], 367 other_resources = [(24, 1, manifest)], 368 dest_base = "SasViewCom" 369 ) 351 370 352 371 bundle_option = 2 … … 360 379 setup( 361 380 windows=[target_wx_client], 362 console=[ ],381 console=[target_console_client], 363 382 options={ 364 383 'py2exe': { … … 372 391 }, 373 392 }, 374 data_files= data_files,393 data_files=DATA_FILES, 375 394 )
Note: See TracChangeset
for help on using the changeset viewer.