-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
104 lines (87 loc) · 3.68 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
"""
# Free AIML Rule Sets
This is a collection of open-sourced AIML (Artificial Intelligence Markup
Language) rule sets, for use with any compatible AIML conversational engine.
The files have been repackaged into a single repo for easy download and
installation. I plan to eventually distribute this on the Python Package
Index to make it installable with Python's package installer, pip, making
it easily available for use with [AIML
Bot](https://github.com/hosford42/aiml_bot).
## GNU General Public License
All files are released under the GNU General Public License. The included
AIML files are (c) ALICE A.I. Foundation, Inc. I have taken care to
exclude any files that did not specifically contain a copyright & license
header provided by the original author. Any additional files that are not
marked with a copyright header of their own are (c) Aaron Hosford.
## Included AIML Sets
* [Free A.L.I.C.E. AIML Set](
https://code.google.com/archive/p/aiml-en-us-foundation-alice/downloads)
(ALICE)
* [Square Bear's AIML files](http://www.square-bear.co.uk/aiml/)
(Mitsuku)
* [Standard AIML Set](https://github.com/cdwfs/pyaiml/tree/master/standard)
(PyAIML)
"""
from setuptools import setup
import os
import warnings
def get_long_description():
"""Load the long description from the README file. In the process,
convert the README from .md to .rst using Pandoc, if possible."""
rst_path = os.path.join(os.path.dirname(__file__), 'README.rst')
md_path = os.path.join(os.path.dirname(__file__), 'README.md')
try:
# Imported here to avoid creating a dependency in the setup.py
# if the .rst file already exists.
# noinspection PyUnresolvedReferences,PyPackageRequirements
from pypandoc import convert_file
except ImportError:
warnings.warn("Module pypandoc not installed. Unable to generate README.rst.")
else:
# First, try to use convert_file, assuming Pandoc is already installed.
# If that fails, try to download & install it, and then try to convert
# again.
# noinspection PyBroadException
try:
# pandoc, you rock...
rst_content = convert_file(md_path, 'rst')
with open(rst_path, 'w') as rst_file:
for line in rst_content.splitlines(keepends=False):
rst_file.write(line + '\n')
except Exception:
try:
# noinspection PyUnresolvedReferences,PyPackageRequirements
from pypandoc.pandoc_download import download_pandoc
download_pandoc()
except FileNotFoundError:
warnings.warn("Unable to download & install pandoc. Unable to generate README.rst.")
else:
# pandoc, you rock...
rst_content = convert_file(md_path, 'rst')
with open(rst_path, 'w') as rst_file:
for line in rst_content.splitlines(keepends=False):
rst_file.write(line + '\n')
if os.path.isfile(rst_path):
with open(rst_path) as rst_file:
return rst_file.read()
else:
# It will be messy, but it's better than nothing...
with open(md_path) as md_file:
return md_file.read()
setup(
name='AIML Sets',
version='1.0.1',
author='ALICE A.I. Foundation, Inc.',
author_email='info@alicebot.org',
maintainer='Aaron Hosford',
maintainer_email='hosford42@gmail.com',
license='GNU GPL',
description='AIML sets (ALICE & Mitsuku)',
long_description=get_long_description(),
url='https://github.com/hosford42/AIML_Sets',
packages=['aiml_sets'],
package_data={
'aiml_sets': ['*/*.aiml']
},
zip_safe=False
)