forked from DataCanvasIO/DeepTables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
105 lines (80 loc) · 2.85 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
# -*- coding:utf-8 -*-
from __future__ import absolute_import
import os
from setuptools import find_packages
from setuptools import setup
def read_requirements(file_path='requirements.txt'):
if not os.path.exists(file_path):
return []
with open(file_path, 'r')as f:
lines = f.readlines()
lines = [x.strip('\n').strip(' ') for x in lines]
lines = list(filter(lambda x: len(x) > 0 and not x.startswith('#'), lines))
return lines
def read_extra_requirements():
import glob
import re
extra = {}
for file_name in glob.glob('requirements-*.txt'):
key = re.search('requirements-(.+).txt', file_name).group(1)
req = read_requirements(file_name)
if req:
extra[key] = req
if extra and 'all' not in extra.keys():
extra['all'] = sorted({v for req in extra.values() for v in req})
return extra
def read_version(py_file, var_name='__version__'):
try:
execfile
except NameError:
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)
version_ns = {}
base_dir = os.path.dirname((os.path.abspath(__file__)))
execfile(os.path.join(base_dir, py_file), version_ns)
version = version_ns[var_name]
return version
name = 'deeptables'
version = read_version(os.path.join(name, '_version.py'))
requirements = read_requirements()
MIN_PYTHON_VERSION = '>=3.6.*'
long_description = open('README.md', encoding='utf-8').read()
setup(
name=name,
version=version,
description='Deep-learning Toolkit for Tabular datasets',
long_description=long_description,
long_description_content_type="text/markdown",
url='',
author='DeepTables Community',
author_email='[email protected]',
license='Apache License 2.0',
install_requires=requirements,
python_requires=MIN_PYTHON_VERSION,
extras_require={
'tests': ['pytest', ],
'gpu': ['tensorflow-gpu>=2.0.0', ]
},
classifiers=[
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
packages=find_packages(exclude=('docs', 'tests', 'examples')),
package_data={
# 包含data目录下所有的.dat文件
'deeptables': ['datasets/*.csv'],
},
zip_safe=False,
include_package_data=True,
)