Changeset f4a1433 in sasview for setup.py


Ignore:
Timestamp:
Oct 24, 2017 2:44:26 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
fca1f50, d6b234b
Parents:
16afe01 (diff), 5582b078 (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.
Message:

Merge branch 'master' into ESS_GUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    r377ade1 rf4a1433  
    66    TODO: Add checks to see that all the dependencies are on the system 
    77""" 
     8from __future__ import print_function 
    89 
    910import os 
     
    1819 
    1920# Manage version number ###################################### 
    20 import sasview 
    21  
    22 VERSION = sasview.__version__ 
     21with open(os.path.join("src", "sas", "sasview", "__init__.py")) as fid: 
     22    for line in fid: 
     23        if line.startswith('__version__'): 
     24            VERSION = line.split('"')[1] 
     25            break 
     26    else: 
     27        raise ValueError("Could not find version in src/sas/sasview/__init__.py") 
    2328############################################################## 
    2429 
     
    4247SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") 
    4348 
     49# TODO: build step should not be messing with existing installation!! 
    4450sas_dir = os.path.join(os.path.expanduser("~"), '.sasview') 
    4551if os.path.isdir(sas_dir): 
     
    5965    #             file_path =  os.path.join(f_path, f) 
    6066    #             os.remove(file_path) 
    61     if os.path.exists(SASVIEW_BUILD): 
    62         print("Removing existing build directory", 
    63               SASVIEW_BUILD, "for a clean build") 
    64         shutil.rmtree(SASVIEW_BUILD) 
     67 
     68 
     69# Optionally clean before build. 
     70dont_clean = 'update' in sys.argv 
     71if dont_clean: 
     72    sys.argv.remove('update') 
     73elif os.path.exists(SASVIEW_BUILD): 
     74    print("Removing existing build directory", SASVIEW_BUILD, "for a clean build") 
     75    shutil.rmtree(SASVIEW_BUILD) 
    6576 
    6677# 'sys.maxsize' and 64bit: Not supported for python2.5 
    67 is_64bits = False 
    68 if sys.version_info >= (2, 6): 
    69     is_64bits = sys.maxsize > 2**32 
     78is_64bits = sys.maxsize > 2**32 
    7079 
    7180enable_openmp = False 
    72  
    7381if sys.platform == 'darwin': 
    7482    if not is_64bits: 
     
    225233package_dir["sas.sascalc.dataloader"] = os.path.join( 
    226234    "src", "sas", "sascalc", "dataloader") 
    227 package_data["sas.sascalc.dataloader.readers"] = [ 
    228     'defaults.json', 'schema/*.xsd'] 
     235package_data["sas.sascalc.dataloader.readers"] = ['schema/*.xsd'] 
    229236packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers", 
    230237                 "sas.sascalc.dataloader.readers.schema"]) 
     
    426433 
    427434# SasView 
    428 package_dir["sas.sasview"] = "sasview" 
     435package_data['sas'] = ['logging.ini'] 
    429436package_data['sas.sasview'] = ['images/*', 
    430437                               'media/*', 
    431                                'logging.ini', 
    432438                               'test/*.txt', 
    433439                               'test/1d_data/*', 
     
    439445                               'test/other_files/*', 
    440446                               'test/save_states/*', 
    441                                'test/sesans_data/*' 
     447                               'test/sesans_data/*', 
     448                               'test/upcoming_formats/*', 
    442449                               ] 
    443450packages.append("sas.sasview") 
    444451 
    445452required = [ 
    446     'bumps>=0.7.5.9', 'periodictable>=1.3.1', 'pyparsing<2.0.0', 
     453    'bumps>=0.7.5.9', 'periodictable>=1.5.0', 'pyparsing<2.0.0', 
    447454 
    448455    # 'lxml>=2.2.2', 
Note: See TracChangeset for help on using the changeset viewer.