-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·64 lines (56 loc) · 1.98 KB
/
setup.py
File metadata and controls
executable file
·64 lines (56 loc) · 1.98 KB
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
__author__ = 'Song'
__copyright__ = "Copyright 2016, The Helios Project"
import os.path
import sys, getopt, re
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
import pip
global include_dirs
include_dirs = []
deps_list = ['numpy', 'scipy', 'pandas']
def deps_install():
for package in deps_list:
print("[DEPENDENCY] Installing %s" % package)
try:
pip.main(['install', '--no-binary', ':all:', '--upgrade', package])
except Exception as e:
print("[Error] Unable to install %s using pip. \
Please read the instructions for \
manual installation.. Exiting" % package)
exit(2)
class pyten_install(install):
def run(self):
deps_install()
import numpy as np
include_dirs.append(np.get_include())
install.run(self)
class pyten_develop(develop):
def run(self):
deps_install()
import numpy as np
include_dirs.append(np.get_include())
develop.run(self)
local_path = os.path.split(os.path.realpath(__file__))[0]
version_file = os.path.join(local_path, 'pyten/_version.py')
version_strline = open(version_file).read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, version_strline, re.M)
if mo:
version = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (version_file,))
setup(name = "pyten",
version = version,
packages=find_packages(),
include_package_data=True,
url="",
author = "HELIOS",
author_email = "qqsong@tamu.edu",
description="Tools for the decomposition & completion of tensors",
# long_description=open("README.rst").read(),d
zip_safe = False, # I need this for MPI purposes
cmdclass={'install': pyten_install,
'develop': pyten_develop},
include_dirs=include_dirs, requires=['numpy', 'scipy', 'pandas']
)