source: sasmodels/setup.py @ 783e76f

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 783e76f was 783e76f, checked in by arm61 <arm61@…>, 6 years ago

adding requiresments to setup.py

  • Property mode set to 100644
File size: 2.5 KB
Line 
1import sys
2from setuptools import setup
3from setuptools.command.test import test as TestCommand
4
5class PyTest(TestCommand):
6    user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
7
8    def initialize_options(self):
9        TestCommand.initialize_options(self)
10        self.pytest_args = ''
11
12    def run_tests(self):
13        import shlex
14        #import here, cause outside the eggs aren't loaded
15        import pytest
16        errno = pytest.main(shlex.split(self.pytest_args))
17        sys.exit(errno)
18
19def find_version(package):
20    """Read package version string from __init__.py"""
21    import os
22    with open(os.path.join(package, '__init__.py')) as fid:
23        for line in fid.readlines():
24            if line.startswith('__version__'):
25                line = line[:line.find('#')]  # strip comment, if any
26                version = line.split('=', 2)[1].strip()
27                if version[0] != version[-1] or version[0] not in "\"'":
28                    break
29                return version[1:-1]
30    raise RuntimeError("Could not read version from %s/__init__.py"%package)
31
32install_requires = ['numpy', 'scipy']
33
34if sys.platform=='win32' or sys.platform=='cygwin':
35    install_requires.append('tinycc')
36
37setup(
38    name='sasmodels',
39    version=find_version('sasmodels'),
40    description="sasmodels package",
41    long_description=open('README.rst').read(),
42    author="SasView Collaboration",
43    author_email="management@sasview.org",
44    url="http://www.sasview.org",
45    keywords="small-angle x-ray and neutron scattering analysis",
46    download_url="https://github.com/SasView/sasmodels",
47    classifiers=[
48        'Development Status :: 4 - Beta',
49        'Environment :: Console',
50        'Intended Audience :: Science/Research',
51        'License :: Public Domain',
52        'Operating System :: OS Independent',
53        'Programming Language :: Python',
54        'Programming Language :: C',
55        'Topic :: Scientific/Engineering',
56        'Topic :: Scientific/Engineering :: Chemistry',
57        'Topic :: Scientific/Engineering :: Physics',
58    ],
59    packages=[
60        'sasmodels',
61        'sasmodels.models',
62        'sasmodels.custom'
63    ],
64    package_data={
65        'sasmodels.models': ['*.c', 'lib/*.c'],
66        'sasmodels': ['*.c', '*.cl'],
67    },
68    install_requires=install_requires,
69    extras_require={
70        'full': ['docutils', 'bumps', 'matplotlib'],
71        'server': ['bumps'],
72        'OpenCL': ["pyopencl"],
73    },
74    build_requires=['setuptools'],
75    test_requires=['pytest'],
76    cmdclass = {'test': PyTest},
77)
Note: See TracBrowser for help on using the repository browser.