source: sasmodels/setup.py @ f354e46

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since f354e46 was 1f991d6, checked in by Paul Kienzle <pkienzle@…>, 7 years ago

add 'test' target to setup.py

  • Property mode set to 100644
File size: 2.4 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
32setup(
33    name='sasmodels',
34    version=find_version('sasmodels'),
35    description="sasmodels package",
36    long_description=open('README.rst').read(),
37    author="SasView Collaboration",
38    author_email="management@sasview.org",
39    url="http://www.sasview.org",
40    keywords="small-angle x-ray and neutron scattering analysis",
41    download_url="https://github.com/SasView/sasmodels",
42    classifiers=[
43        'Development Status :: 4 - Beta',
44        'Environment :: Console',
45        'Intended Audience :: Science/Research',
46        'License :: Public Domain',
47        'Operating System :: OS Independent',
48        'Programming Language :: Python',
49        'Programming Language :: C',
50        'Topic :: Scientific/Engineering',
51        'Topic :: Scientific/Engineering :: Chemistry',
52        'Topic :: Scientific/Engineering :: Physics',
53    ],
54    packages=[
55        'sasmodels',
56        'sasmodels.models',
57        'sasmodels.custom'
58    ],
59    package_data={
60        'sasmodels.models': ['*.c', 'lib/*.c'],
61        'sasmodels': ['*.c', '*.cl'],
62    },
63    install_requires=[
64    ],
65    extras_require={
66        'OpenCL': ["pyopencl"],
67        'Bumps': ["bumps"],
68        'TinyCC': ["tinycc"],
69    },
70    build_requires=['setuptools'],
71    test_requires=['pytest'],
72    cmdclass = {'test': PyTest},
73)
Note: See TracBrowser for help on using the repository browser.