-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Generate schema, but currently seems to break flexlate
- Loading branch information
1 parent
c51471a
commit d9e5705
Showing
6 changed files
with
291 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from typing import Any, Dict | ||
|
||
from flexlate_dev.config import FlexlateDevConfig | ||
|
||
|
||
def create_config_schema() -> str: | ||
return FlexlateDevConfig.schema_json(indent=2) | ||
|
||
|
||
def main(): | ||
print(create_config_schema()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from pathlib import Path | ||
|
||
from flexlate_dev.config_schema import create_config_schema | ||
from tests.config import SCHEMA_PATH | ||
|
||
|
||
def main(path: Path = SCHEMA_PATH): | ||
schema = create_config_schema() | ||
path.write_text(schema) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,251 @@ | ||
{ | ||
"title": "FlexlateDevConfig", | ||
"description": "Base class for settings, allowing values to be overridden by environment variables.\n\nThis is useful in production for secrets you do not wish to save in code, it plays nicely with docker(-compose),\nHeroku and any 12 factor app design.", | ||
"type": "object", | ||
"properties": { | ||
"data": { | ||
"title": "Data", | ||
"env_names": [ | ||
"data" | ||
], | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/UserDataConfiguration" | ||
} | ||
}, | ||
"commands": { | ||
"title": "Commands", | ||
"env_names": [ | ||
"commands" | ||
], | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/UserCommand" | ||
} | ||
}, | ||
"run_configs": { | ||
"title": "Run Configs", | ||
"env_names": [ | ||
"run_configs" | ||
], | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/definitions/UserRootRunConfiguration" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"definitions": { | ||
"UserDataConfiguration": { | ||
"title": "UserDataConfiguration", | ||
"type": "object", | ||
"properties": { | ||
"data": { | ||
"title": "Data", | ||
"type": "object" | ||
}, | ||
"folder_name": { | ||
"title": "Folder Name", | ||
"type": "string" | ||
}, | ||
"ignore": { | ||
"title": "Ignore", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"extends": { | ||
"title": "Extends", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"UserCommand": { | ||
"title": "UserCommand", | ||
"type": "object", | ||
"properties": { | ||
"run": { | ||
"title": "Run", | ||
"type": "string" | ||
}, | ||
"name": { | ||
"title": "Name", | ||
"type": "string" | ||
}, | ||
"background": { | ||
"title": "Background", | ||
"type": "boolean" | ||
}, | ||
"id": { | ||
"title": "Id", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"UserRunConfiguration": { | ||
"title": "UserRunConfiguration", | ||
"type": "object", | ||
"properties": { | ||
"pre_check": { | ||
"title": "Pre Check", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"post_init": { | ||
"title": "Post Init", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"pre_update": { | ||
"title": "Pre Update", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"post_update": { | ||
"title": "Post Update", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"data_name": { | ||
"title": "Data Name", | ||
"type": "string" | ||
}, | ||
"out_root": { | ||
"title": "Out Root", | ||
"type": "string", | ||
"format": "path" | ||
}, | ||
"auto_commit_message": { | ||
"title": "Auto Commit Message", | ||
"type": "string" | ||
}, | ||
"extends": { | ||
"title": "Extends", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"UserRootRunConfiguration": { | ||
"title": "UserRootRunConfiguration", | ||
"type": "object", | ||
"properties": { | ||
"pre_check": { | ||
"title": "Pre Check", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"post_init": { | ||
"title": "Post Init", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"pre_update": { | ||
"title": "Pre Update", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"post_update": { | ||
"title": "Post Update", | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/UserCommand" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
}, | ||
"data_name": { | ||
"title": "Data Name", | ||
"type": "string" | ||
}, | ||
"out_root": { | ||
"title": "Out Root", | ||
"type": "string", | ||
"format": "path" | ||
}, | ||
"auto_commit_message": { | ||
"title": "Auto Commit Message", | ||
"type": "string" | ||
}, | ||
"extends": { | ||
"title": "Extends", | ||
"type": "string" | ||
}, | ||
"publish": { | ||
"$ref": "#/definitions/UserRunConfiguration" | ||
}, | ||
"serve": { | ||
"$ref": "#/definitions/UserRunConfiguration" | ||
} | ||
} | ||
} | ||
} | ||
} |