From 8c94cf57c4d9c504ef8f8dc579245d2180caf3bf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 15 Mar 2018 12:43:51 +0000 Subject: [PATCH] [Docs] Fix doc building idempotency When running the doc building a new scenario was generated, and appened to the scenario-table-gen.html page. We should instead generate that page from scratch, and ensure it's always the same content. This doesn't clean the scenario table gen, it simply makes sure the generated content is always ordered the same way. Change-Id: I9098f5d76b73be5ef28684027ff5039cd52d6ddb --- doc/source/conf.py | 2 +- doc/source/scenario_table_gen.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index bf52d93195..2e089c48a6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -35,7 +35,7 @@ stg = imp.load_source( 'scenario_table_gen', os.path.join(CONF_PATH, 'scenario_table_gen.py') ) -with open(TABLE_FILE, 'a+') as f: +with open(TABLE_FILE, 'w') as f: f.write(stg.main()) # If extensions (or modules to document with autodoc) are in another directory, diff --git a/doc/source/scenario_table_gen.py b/doc/source/scenario_table_gen.py index 5bc743ea5e..166c21f143 100644 --- a/doc/source/scenario_table_gen.py +++ b/doc/source/scenario_table_gen.py @@ -41,7 +41,7 @@ def main(): for items in scenario_meta_data.values(): for item in items: config_items.add(item['name'].split('.')[0]) - config_items = list(config_items) + config_items = list(sorted(config_items)) for item in config_items: HTML_TABLE += ''