-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
78 lines (69 loc) · 2.47 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
# -*- coding: utf-8 -*-
"""
test_mail
~~~~~~~~~
A plugin for testing the mail server config.
:copyright: (c) 2018 by Peter Justin.
:license: BSD License, see LICENSE for more details.
"""
import ast
import re
from setuptools import find_packages, setup
from setuptools.command.install import install
with open("test_mail/__init__.py", "rb") as f:
version_line = re.search(
r"__version__\s+=\s+(.*)", f.read().decode("utf-8")
).group(1)
version = str(ast.literal_eval(version_line))
class InstallWithTranslations(install):
def run(self):
# https://stackoverflow.com/a/41120180
from babel.messages.frontend import compile_catalog # noqa
compiler = compile_catalog(self.distribution)
option_dict = self.distribution.get_option_dict("compile_catalog")
compiler.domain = [option_dict["domain"][1]]
compiler.directory = option_dict["directory"][1]
compiler.run()
super().run()
setup(
name="flaskbb-plugin-test-mail",
version=version,
url="https://flaskbb.org",
project_urls={
"Code": "https://github.com/flaskbb/flaskbb-plugin-test-mail",
"Issue Tracker": "https://github.com/flaskbb/flaskbb-plugin-test-mail/issues",
},
license="BSD License",
author="Peter Justin",
author_email="[email protected]",
description="A plugin for testing the mail server config",
long_description=__doc__,
keywords="flaskbb plugin test mail",
cmdclass={"install": InstallWithTranslations},
packages=find_packages("."),
include_package_data=True,
package_data={
"": [
"test_mail/translations/*/*/*.mo",
"test_mail/translations/*/*/*.po",
]
},
zip_safe=False,
platforms="any",
entry_points={"flaskbb_plugins": ["test mail = test_mail"]},
install_requires=["FlaskBB"], # pin to a version to has pluggy integration
setup_requires=["Babel"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Environment :: Plugins",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)