File: setup.py

package info (click to toggle)
sasmodels 1.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 16,464 kB
  • sloc: python: 26,296; ansic: 8,051; makefile: 148; sh: 63
file content (83 lines) | stat: -rw-r--r-- 2,791 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand

class PyTest(TestCommand):
    user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]

    def initialize_options(self):
        TestCommand.initialize_options(self)
        self.pytest_args = ''

    def run_tests(self):
        import shlex
        #import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(shlex.split(self.pytest_args))
        sys.exit(errno)

def find_version(package):
    """Read package version string from __init__.py"""
    import os
    with open(os.path.join(package, '__init__.py')) as fid:
        for line in fid.readlines():
            if line.startswith('__version__'):
                line = line[:line.find('#')]  # strip comment, if any
                version = line.split('=', 2)[1].strip()
                if version[0] != version[-1] or version[0] not in "\"'":
                    break
                return version[1:-1]
    raise RuntimeError("Could not read version from %s/__init__.py"%package)

install_requires = ['numpy', 'scipy']

with open('README.rst') as fid:
    long_description = fid.read()

if sys.platform=='win32' or sys.platform=='cygwin':
    install_requires.append('tinycc')

setup(
    name='sasmodels',
    version=find_version('sasmodels'),
    description="sasmodels package",
    long_description=long_description,
    author="SasView Collaboration",
    author_email="management@sasview.org",
    url="http://www.sasview.org",
    keywords="small-angle x-ray and neutron scattering analysis",
    download_url="https://github.com/SasView/sasmodels",
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Intended Audience :: Science/Research',
        'License :: Public Domain',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: C',
        'Topic :: Scientific/Engineering',
        'Topic :: Scientific/Engineering :: Chemistry',
        'Topic :: Scientific/Engineering :: Physics',
    ],
    packages=[
        'sasmodels',
        'sasmodels.models',
        'sasmodels.custom',
        'sasmodels.compiled_models',
    ],
    package_data={
        'sasmodels.models': ['*.c', 'lib/*.c', 'lib/*.h'],
        'sasmodels': ['*.c', '*.cl'],
        'sasmodels.compiled_models': ['*.so'],
    },
    install_requires=install_requires,
    extras_require={
        'full': ['docutils', 'bumps==0.*', 'matplotlib', 'columnize', 'siphash24'],
        'server': ['bumps==0.*'],
        'OpenCL': ["pyopencl"],
        'CUDA': ["pycuda"],
    },
    #setup_requires=['setuptools'],
    tests_require=['pytest'],
    cmdclass={'test': PyTest},
)