Changeset 92df9cbd in sasview
- 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
- Location:
- installers
- Files:
-
- 2 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], -
installers/setup_mac.py
r0ccbd36 r92df9cbd 24 24 from setuptools import setup 25 25 26 import macholib_patch 27 28 if os.path.abspath(os.path.dirname(__file__))!= os.path.abspath(os.getcwd()):26 # Need the installer dir on the python path to find helper modules 27 installer_dir = os.path.abspath(os.path.dirname(__file__)) 28 if installer_dir != os.path.abspath(os.getcwd()): 29 29 raise RuntimeError("Must run setup_exe from the installers directory") 30 sys.path.append(installer_dir) 30 31 31 32 # put the build directory at the front of the path … … 39 40 #Extending recursion limit 40 41 sys.setrecursionlimit(10000) 42 43 import macholib_patch 41 44 42 45 from sas.sasview import local_config … … 79 82 80 83 # Copying the images directory to the distribution directory. 81 images_dir = local_config.icon_path 82 for f in findall(images_dir): 83 data_files.append(("images", [f])) 84 data_files.append(("images", findall(local_config.icon_path))) 84 85 85 86 # Copying the HTML help docs 86 media_dir = local_config.media_path 87 for f in findall(media_dir): 88 data_files.append(("media", [f])) 87 data_files.append(("media", findall(local_config.media_path))) 89 88 90 89 # Copying the sample data user data 91 90 test_dir = local_config.test_path 92 for f in findall(os.path.join(test_dir, "1d_data")): 93 data_files.append((os.path.join("test", "1d_data"), [f])) 94 for f in findall(os.path.join(test_dir, "2d_data")): 95 data_files.append((os.path.join("test", "2d_data"), [f])) 96 for f in findall(os.path.join(test_dir, "save_states")): 97 data_files.append((os.path.join("test", "save_states"), [f])) 98 for f in findall(os.path.join(test_dir, "upcoming_formats")): 99 data_files.append((os.path.join("test", "upcoming_formats"), [f])) 91 for dirpath, dirnames, filenames in os.walk(test_dir): 92 target_dir = os.path.join("test", os.path.relpath(dirpath, test_dir)) 93 source_files = [os.path.join(dirpath, f) for f in filenames] 94 data_files.append((target_dir, source_files)) 100 95 101 96 # See if the documentation has been built, and if so include it. 102 97 if os.path.exists(doc_path): 103 98 for dirpath, dirnames, filenames in os.walk(doc_path): 104 for filename in filenames:105 sub_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path))106 data_files.append((sub_dir, [os.path.join(dirpath, filename)]))99 target_dir = os.path.join("doc", os.path.relpath(dirpath, doc_path)) 100 source_files = [os.path.join(dirpath, f) for f in filenames] 101 data_files.append((target_dir, source_files)) 107 102 else: 108 103 raise Exception("You must first build the documentation before creating an installer.") 109 104 110 105 # Copying opencl include files 111 site_loc = get_python_lib() 112 opencl_include_dir = os.path.join(site_loc, "pyopencl", "cl") 113 for f in findall(opencl_include_dir): 114 data_files.append((os.path.join("includes", "pyopencl"), [f])) 106 opencl_source = os.path.join(get_python_lib(), "pyopencl", "cl") 107 opencl_target = os.path.join("includes", "pyopencl") 108 data_files.append((opencl_target, findall(opencl_source))) 115 109 116 110 # Locate libxml2 library … … 186 180 'excludes' : EXCLUDES, 187 181 } 182 183 #import pprint; pprint.pprint(data_files); sys.exit() 188 184 setup( 189 185 name=APPNAME,
Note: See TracChangeset
for help on using the changeset viewer.