-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
75 lines (57 loc) · 2.08 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
69
70
71
72
73
74
75
from setuptools import setup, find_packages
from setuptools.command.install import install
from shutil import copyfile
import os
import glob
import sys
import subprocess
def check_build():
good_commands = ('develop', 'sdist', 'build', 'build_ext', 'build_py',
'build_clib', 'build_scripts', 'bdist_wheel', 'bdist_rpm',
'bdist_wininst', 'bdist_msi', 'bdist_mpkg')
for command in good_commands:
if command in sys.argv[1::]:
return True
def build_and_move(path):
print("Building: {}".format(path))
cwd = os.getcwd()
rel_module = path
module_dir = os.path.join(cwd, rel_module)
os.chdir(module_dir)
ret = subprocess.call(["python","setup.py", "build"])
if ret != 0:
exit(ret)
for fbuilded in glob.glob("build/lib*/*.so"):
dest_directory = os.getcwd() + '/' + os.path.basename(fbuilded)
copyfile(fbuilded, dest_directory)
os.chdir(cwd)
def setup_package():
if "--force" in sys.argv:
run_build = True
else:
run_build = False
#Building packages
if check_build() or run_build:
build_and_move('acalib/core/_morph')
setup(
name = "acalib",
version = "0.1.3",
description = "Advanced Computing for Astronomy Library",
url = "https://github.com/ChileanVirtualObservatory/ACALIB",
author = "CSRG",
author_email = '[email protected]',
classifiers = [
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6'
],
zip_safe = False,
packages = find_packages(),
include_package_data = True,
setup_requires = ['numpy>=1.8', 'cython>=0.18'],
install_requires = ['numpy>=1.11.2', 'astropy>=1.2', 'cython>=0.18',
'matplotlib>=1.5', 'scipy>=0.18',
'scikit-image>=0.13', 'urllib3', 'pycupid', 'dask', 'distributed']
)
setup_package()