forked from opsdroid/opsdroid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
61 lines (49 loc) · 1.74 KB
/
setup.py
File metadata and controls
61 lines (49 loc) · 1.74 KB
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
#!/usr/bin/env python3
from setuptools import setup
from setuptools.command.build_py import build_py
from setuptools.command.sdist import sdist
from setuptools.command.develop import develop
from setuptools.config import read_configuration
from itertools import chain
import versioneer
class Develop(develop):
"""Custom `develop` command to always build mo files on install -e."""
def run(self):
self.run_command("compile_catalog")
develop.run(self) # old style class
class BuildPy(build_py):
"""Custom `build_py` command to always build mo files for wheels."""
def run(self):
self.run_command("compile_catalog")
build_py.run(self) # old style class
class Sdist(sdist):
"""Custom `sdist` command to ensure that mo files are always created."""
def run(self):
self.run_command("compile_catalog")
sdist.run(self) # old style class
extras = read_configuration("setup.cfg")["options"]["extras_require"]
common_extras = [
"connector_matrix",
"connector_slack",
"database_sqlite",
]
extras["all"] = list(chain(*(extras[key] for key in extras.keys() if key != "test")))
extras["all_connectors"] = list(
chain(*(extras[key] for key in extras.keys() if key.startswith("connector")))
)
extras["all_databases"] = list(
chain(*(extras[key] for key in extras.keys() if key.startswith("database")))
)
extras["all_parsers"] = list(
chain(*(extras[key] for key in extras.keys() if key.startswith("parser")))
)
extras["common"] = list(
chain(*(extras[key] for key in extras.keys() and common_extras))
)
setup(
extras_require=extras,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(
{"sdist": Sdist, "build_py": BuildPy, "develop": Develop}
),
)