forked from graphbrain/graphbrain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·120 lines (108 loc) · 3.48 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
114
115
116
117
118
119
120
#!/usr/bin/env python
from setuptools import setup, find_packages
from setup_utils import get_ext_modules
# True to enable building extensions using Cython.
# False to build extensions from the C files that were previously
# created by Cython.
USE_CYTHON = True
# "If True, will produce an HTML file for each of the .pyx or .py files
# compiled. The HTML file gives an indication of how much Python interaction
# there is in each of the source code lines, compared to plain C code."
# https://cython.readthedocs.io/en/latest/src/userguide/
# source_files_and_compilation.html#cythonize-arguments
CYTHON_ANNOTATE = False
# Force compilation of all Cython code.
CYTHON_FORCE_COMPILATION = True
EXT_MODULES = [
'graphbrain.hyperedge',
'graphbrain.memory',
'graphbrain.parsers',
'graphbrain.patterns.argroles',
'graphbrain.patterns.atoms',
'graphbrain.patterns.common',
'graphbrain.patterns.counter',
'graphbrain.patterns.entrypoints',
'graphbrain.patterns.matcher',
'graphbrain.patterns.merge',
'graphbrain.patterns.properties',
'graphbrain.patterns.utils',
'graphbrain.patterns.variables',
# SEMSIM disabled
# 'graphbrain.patterns.semsim',
]
ext_modules = get_ext_modules(EXT_MODULES, USE_CYTHON)
if USE_CYTHON:
from Cython.Build import cythonize # noqa
ext_modules = cythonize(
ext_modules,
annotate=CYTHON_ANNOTATE,
force=CYTHON_FORCE_COMPILATION,
compiler_directives={'language_level': '3'}
)
# Current Graphbrain version
with open('VERSION') as version_file:
VERSION = version_file.read()
with open('README.md', encoding='utf8') as fh:
long_description = fh.read()
python_requires = '>=3.9'
install_requires = [
'asciitree',
# SEMSIM disabled
# 'gensim',
'ipython',
'mwparserfromhell',
'networkx',
# fixed for now because of spacy
'numpy==1.26.4',
'plyvel',
'progressbar2',
'scikit-learn',
'spacy',
'spacy-experimental==0.6.1',
'spacy-transformers',
'termcolor',
'thinc',
'torch',
'trafilatura',
]
setup(
name='graphbrain',
version=VERSION,
author='Telmo Menezes et al.',
author_email='[email protected]',
description='Knowledge System + Natural Language Understanding',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://graphbrain.net',
license='MIT',
keywords=['NLP', 'AI', 'Knowledge Representation', 'Knowledge Systems', 'Natural Language Understanding',
'Text Analysis', 'Cognition'],
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Sociology'
],
python_requires=python_requires,
packages=find_packages(),
install_requires=install_requires,
extras_require={
'dev': [
'cython >=0.25',
'pytest',
'Sphinx',
'sphinx_rtd_theme'
]
},
package_data={'': ['data/*.csv']},
entry_points='''
[console_scripts]
graphbrain=graphbrain.__main__:cli
''',
ext_modules=ext_modules
)