Changes in run.py [952ea1f:bc8b8a1] in sasview
Legend:
- Unmodified
- Added
- Removed
-
run.py
r952ea1f rbc8b8a1 67 67 68 68 69 def prepare( rebuild=True):69 def prepare(): 70 70 # Don't create *.pyc files 71 71 sys.dont_write_bytecode = True … … 95 95 try: 96 96 import periodictable 97 except ImportError:97 except: 98 98 addpath(joinpath(root, '..', 'periodictable')) 99 99 100 100 try: 101 101 import bumps 102 except ImportError:102 except: 103 103 addpath(joinpath(root, '..', 'bumps')) 104 104 105 105 try: 106 106 import tinycc 107 except ImportError:107 except: 108 108 addpath(joinpath(root, '../tinycc/build/lib')) 109 109 … … 111 111 #addpath(os.path.join(root, '..','wxPython-src-3.0.0.0','wxPython')) 112 112 113 # Put the sas source tree on the path 114 addpath(joinpath(root, 'src')) 115 116 # Put sasmodels on the path 117 addpath(joinpath(root, '../sasmodels/')) 118 119 # Check if the C extensions are already built 120 try: 121 from sas.sascalc.pr import _pr_inversion 122 from sas.sascalc.calculator import _sld2i 123 from sas.sascalc.file_converter import _bsl_loader 124 except ImportError: 125 rebuild = True 126 127 # Build C extensions if necessary. Do an inplace build to simplify path. 128 if rebuild: 113 # Build project if the build directory does not already exist. 114 # PAK: with "update" we can always build since it is fast 115 if True or not os.path.exists(build_path): 129 116 import subprocess 130 build_cmd = [sys.executable, "setup.py", "build _ext", "--inplace", "update"]117 build_cmd = [sys.executable, "setup.py", "build", "update"] 131 118 if os.name == 'nt': 132 119 build_cmd.append('--compiler=tinycc') … … 135 122 with cd(root): 136 123 subprocess.call(build_cmd, shell=shell) 124 125 # Put the source trees on the path 126 addpath(joinpath(root, 'src')) 127 128 # sasmodels on the path 129 addpath(joinpath(root, '../sasmodels/')) 130 131 # The sas.models package Compiled Model files should be pulled in from the build directory even though 132 # the source is stored in src/sas/models. 133 134 # Compiled modules need to be pulled from the build directory. 135 # Some packages are not where they are needed, so load them explicitly. 136 import sas.sascalc.pr 137 sas.sascalc.pr.core = import_package('sas.sascalc.pr.core', 138 joinpath(build_path, 'sas', 'sascalc', 'pr', 'core')) 139 140 # Compiled modules need to be pulled from the build directory. 141 # Some packages are not where they are needed, so load them explicitly. 142 import sas.sascalc.file_converter 143 sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core', 144 joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core')) 145 146 import sas.sascalc.calculator 147 sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 148 joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core')) 149 150 sys.path.append(build_path) 137 151 138 152 set_git_tag()
Note: See TracChangeset
for help on using the changeset viewer.