Debian Codegraph @

setup.py

raw ◀ ▶
Source reconstructed at patch state 1 of 2 — not the installed (fully patched) source.
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 "setuptools==68.1.2",
32 "flask",
33 "requests==2.31.0",
34 "jinja2==3.1.2",
35 "pyOpenSSL==23.2.0",
36 "colorlog==6.7.0",
37 "markdown==3.4.4",
38 "ansi==0.3.6",
39 "Pygments==2.16.1",
40 "dulwich==0.21.5", # python implementation of git
41 "deepmerge==1.1.0",
42 ]
43
44 if py_version < (3, 9):
45 deps.append("graphlib-backport==1.0.3")
46
47 src_root = os.curdir
48
49
50 def read_version():
51 """
52 Read directly the errbot/version.py and gives the version without loading Errbot.
53 :return: errbot.version.VERSION
54 """
55
56 variables = {}
57 with open(VERSION_FILE) as f:
58 exec(compile(f.read(), "version.py", "exec"), variables)
59 return variables["VERSION"]
60
61
62 def read(fname, encoding="ascii"):
63 return open(
64 os.path.join(os.path.dirname(__file__), fname), "r", encoding=encoding
65 ).read()
66
67
68 if __name__ == "__main__":
69
70 VERSION = read_version()
71
72 args = set(sys.argv)
73
74 changes = read("CHANGES.rst", "utf8")
75
76 if changes.find(VERSION) == -1:
77 raise Exception("You forgot to put a release note in CHANGES.rst ?!")
78
79 if args & {"bdist", "bdist_dumb", "bdist_rpm", "bdist_wininst", "bdist_msi"}:
80 raise Exception("err doesn't support binary distributions")
81
82 packages = find_packages(src_root, include=["errbot", "errbot.*"])
83
84 setup(
85 name="errbot",
86 version=VERSION,
87 packages=packages,
88 entry_points={
89 "console_scripts": [
90 "errbot = errbot.cli:main",
91 ]
92 },
93 install_requires=deps,
94 tests_require=["nose", "webtest", "requests"],
95 package_data={
96 "errbot": [
97 "backends/*.plug",
98 "backends/*.html",
99 "backends/styles/*.css",
100 "backends/images/*.svg",
101 "core_plugins/*.plug",
102 "core_plugins/*.md",
103 "core_plugins/templates/*.md",
104 "storage/*.plug",
105 "templates/initdir/example.py",
106 "templates/initdir/example.plug",
107 "templates/initdir/config.py.tmpl",
108 "templates/*.md",
109 "templates/new_plugin.py.tmpl",
110 ],
111 },
112 extras_require={
113 "slack": [
114 "errbot-backend-slackv3==0.2.1",
115 ],
116 "discord": [
117 "err-backend-discord==3.0.1",
118 ],
119 "mattermost": [
120 "err-backend-mattermost==3.0.0",
121 ],
122 "IRC": [
123 "irc==20.3.0",
124 ],
125 "telegram": [
126 "python-telegram-bot==13.15",
127 ],
128 "XMPP": [
129 "slixmpp==1.8.4",
130 "pyasn1==0.5.0",
131 "pyasn1-modules==0.3.0",
132 ],
133 ':sys_platform!="win32"': ["daemonize==2.5.0"],
134 },
135 author="errbot.io",
136 author_email="[email protected]",
137 description="Errbot is a chatbot designed to be simple to extend with plugins written in Python.",
138 long_description_content_type="text/x-rst",
139 long_description="".join([read("README.rst"), "\n\n", changes]),
140 license="GPL",
141 keywords="xmpp irc slack hipchat gitter tox chatbot bot plugin chatops",
142 url="http://errbot.io/",
143 classifiers=[
144 "Development Status :: 5 - Production/Stable",
145 "Topic :: Communications :: Chat",
146 "Topic :: Communications :: Chat :: Internet Relay Chat",
147 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
148 "Operating System :: OS Independent",
149 "Programming Language :: Python :: 3",
150 "Programming Language :: Python :: 3.8",
151 "Programming Language :: Python :: 3.9",
152 "Programming Language :: Python :: 3.10",
153 ],
154 src_root=src_root,
155 platforms="any",
156 )