forked from Accenture/Docknet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
113 lines (92 loc) · 3.18 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
"""
Create docknet as a Python package
"""
from __future__ import print_function
import io
import os
import os.path
import sys
from setuptools import setup, find_packages
MIN_PYTHON_VERSION = (3, 6)
PKGNAME = 'docknet'
DESC = '''
A pure Numpy implementation of neural networks
'''
# --------------------------------------------------------------------
def pkg_version():
"""Read the package version from VERSION.txt"""
basedir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(basedir, 'VERSION.txt'), 'r') as f:
return f.readline().strip()
def parse_requirements(filename='requirements.txt'):
"""Read the requirements file"""
pathname = os.path.join(os.path.dirname(__file__), filename)
modules = []
urls = []
with io.open(pathname, 'r') as f:
for line in f:
line = line.strip()
if not line or line.startswith('#'):
continue
if ':' in line:
urls.append(line)
else:
modules.append(line)
return modules, urls
# --------------------------------------------------------------------
VERSION = pkg_version()
if sys.version_info < MIN_PYTHON_VERSION:
sys.exit('**** Sorry, {} {} needs at least Python {}'.format(
PKGNAME, VERSION, '.'.join(map(str, MIN_PYTHON_VERSION))))
install_requires, dependency_links = parse_requirements()
setup_args = dict(
# Metadata
name=PKGNAME,
version=VERSION,
description=DESC.split('\n')[0],
long_description=DESC,
license='(c) Accenture',
author='Javier Sastre',
author_email='j.sastre.martinez@accenture.com',
# Locate packages
packages=find_packages('src'),
package_dir={'': 'src'},
# Requirements
python_requires='>='+'.'.join(map(str, MIN_PYTHON_VERSION)),
install_requires=install_requires,
dependency_links=dependency_links,
# Optional requirements
extras_require={
'test': ['pytest', 'nose', 'coverage'],
},
entry_points={'console_scripts': [
'docknet_generate_data = docknet.generate_data:main',
'docknet_evaluate = docknet.evaluate:main',
'docknet_predict = docknet.predict:main',
'docknet_start = docknet.app:main',
'docknet_train = docknet.train:main'
]},
include_package_data=False, # otherwise package_data is not used
package_data={
PKGNAME: [
'resources/config.yaml',
'resources/chessboard.pkl',
'resources/cluster.pkl',
'resources/island.pkl',
'resources/swirl.pkl'
]
},
# pytest requirements
setup_requires=['pytest-runner'],
tests_require=['pytest'],
# More metadata
keywords=['Accenture', 'The Dock', 'deep learning', 'neural network', 'numpy', 'docknet'],
classifiers=[
'Programming Language :: Python :: 3 :: Only',
'License :: Other/Proprietary License',
'Development Status :: 4 - Beta',
'Topic :: Software Development :: Libraries :: Application Frameworks',
],
)
if __name__ == '__main__':
setup(**setup_args)