-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
68 lines (50 loc) · 1.59 KB
/
setup.py
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
#!/usr/bin/env python
import glob
import os
import re
import unittest
from Cython.Build import cythonize
from setuptools import setup, Extension
from setuptools.command.test import test as TestCommand
import numpy as np
# extensions to build
ext_kernels = Extension(
"tod2flux.kernels",
include_dirs=[np.get_include()],
sources=["tod2flux/kernels.pyx"],
)
extensions = cythonize([ext_kernels])
# scripts to install
scripts = glob.glob("pipelines/*.py")
# run unit tests
class PTestCommand(TestCommand):
def __init__(self, *args, **kwargs):
super(PTestCommand, self).__init__(*args, **kwargs)
def initialize_options(self):
TestCommand.initialize_options(self)
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_suite = True
def run(self):
loader = unittest.TestLoader()
runner = unittest.TextTestRunner(verbosity=2)
suite = loader.discover("tests", pattern="test_*.py", top_level_dir=".")
runner.run(suite)
# set it all up
setup(
name="tod2flux",
provides=["tod2flux"],
version="0.1",
description="Tools for estimating point source flux densities from TOD",
author="Reijo Keskitalo and Graca Rocha",
author_email="[email protected]",
url="https://github.com/hpc4cmb/tod2flux",
packages=["tod2flux", "tod2flux.planck"],
package_data={"todflux.planck": ["data/*fits", "data/*stokes"],},
include_package_data=True,
ext_modules=extensions,
scripts=scripts,
license="BSD",
requires=["Python (>3.4.0)",],
cmdclass={"test": PTestCommand},
)