-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
setup.py
executable file
·115 lines (94 loc) · 2.73 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
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import msgfmt
import setuptools
from setuptools.command.bdist_egg import bdist_egg
from distutils.command.build import build
APPNAME = 'naomi'
class naomi_bdist_egg(bdist_egg):
def run(self):
self.run_command('build_i18n')
setuptools.command.bdist_egg.bdist_egg.run(self)
class naomi_build_i18n(setuptools.Command):
description = 'compile PO translations to MO files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
for root, _, filenames in os.walk(os.path.dirname(__file__)):
for po_filename in filenames:
filename, ext = os.path.splitext(po_filename)
if ext != '.po':
continue
path = os.path.join(root, filename)
po_path = os.extsep.join([path, 'po'])
mo_path = os.extsep.join([path, 'mo'])
print('compile %s -> %s' % (po_path, mo_path))
with open(mo_path, 'wb') as f:
f.write(msgfmt.Msgfmt(po_path).get())
class naomi_build(build):
sub_commands = build.sub_commands + [
('build_i18n', None)
]
setuptools.setup(
name=APPNAME,
version='2.0a1.dev1',
url='http://naomiproject.github.io/',
license='MIT',
author='Shubhro Saha, Charlie Marsh, Jan Holthuis',
author_email=(
'[email protected], ' +
'[email protected], ' +
),
description=(
'Naomi is an open source platform for developing ' +
'always-on, voice-controlled applications.'
),
install_requires=[
'APScheduler',
'argparse',
'mock',
'python-slugify',
'pytz',
'PyYAML',
'requests'
],
packages=[APPNAME],
package_data={
APPNAME: [
'data/audio/*.wav',
'data/locale/*.po',
'data/locale/*.mo',
'data/standard_phrases/*.txt',
'../plugins/*/*/*.py',
'../plugins/*/*/plugin.info',
'../plugins/*/*/*.txt',
'../plugins/*/*/locale/*.po',
'../plugins/*/*/locale/*.mo',
'../plugins/*/*/tests/*.py'
]
},
data_files=[
('share/doc/%s' % APPNAME, [
'AUTHORS.md',
'CONTRIBUTING.md',
'LICENSE.md',
'README.md'
])
],
entry_points={
'console_scripts': [
'Naomi = %s.main:main' % APPNAME
]
},
cmdclass={
'bdist_egg': naomi_bdist_egg,
'build': naomi_build,
'build_i18n': naomi_build_i18n,
},
test_suite='tests'
)