forked from tensorpack/tensorpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
65 lines (59 loc) · 1.55 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
from setuptools import setup
import os
import shutil
# setup metainfo
CURRENT_DIR = os.path.dirname(__file__)
libinfo_py = os.path.join(CURRENT_DIR, 'tensorpack/libinfo.py')
exec(open(libinfo_py, "rb").read())
# produce rst readme for pypi
try:
import pypandoc
long_description = pypandoc.convert_file('README.md', 'rst')
except ImportError:
long_description = open('README.md').read()
# configure requirements
req = [
'numpy',
'six',
'termcolor',
'tqdm>4.11.1',
'msgpack-python',
'msgpack-numpy',
'pyzmq',
'subprocess32;python_version<"3.0"',
'functools32;python_version<"3.0"',
]
extra_req = [
'pillow',
'scipy',
'h5py',
'lmdb',
'matplotlib',
'scikit-learn',
'tornado;python_version<"3.0"',
]
# parse scripts
scripts = ['scripts/plot-point.py', 'scripts/dump-model-params.py']
scripts_to_install = []
for s in scripts:
dirname = os.path.dirname(s)
basename = os.path.basename(s)
if basename.endswith('.py'):
basename = basename[:-3]
newname = 'tpk-' + basename # install scripts with a prefix to avoid name confusion
# setup.py could be executed the second time in the same dir
if not os.path.isfile(newname):
shutil.move(s, newname)
scripts_to_install.append(newname)
setup(
name='tensorpack',
version=__version__,
description='Neural Network Toolbox on TensorFlow',
long_description=long_description,
install_requires=req,
tests_require=['flake8'],
extras_require={
'all': extra_req
},
scripts=scripts_to_install,
)