Changeset 5980b1a in sasview for setup.py


Ignore:
Timestamp:
Oct 9, 2013 11:43:43 AM (11 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
17b1873
Parents:
cc3066a
Message:

Clean up setup.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    r79d5b6c r5980b1a  
    55import sys 
    66import os 
    7 import platform 
    8 import shutil 
    9 from setuptools import setup, Extension, find_packages 
     7from setuptools import setup, Extension 
    108from distutils.command.build_ext import build_ext 
    119 
     
    5654    f_path = os.path.join(sans_dir, 'plugin_models') 
    5755    if os.path.isdir(f_path): 
    58         for file in os.listdir(f_path):  
    59             if file in plugin_model_list: 
    60                 file_path =  os.path.join(f_path, file) 
     56        for f in os.listdir(f_path):  
     57            if f in plugin_model_list: 
     58                file_path =  os.path.join(f_path, f) 
    6159                os.remove(file_path) 
    6260                     
     
    9391        if enable_openmp: 
    9492            if copt.has_key(c): 
    95                for e in self.extensions: 
    96                    e.extra_compile_args = copt[ c ] 
     93                for e in self.extensions: 
     94                    e.extra_compile_args = copt[ c ] 
    9795            if lopt.has_key(c): 
    9896                for e in self.extensions: 
     
    106104        build_ext.build_extensions(self) 
    107105 
     106# sans module 
     107package_dir["sans"] = os.path.join("src", "sans") 
     108packages.append("sans") 
    108109 
    109110# sans.invariant 
     
    118119packages.extend(["sans.guiframe", "sans.guiframe.local_perspectives"]) 
    119120# build local plugin 
    120 for dir in os.listdir(os.path.join(guiframe_path, "local_perspectives")): 
    121     if dir not in ['.svn','__init__.py', '__init__.pyc']: 
    122         package_name = "sans.guiframe.local_perspectives." + dir 
     121for d in os.listdir(os.path.join(guiframe_path, "local_perspectives")): 
     122    if d not in ['.svn','__init__.py', '__init__.pyc']: 
     123        package_name = "sans.guiframe.local_perspectives." + d 
    123124        packages.append(package_name) 
    124         package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", dir) 
     125        package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", d) 
    125126 
    126127# sans.dataloader 
     
    216217if not os.name=='nt': 
    217218    IGNORED_FILES.extend(["gamma_win.c","winFuncs.c"]) 
    218  
    219219 
    220220EXTENSIONS = [".c", ".cpp"] 
     
    247247append_file(file_list=smear_sources, dir_path=smear_dir) 
    248248         
     249package_dir["sans.models"] = model_dir 
     250package_dir["sans.models.sans_extension"] = os.path.join("src", "sans", "models", "sans_extension") 
     251package_data['sans.models'] = [os.path.join('media', "*.*")] 
     252package_data['sans.models'] += [os.path.join('media','img', "*.*")] 
     253packages.extend(["sans.models","sans.models.sans_extension"]) 
     254     
     255smearer_sources = [os.path.join(smear_dir, "smearer.cpp"), 
     256                  os.path.join(smear_dir, "smearer_module.cpp")] 
     257geni_sources = [os.path.join(gen_dir, "sld2i_module.cpp")] 
     258if os.name=='nt': 
     259    smearer_sources.append(os.path.join(igordir, "winFuncs.c")) 
     260    geni_sources.append(os.path.join(igordir, "winFuncs.c")) 
     261ext_modules.extend( [ Extension("sans.models.sans_extension.c_models", 
     262                                sources=model_sources,                  
     263                                include_dirs=[igordir, includedir,  
     264                                              c_model_dir, numpy_incl_path, cephes_dir], 
     265                                ),        
     266                    # Smearer extension 
     267                    Extension("sans.models.sans_extension.smearer", 
     268                              sources = smearer_sources, 
     269                              include_dirs=[igordir,  
     270                                            smear_dir, numpy_incl_path], 
     271                              ), 
     272                     
     273                    Extension("sans.models.sans_extension.smearer2d_helper", 
     274                              sources = [os.path.join(smear_dir,  
     275                                                "smearer2d_helper_module.cpp"), 
     276                                         os.path.join(smear_dir,  
     277                                                "smearer2d_helper.cpp"),], 
     278                              include_dirs=[smear_dir, numpy_incl_path], 
     279                              ), 
     280                     
     281                    Extension("sans.models.sans_extension.sld2i", 
     282                              sources = [os.path.join(gen_dir,  
     283                                                "sld2i_module.cpp"), 
     284                                         os.path.join(gen_dir,  
     285                                                "sld2i.cpp"), 
     286                                         os.path.join(c_model_dir,  
     287                                                "libfunc.c"), 
     288                                         os.path.join(c_model_dir,  
     289                                                "librefl.c"),], 
     290                              include_dirs=[gen_dir, includedir,  
     291                                            c_model_dir, numpy_incl_path], 
     292                              ) 
     293                    ] ) 
     294         
    249295# SasView 
    250296 
     
    264310    required.extend(['pil']) 
    265311    
    266  # Set up SasView     
     312# Set up SasView     
    267313setup( 
    268314    name="sasview", 
     
    271317    author = "University of Tennessee", 
    272318    author_email = "sansdanse@gmail.com", 
    273     url = "http://danse.chem.utk.edu", 
     319    url = "http://sasview.org", 
    274320    license = "PSF", 
    275321    keywords = "small-angle x-ray and neutron scattering analysis", 
Note: See TracChangeset for help on using the changeset viewer.