Changeset 948b8c1 in sasmodels


Ignore:
Timestamp:
May 6, 2016 1:12:06 AM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
c2c51a2
Parents:
c4c426b
Message:

simplify setup; read version from package init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    rff97458 r948b8c1  
    1 import os 
    2 from setuptools import setup,find_packages 
     1from distutils.core import setup 
    32 
    4 if os.name == 'nt': 
    5     # Create the model .so's on windows 
    6     os.system("python gen_so.py") 
    7  
    8 packages = find_packages(exclude=['contrib', 'docs', 'tests*']) 
    9 package_data = { 
    10     'sasmodels.models': ['*.c','lib/*.c'], 
    11     'sasmodels': ['*.c'], 
    12     'models': ['*.so'], 
    13 } 
    14 required = [] 
     3def find_version(package): 
     4    """Read package version string from __init__.py""" 
     5    import os 
     6    with open(os.path.join(package, '__init__.py')) as fid: 
     7        for line in fid.readlines(): 
     8            if line.startswith('__version__'): 
     9                line = line[:line.find('#')]  # strip comment, if any 
     10                version = line.split('=', 2)[1].strip() 
     11                if version[0] != version[-1] or version[0] not in "\"'": 
     12                    break 
     13                return version[1:-1] 
     14    raise RuntimeError("Could not read version from %s/__init__.py"%package) 
    1515 
    1616setup( 
    17     name="sasmodels", 
    18     version = "1.0.0a", 
    19     description = "sasmodels package", 
     17    name='sasmodels', 
     18    version=find_version('sasmodels'), 
     19    description="sasmodels package", 
    2020    long_description=open('README.md').read(), 
    21     author = "SasView Collaboration", 
    22     author_email = "management@sasview.org", 
    23     url = "http://www.sasview.org", 
    24     keywords = "small-angle x-ray and neutron scattering analysis", 
    25     download_url = "https://github.com/SasView/sasmodels", 
     21    author="SasView Collaboration", 
     22    author_email="management@sasview.org", 
     23    url="http://www.sasview.org", 
     24    keywords="small-angle x-ray and neutron scattering analysis", 
     25    download_url="https://github.com/SasView/sasmodels", 
    2626    classifiers=[ 
    2727        'Development Status :: 4 - Beta', 
     
    3131        'Operating System :: OS Independent', 
    3232        'Programming Language :: Python', 
     33        'Programming Language :: C', 
    3334        'Topic :: Scientific/Engineering', 
    3435        'Topic :: Scientific/Engineering :: Chemistry', 
    3536        'Topic :: Scientific/Engineering :: Physics', 
    3637    ], 
    37     packages=packages, 
    38     package_data=package_data, 
    39     install_requires = required, 
     38    packages=[ 
     39        'sasmodels', 
     40        'sasmodels.models', 
     41        'sasmodels.custom' 
     42    ], 
     43    package_data={ 
     44        'sasmodels.models': ['*.c', 'lib/*.c'], 
     45        'sasmodels': ['*.c', '*.cl', 'convert.json'], 
     46    }, 
     47    install_requires = [ 
     48    ], 
    4049    extras_require = { 
    4150        'OpenCL': ["pyopencl"], 
    4251        'Bumps': ["bumps"], 
    43         } 
    44  
    45     ) 
     52        'TinyCC': ["tinycc"], 
     53    }, 
     54) 
Note: See TracChangeset for help on using the changeset viewer.