forked from dendrograms/astrodendro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·61 lines (46 loc) · 1.97 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
#!/usr/bin/env python
from setuptools import setup, Command
from distutils.command.build_py import build_py
class DendroTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import os
import shutil
import tempfile
# First ensure that we build the package so that 2to3 gets executed
self.reinitialize_command('build', inplace=False)
self.run_command('build')
build_cmd = self.get_finalized_command('build')
new_path = os.path.abspath(build_cmd.build_lib)
# Copy the build to a temporary directory for the purposes of testing
# - this avoids creating pyc and __pycache__ directories inside the
# build directory
tmp_dir = tempfile.mkdtemp(prefix='astrodendro-test-')
testing_path = os.path.join(tmp_dir, os.path.basename(new_path))
shutil.copytree(new_path, testing_path)
import sys
import subprocess
errno = subprocess.call([sys.executable, os.path.abspath('runtests.py')], cwd=testing_path)
raise SystemExit(errno)
setup(name='astrodendro',
version='0.3.0.dev',
url='http://www.dendrograms.org',
description='Python package for computation of astronomical dendrograms',
author='Thomas Robitaille, Chris Beaumont, Adam Ginsburg, Braden MacDonald, and Erik Rosolowsky',
author_email='[email protected]',
packages=['astrodendro', 'astrodendro.io', 'astrodendro.tests'],
package_data={'astrodendro.tests':['*.npz', 'benchmark_data/*fits']},
provides=['astrodendro'],
requires=['numpy'],
cmdclass={'build_py': build_py, 'test': DendroTest},
keywords=['Scientific/Engineering'],
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
],
)