-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·81 lines (71 loc) · 2.06 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
76
77
78
79
80
#!/usr/bin/env python
# coding: utf-8
# Python 2.7 Standard Library
import ConfigParser
import os
import os.path
import shutil
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)
# UPDATE: now TIMIT is actually included (?)
# ------------------------------------------------------------------------------
# NLTK (the TIMIT corpus is not installable via Pypi)
#try:
# import nltk
#except ImportError:
# error = """NLTK not found. Install it with
#
# pip install nltk
#
#then perform the installation of the TIMIT corpus with:
#
# python -c "import nltk; nltk.download('timit')"
#"""
# raise ImportError(error)
#
#try:
# from nltk.corpus import timit
# _ = timit.words
#except LookupError:
# error = """TIMIT corpus not found. Install it with
#
# python -c "import nltk; nltk.download('timit')"
#"""
# raise ImportError(error)
# 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!r}
"""
raise ImportError(error.format(req=" ".join(setup_requires)))
import about
# This Package
sys.path.insert(1, srcdir("audio"))
import about_index
info = dict(
metadata = about.get_metadata(about_index),
code = dict(packages=setuptools.find_packages()),
data = {},
requirements = dict(install_requires=["audio.bitstream", "nltk"]),
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)