From 2fd6c962d26aa0c702da573256f2ee5ea9b1a04f Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 28 Jul 2024 15:33:21 +0200 Subject: [PATCH] chore: improve extract json script --- build_helpers/extract_config_json_schema.py | 17 +++++++++++++++++ build_helpers/extract_json_schema.py | 10 ---------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 build_helpers/extract_config_json_schema.py delete mode 100644 build_helpers/extract_json_schema.py diff --git a/build_helpers/extract_config_json_schema.py b/build_helpers/extract_config_json_schema.py new file mode 100644 index 000000000..44ecc0f91 --- /dev/null +++ b/build_helpers/extract_config_json_schema.py @@ -0,0 +1,17 @@ +"""Script to extract the configuration json schema from config_schema.py file.""" + +from pathlib import Path + +import rapidjson + +from freqtrade.configuration.config_schema import CONF_SCHEMA + + +def extract_config_json_schema(): + schema_filename = Path(__file__).parent / "schema.json" + with schema_filename.open("w") as f: + rapidjson.dump(CONF_SCHEMA, f, indent=2) + + +if __name__ == "__main__": + extract_config_json_schema() diff --git a/build_helpers/extract_json_schema.py b/build_helpers/extract_json_schema.py deleted file mode 100644 index b9afa0471..000000000 --- a/build_helpers/extract_json_schema.py +++ /dev/null @@ -1,10 +0,0 @@ -from pathlib import Path - -import rapidjson - -from freqtrade.configuration.config_schema import CONF_SCHEMA - - -schema_filename = Path(__file__).parent / "schema.json" -with schema_filename.open("w") as f: - rapidjson.dump(CONF_SCHEMA, f, indent=2)