Changes in run.py [952ea1f:bc8b8a1] in sasview


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • run.py

    r952ea1f rbc8b8a1  
    6767 
    6868 
    69 def prepare(rebuild=True): 
     69def prepare(): 
    7070    # Don't create *.pyc files 
    7171    sys.dont_write_bytecode = True 
     
    9595    try: 
    9696        import periodictable 
    97     except ImportError: 
     97    except: 
    9898        addpath(joinpath(root, '..', 'periodictable')) 
    9999 
    100100    try: 
    101101        import bumps 
    102     except ImportError: 
     102    except: 
    103103        addpath(joinpath(root, '..', 'bumps')) 
    104104 
    105105    try: 
    106106        import tinycc 
    107     except ImportError: 
     107    except: 
    108108        addpath(joinpath(root, '../tinycc/build/lib')) 
    109109 
     
    111111    #addpath(os.path.join(root, '..','wxPython-src-3.0.0.0','wxPython')) 
    112112 
    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): 
    129116        import subprocess 
    130         build_cmd = [sys.executable, "setup.py", "build_ext", "--inplace", "update"] 
     117        build_cmd = [sys.executable, "setup.py", "build", "update"] 
    131118        if os.name == 'nt': 
    132119            build_cmd.append('--compiler=tinycc') 
     
    135122        with cd(root): 
    136123            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) 
    137151 
    138152    set_git_tag() 
Note: See TracChangeset for help on using the changeset viewer.