Debian Codegraph @

setup.py

raw ◀ ▶
2 Debian patches touch this file
1 #!/usr/bin/env python
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
17 import os
18 import sys
19
20 from setuptools import find_packages, setup
21
22 py_version = sys.version_info[:2]
23
24 if py_version < (3, 8):
25 raise RuntimeError("Errbot requires Python 3.8 or later")
26
27 VERSION_FILE = os.path.join("errbot", "version.py")
28
29 deps = [
30 "webtest==3.0.0",
31 "flask",
•32 "requests==2.31.0",
33 "jinja2==3.1.2",
34 "pyOpenSSL==23.2.0",
35 "colorlog==6.7.0",
36 "markdown==3.4.4",
37 "ansi==0.3.6",
38 "Pygments==2.16.1",
39 "dulwich==0.21.5", # python implementation of git
40 "deepmerge==1.1.0",
41 ]
42
43 if py_version < (3, 9):
44 deps.append("graphlib-backport==1.0.3")
45
46 src_root = os.curdir
47
48
49 def read_version():
50 """
51 Read directly the errbot/version.py and gives the version without loading Errbot.
52 :return: errbot.version.VERSION
53 """
54
55 variables = {}
56 with open(VERSION_FILE) as f:
57 exec(compile(f.read(), "version.py", "exec"), variables)
58 return variables["VERSION"]
59
60
61 def read(fname, encoding="ascii"):
62 return open(
63 os.path.join(os.path.dirname(__file__), fname), "r", encoding=encoding
64 ).read()
65
66
67 if __name__ == "__main__":
68
69 VERSION = read_version()
70
71 args = set(sys.argv)
72
73 changes = read("CHANGES.rst", "utf8")
74
75 if changes.find(VERSION) == -1:
76 raise Exception("You forgot to put a release note in CHANGES.rst ?!")
77
78 if args & {"bdist", "bdist_dumb", "bdist_rpm", "bdist_wininst", "bdist_msi"}:
79 raise Exception("err doesn't support binary distributions")
80
81 packages = find_packages(src_root, include=["errbot", "errbot.*"])
82
83 setup(
84 name="errbot",
85 version=VERSION,
86 packages=packages,
87 entry_points={
88 "console_scripts": [
89 "errbot = errbot.cli:main",
90 ]
91 },
92 install_requires=deps,
93 tests_require=["nose", "webtest", "requests"],
94 package_data={
95 "errbot": [
96 "backends/*.plug",
97 "backends/*.html",
98 "backends/styles/*.css",
99 "backends/images/*.svg",
100 "core_plugins/*.plug",
101 "core_plugins/*.md",
102 "core_plugins/templates/*.md",
103 "storage/*.plug",
104 "templates/initdir/example.py",
105 "templates/initdir/example.plug",
106 "templates/initdir/config.py.tmpl",
107 "templates/*.md",
108 "templates/new_plugin.py.tmpl",
109 ],
110 },
111 extras_require={
112 "slack": [
113 "errbot-backend-slackv3==0.2.1",
114 ],
115 "discord": [
116 "err-backend-discord==3.0.1",
117 ],
118 "mattermost": [
119 "err-backend-mattermost==3.0.0",
120 ],
121 "IRC": [
122 "irc==20.3.0",
123 ],
124 "telegram": [
125 "python-telegram-bot==13.15",
126 ],
127 "XMPP": [
128 "slixmpp==1.8.4",
129 "pyasn1==0.5.0",
130 "pyasn1-modules==0.3.0",
131 ],
132 ':sys_platform!="win32"': ["daemonize==2.5.0"],
133 },
134 author="errbot.io",
135 author_email="[email protected]",
136 description="Errbot is a chatbot designed to be simple to extend with plugins written in Python.",
137 long_description_content_type="text/x-rst",
138 long_description="".join([read("README.rst"), "\n\n", changes]),
139 license="GPL",
140 keywords="xmpp irc slack hipchat gitter tox chatbot bot plugin chatops",
141 url="http://errbot.io/",
142 classifiers=[
143 "Development Status :: 5 - Production/Stable",
144 "Topic :: Communications :: Chat",
145 "Topic :: Communications :: Chat :: Internet Relay Chat",
146 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
147 "Operating System :: OS Independent",
148 "Programming Language :: Python :: 3",
149 "Programming Language :: Python :: 3.8",
150 "Programming Language :: Python :: 3.9",
151 "Programming Language :: Python :: 3.10",
152 ],
153 src_root=src_root,
154 platforms="any",
155 )