blob: 71520140c9bf960f8903108e0f0574c30f757503 [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
6class CustomBuild(build):
7 def run(self):
8 build.run(self)
9
10 SETTINGS_FILE = 'settings.yaml'
11 OUTPUT_FILE = 'settings_file.py'
12
13 with open(SETTINGS_FILE) as s:
14 data = yaml.safe_load(s)
15
16 with open(OUTPUT_FILE, 'w') as f:
17 f.write('SETTINGS=\\\n')
18 pprint.pprint(data, stream=f)
Adriana Kobylak256be782016-08-24 15:43:16 -050019
Brad Bishop3b3cffb2016-09-21 20:19:41 -040020setup(
21 name='phosphor-settings',
22 version='1.0',
23 scripts=['settings_manager.py'],
Brad Bishop54be9102016-09-21 14:50:36 -040024 data_files=[('phosphor-settings', ['settings_file.py'])],
25 cmdclass={'build': CustomBuild})