1
|
|
|
from setuptools import setup, find_packages, Distribution |
2
|
|
|
from setuptools.command.build_py import build_py |
3
|
|
|
|
4
|
|
|
from os import path |
5
|
|
|
import sys |
6
|
|
|
|
7
|
|
|
this_dir = path.dirname(path.realpath(__file__)) |
8
|
|
|
|
9
|
|
|
def readme(): |
10
|
|
|
with open(path.join(this_dir, 'README.rst')) as f: |
11
|
|
|
return f.read() |
12
|
|
|
|
13
|
|
|
setup_kwargs = dict( |
14
|
|
|
name='topic-modeling-toolkit', |
15
|
|
|
version='0.5.6', |
16
|
|
|
description='Topic Modeling Toolkit', |
17
|
|
|
long_description=readme(), |
18
|
|
|
keywords='topic modeling machine learning', |
19
|
|
|
|
20
|
|
|
# project_urls={ |
21
|
|
|
# "Source Code": "https://github.com/.., |
22
|
|
|
# }, |
23
|
|
|
zip_safe=False, |
24
|
|
|
|
25
|
|
|
# what packages/distributions (python) need to be installed when this one is. (Roughly what is imported in source code) |
26
|
|
|
install_requires=[ |
27
|
|
|
'numpy', 'scipy', 'EasyPlot==1.0.0', 'nltk', |
28
|
|
|
'pandas', 'gensim', 'tqdm', 'in-place', 'protobuf', |
29
|
|
|
'click', 'future', 'attrs', |
30
|
|
|
'PyInquirer', # # for the transform.py interface |
31
|
|
|
# 'configparser' # to make statement 'from configparser import ConfigParser' python 2 and 3 compatible |
32
|
|
|
], |
33
|
|
|
# A string or list of strings specifying what other distributions need to be present in order for the setup script to run. |
34
|
|
|
# (Note: projects listed in setup_requires will NOT be automatically installed on the system where the setup script is being run. |
35
|
|
|
# They are simply downloaded to the ./.eggs directory if they're not locally available already. If you want them to be installed, |
36
|
|
|
# as well as being available when the setup script is run, you should add them to install_requires and setup_requires.) |
37
|
|
|
# setup_requires=[], |
38
|
|
|
|
39
|
|
|
# Folder where unittest.TestCase-like written modules reside. Specifying this argument enables use of the test command |
40
|
|
|
# to run the specified test suite, e.g. via setup.py test. |
41
|
|
|
test_suite='tests', |
42
|
|
|
|
43
|
|
|
# Declare packages that the project's tests need besides those needed to install it. A string or list of strings specifying |
44
|
|
|
# what other distributions need to be present for the package's tests to run. Note that these required projects will not be installed on the system where the |
45
|
|
|
# tests are run, but only downloaded to the project's setup directory if they're not already installed locally. |
46
|
|
|
# Use to ensure that a package is available when the test command is run. |
47
|
|
|
tests_require=['pytest'], |
48
|
|
|
|
49
|
|
|
classifiers=[ |
50
|
|
|
'Development Status :: 4 - Beta', |
51
|
|
|
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', |
52
|
|
|
'Programming Language :: Python :: 2', |
53
|
|
|
'Programming Language :: Python :: 2.7', |
54
|
|
|
'Programming Language :: Python :: 3', |
55
|
|
|
'Programming Language :: Python :: 3.6', |
56
|
|
|
'Topic :: Scientific/Engineering :: Artificial Intelligence', |
57
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules', |
58
|
|
|
'Intended Audience :: Science/Research' |
59
|
|
|
], |
60
|
|
|
url='https://github.com/boromir674/topic-modeling-toolkit', |
61
|
|
|
# download_url='point to tar.gz', # help easy_install do its tricks |
62
|
|
|
author='Konstantinos Lampridis', |
63
|
|
|
author_email='[email protected]', |
64
|
|
|
license='GNU GPLv3', |
65
|
|
|
packages=find_packages(where='src'), |
66
|
|
|
package_dir={'': 'src'}, # this is required by distutils |
67
|
|
|
# py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')], |
68
|
|
|
include_package_data=True, |
69
|
|
|
# Include all data files in packages that distutils are aware of through the MANIFEST.in file |
70
|
|
|
# package_data={ |
71
|
|
|
# # If any package contains *.txt or *.rst files, include them: |
72
|
|
|
# '': ['*.txt', '*.rst'], |
73
|
|
|
# 'package_name.file_name': ['data/*.txt', 'data/model.pickle'], |
74
|
|
|
# }, |
75
|
|
|
entry_points={ |
76
|
|
|
'console_scripts': [ |
77
|
|
|
'transform = topic_modeling_toolkit.transform:main', |
78
|
|
|
'train = topic_modeling_toolkit.train:main', |
79
|
|
|
'tune = topic_modeling_toolkit.tune:main', |
80
|
|
|
'make-graphs = topic_modeling_toolkit.make_graphs:main', |
81
|
|
|
'report-datasets = topic_modeling_toolkit.report_datasets:main', |
82
|
|
|
'report-models = topic_modeling_toolkit.report_models:main', |
83
|
|
|
'report-topics = topic_modeling_toolkit.report_topics:main', |
84
|
|
|
'report-kl= topic_modeling_toolkit.report_kl:main', |
85
|
|
|
] |
86
|
|
|
}, |
87
|
|
|
# A dictionary mapping names of "extras" (optional features of your project: eg imports that a console_script uses) to strings or lists of strings |
88
|
|
|
# specifying what other distributions must be installed to support those features. |
89
|
|
|
# extras_require={}, |
90
|
|
|
|
91
|
|
|
|
92
|
|
|
) |
93
|
|
|
|
94
|
|
|
class BinaryDistribution(Distribution): |
95
|
|
|
"""This inheritor forces setuptools to include the "built" shared library into the binary distribution""" |
96
|
|
|
def has_ext_modules(self): |
97
|
|
|
return True |
98
|
|
|
|
99
|
|
|
def is_pure(self): |
100
|
|
|
return False |
101
|
|
|
|
102
|
|
|
if sys.argv[1] == "bdist_wheel": |
103
|
|
|
setup_kwargs['distclass'] = BinaryDistribution |
104
|
|
|
setup_kwargs['cmdclass']['build_py'] = AddLibraryBuild |
|
|
|
|
105
|
|
|
|
106
|
|
|
setup(**setup_kwargs) |
107
|
|
|
|