blob: a411807a085ddbc45617f6ed1db8f1f70c6d1598 [file] [log] [blame]
Adriana Kobylak256be782016-08-24 15:43:16 -05001from distutils.core import setup
Brad Bishop54be9102016-09-21 14:50:36 -04002from distutils.command.build import build
3import yaml
4import pprint
5
Brad Bishopc1e5e9f2016-09-29 09:40:01 -04006
Brad Bishop54be9102016-09-21 14:50:36 -04007class CustomBuild(build):
8 def run(self):
9 build.run(self)
10
11 SETTINGS_FILE = 'settings.yaml'
12 OUTPUT_FILE = 'settings_file.py'
13
14 with open(SETTINGS_FILE) as s:
15 data = yaml.safe_load(s)
16
17 with open(OUTPUT_FILE, 'w') as f:
18 f.write('SETTINGS=\\\n')
19 pprint.pprint(data, stream=f)
Adriana Kobylak256be782016-08-24 15:43:16 -050020
Gunnar Millsa16abc52018-01-27 10:02:34 -060021
Brad Bishop3b3cffb2016-09-21 20:19:41 -040022setup(
23 name='phosphor-settings',
24 version='1.0',
25 scripts=['settings_manager.py'],
Brad Bishop54be9102016-09-21 14:50:36 -040026 data_files=[('phosphor-settings', ['settings_file.py'])],
27 cmdclass={'build': CustomBuild})
Brad Bishop31c42f02016-09-29 09:35:32 -040028
29# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4