File: setup.py

package info (click to toggle)
synphot 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,576 kB
  • sloc: python: 5,202; ansic: 120; makefile: 112
file content (61 lines) | stat: -rwxr-xr-x 1,546 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import os
import sys
from setuptools import setup, Extension


def get_extensions():
    from collections import defaultdict
    import numpy

    cfg = defaultdict(list)
    cfg['include_dirs'].extend([
        numpy.get_include(),
        os.path.join('synphot', 'include')])
    cfg['sources'] = [
        os.path.join('synphot', 'src', 'synphot_utils.c')]
    cfg = dict((str(key), val) for key, val in cfg.items())

    return [Extension('synphot.synphot_utils', **cfg)]


TEST_HELP = """
Note: running tests is no longer done using 'python setup.py test'. Instead
you will need to run:

    pip install -e .
    pytest

For more information, see:

  https://docs.astropy.org/en/latest/development/testguide.html#running-tests
"""

if 'test' in sys.argv:
    print(TEST_HELP)
    sys.exit(1)

DOCS_HELP = """
Note: building the documentation is no longer done using
'python setup.py build_docs'. Instead you will need to run:

    cd docs
    make html

For more information, see:

  https://docs.astropy.org/en/latest/install.html#builddocs
"""

if 'build_docs' in sys.argv or 'build_sphinx' in sys.argv:
    print(DOCS_HELP)
    sys.exit(1)

# Note that requires and provides should not be included in the call to
# ``setup``, since these are now deprecated. See this link for more details:
# https://groups.google.com/forum/#!topic/astropy-dev/urYO8ckB2uM

setup(use_scm_version={'write_to': 'synphot/version.py'},
      ext_modules=get_extensions())