1
|
|
|
#!/usr/bin/env python |
2
|
|
|
|
3
|
|
|
import os |
4
|
|
|
import sys |
5
|
|
|
|
6
|
|
|
import setuptools |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
PACKAGE_NAME = 'responsibly' |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
def read_package_variable(key, filename='__init__.py'): |
13
|
|
|
"""Read the value of a variable from the package without importing.""" |
14
|
|
|
module_path = os.path.join(PACKAGE_NAME, filename) |
15
|
|
|
with open(module_path) as module: |
16
|
|
|
for line in module: |
17
|
|
|
parts = line.strip().split(' ', 2) |
18
|
|
|
if parts[:-1] == [key, '=']: |
19
|
|
|
return parts[-1].strip("'") |
20
|
|
|
sys.exit("'%s' not found in '%s'", key, module_path) |
21
|
|
|
|
22
|
|
|
|
23
|
|
|
def build_description(): |
24
|
|
|
"""Build a description for the project from documentation files.""" |
25
|
|
|
with open("README.rst") as f: |
26
|
|
|
readme = f.read() |
27
|
|
|
with open("CHANGELOG.rst") as f: |
28
|
|
|
changelog = f.read() |
29
|
|
|
return readme + '\n' + changelog |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
setuptools.setup( |
33
|
|
|
name=read_package_variable('__project__'), |
34
|
|
|
version=read_package_variable('__version__'), |
35
|
|
|
|
36
|
|
|
description=read_package_variable('__description__'), |
37
|
|
|
url=read_package_variable('__url__'), |
38
|
|
|
author=read_package_variable('__author__'), |
39
|
|
|
author_email=read_package_variable('__author_email__'), |
40
|
|
|
|
41
|
|
|
packages=setuptools.find_packages(), |
42
|
|
|
|
43
|
|
|
include_package_data=True, |
44
|
|
|
|
45
|
|
|
# entry_points={'console_scripts': [ |
46
|
|
|
# 'responsibly-cli = responsibly.cli:main', |
47
|
|
|
# ]}, |
48
|
|
|
|
49
|
|
|
long_description=build_description(), |
50
|
|
|
long_description_content_type='text/x-rst', |
51
|
|
|
license=read_package_variable('__license__'), |
52
|
|
|
classifiers=[ |
53
|
|
|
'Development Status :: 4 - Beta', |
54
|
|
|
'Intended Audience :: Science/Research', |
55
|
|
|
'Topic :: Scientific/Engineering :: Artificial Intelligence', |
56
|
|
|
'Topic :: Text Processing :: Linguistic', |
57
|
|
|
'License :: OSI Approved :: MIT License', |
58
|
|
|
'Natural Language :: English', |
59
|
|
|
'Operating System :: OS Independent', |
60
|
|
|
'Programming Language :: Python', |
61
|
|
|
'Programming Language :: Python :: 3', |
62
|
|
|
'Programming Language :: Python :: 3 :: Only', |
63
|
|
|
'Programming Language :: Python :: 3.6', |
64
|
|
|
'Programming Language :: Python :: 3.7', |
65
|
|
|
], |
66
|
|
|
|
67
|
|
|
python_requires='>=3.6, <3.9', |
68
|
|
|
|
69
|
|
|
install_requires=[ |
70
|
|
|
"numpy >= 1.15", |
71
|
|
|
"scipy >= 1.1", |
72
|
|
|
"pandas >= 0.23", |
73
|
|
|
"matplotlib >= 2.2, < 3", |
74
|
|
|
"seaborn >= 0.9", |
75
|
|
|
"scikit-learn >= 0.19", |
76
|
|
|
"gensim >= 3.7, < 3.8", |
77
|
|
|
"tabulate >= 0.8", |
78
|
|
|
"six >= 1.10", |
79
|
|
|
"click >= 6.0", |
80
|
|
|
"tqdm >= 4.24", |
81
|
|
|
"mlxtend >= 0.13, < 0.17", |
82
|
|
|
], |
83
|
|
|
) |
84
|
|
|
|