-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·52 lines (43 loc) · 1.34 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
#!/usr/bin/env python
# coding: utf-8
# Python 2.7 Standard Library
import os
import sys
# Pip Package Manager
try:
import pip
import setuptools
import pkg_resources
except ImportError:
error = "pip is not installed, refer to <{url}> for instructions."
raise ImportError(error.format(url="http://pip.readthedocs.org"))
def srcdir(path):
return os.path.join(os.path.dirname(__file__), path)
# Extra Third-Party Libraries
sys.path.insert(1, srcdir(".lib"))
try:
setup_requires = ["about>=4.0.0"]
require = lambda *r: pkg_resources.WorkingSet().require(*r)
require(setup_requires)
import about
except pkg_resources.DistributionNotFound:
error = """{req!r} not found; install it locally with:
pip install --target=.lib --ignore-installed {req}
"""
raise ImportError(error.format(req=" ".join(setup_requires)))
import about
# This Package
sys.path.insert(1, srcdir("numtest"))
import about_numtest
info = dict(
metadata = about.get_metadata(about_numtest),
code = dict(packages=setuptools.find_packages()),
data = {},
requirements = dict(install_requires=["numpy"]),
scripts = {},
plugins = {},
tests = dict(test_suite="test.suite"),
)
if __name__ == "__main__":
kwargs = {k:v for dct in info.values() for (k,v) in dct.items()}
setuptools.setup(**kwargs)