From bdc392a0f11d156f7b0e3728f0463e9cd4b99feb Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 27 Aug 2024 20:25:26 +0600 Subject: [PATCH 01/70] feat: more test spec added --- .../get-req-vars/coinstats-usd-request.chk | 11 ++++++++++ .../get-req-vars/coinstats-usd-validate.chk | 20 +++++++++++++++++++ .../get-req-vars/coinstats-usd-workflow.chk | 17 ++++++++++++++++ .../simple/coinstats-usd-request.chk | 11 ++++++++++ .../simple/coinstats-usd-validate.chk | 20 +++++++++++++++++++ .../simple/coinstats-usd-workflow.chk | 16 +++++++++++++++ 6 files changed, 95 insertions(+) create mode 100644 tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk create mode 100644 tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk create mode 100644 tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk create mode 100644 tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-request.chk create mode 100644 tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-validate.chk create mode 100644 tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk new file mode 100644 index 00000000..1973269f --- /dev/null +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk @@ -0,0 +1,11 @@ +--- +version: default:http:0.7.2 + +request: + url: https://openapiv1.coinstats.app/coins/bitcoin?currency=USD + method: GET + headers: + "X-API-KEY": <% _ENV.COINSTATS_API_KEY %> + +expose: + - <% _response %> diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk new file mode 100644 index 00000000..6b4f6729 --- /dev/null +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk @@ -0,0 +1,20 @@ +--- +version: default:validation:0.7.2 + +asserts: + - { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`' } + - { type: Map, actual: <% _data.headers %>, msg_pass: 'Header is a list', msg_fail: 'Header is not a list' } + - { type: Str, actual: <% _data.code %>, msg_pass: 'Code `{type_actual}({value_actual})` is a string', msg_fail: 'Code `{type_actual}({value_actual})` is not a string', cast_actual_to: int } + - { type: StrHave, actual: <% _data.info %>, other: "200 OK" } + - { type: Map, actual: <% _data.body %> } + - { type: List, actual: <% _data.body.explorers %> } + - { type: Float, actual: <% _data.body.price %> } + - { type: MapHasKeys, actual: <% _data.body %>, expected: [ "price", "priceBtc", "priceChange1d", "priceChange1h", "priceChange1w" ] } + +expose: + - <% _asserts_response %> + - <% _data %> + +# --- shell command --- +# pipenv run python -m chk validate -nf tests/resources/storage/spec_docs/validate/btc-usd-validate.chk -D "$(pipenv run python -m chk fetch -nf tests/resources/storage/spec_docs/fetch/bitcoin-usd.chk)" +# --- diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk new file mode 100644 index 00000000..aa05df78 --- /dev/null +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk @@ -0,0 +1,17 @@ +version: default:workflow:0.8.0 + +name: simple Btc workflow +id: simple Btc workflow 1 + +tasks: + - name: Fetch some content from URL + uses: fetch + file: ./coinstats-usd-request.chk +# variables: { "var": 2 } + + - name: Validate the content is okay + uses: validate + file: ./coinstats-usd-validate.chk +# variables: { "var": 2 } +# arguments: +# data: <% _tasks.0._expose.0 %> diff --git a/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-request.chk b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-request.chk new file mode 100644 index 00000000..1973269f --- /dev/null +++ b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-request.chk @@ -0,0 +1,11 @@ +--- +version: default:http:0.7.2 + +request: + url: https://openapiv1.coinstats.app/coins/bitcoin?currency=USD + method: GET + headers: + "X-API-KEY": <% _ENV.COINSTATS_API_KEY %> + +expose: + - <% _response %> diff --git a/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-validate.chk b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-validate.chk new file mode 100644 index 00000000..6b4f6729 --- /dev/null +++ b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-validate.chk @@ -0,0 +1,20 @@ +--- +version: default:validation:0.7.2 + +asserts: + - { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`' } + - { type: Map, actual: <% _data.headers %>, msg_pass: 'Header is a list', msg_fail: 'Header is not a list' } + - { type: Str, actual: <% _data.code %>, msg_pass: 'Code `{type_actual}({value_actual})` is a string', msg_fail: 'Code `{type_actual}({value_actual})` is not a string', cast_actual_to: int } + - { type: StrHave, actual: <% _data.info %>, other: "200 OK" } + - { type: Map, actual: <% _data.body %> } + - { type: List, actual: <% _data.body.explorers %> } + - { type: Float, actual: <% _data.body.price %> } + - { type: MapHasKeys, actual: <% _data.body %>, expected: [ "price", "priceBtc", "priceChange1d", "priceChange1h", "priceChange1w" ] } + +expose: + - <% _asserts_response %> + - <% _data %> + +# --- shell command --- +# pipenv run python -m chk validate -nf tests/resources/storage/spec_docs/validate/btc-usd-validate.chk -D "$(pipenv run python -m chk fetch -nf tests/resources/storage/spec_docs/fetch/bitcoin-usd.chk)" +# --- diff --git a/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk new file mode 100644 index 00000000..8caa82f6 --- /dev/null +++ b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk @@ -0,0 +1,16 @@ +version: default:workflow:0.8.0 + +name: simple Btc workflow +id: simple Btc workflow 1 + +tasks: + - name: Fetch some content from URL + uses: fetch + file: ./coinstats-usd-request.chk + + - name: Validate the content is okay + uses: validate + file: ./coinstats-usd-validate.chk +# variables: { "var": 2 } +# arguments: +# data: <% _tasks.0._expose.0 %> From d4060bbeeed7d67d5772f33cca92efeb482e1d9a Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 28 Aug 2024 18:07:57 +0600 Subject: [PATCH 02/70] feat: workflow runs as expected for simple workflow --- tests/modules/workflow/wf_domain_test.py | 3 ++- .../spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/modules/workflow/wf_domain_test.py b/tests/modules/workflow/wf_domain_test.py index 64bc4af4..5655c4a5 100644 --- a/tests/modules/workflow/wf_domain_test.py +++ b/tests/modules/workflow/wf_domain_test.py @@ -40,7 +40,8 @@ def test_from_file_context_pass_noid(load_chk_file, load_file_ctx_for_file): class TestWorkflowDocumentSupport: @staticmethod def test_process_task_template_pass(load_chk_file, load_file_ctx_for_file): - filepath = f"{SPEC_DIR}workflow/simple-btc-wf.chk" + # filepath = f"{SPEC_DIR}workflow/simple-btc-wf.chk" + filepath = f"{SPEC_DIR}workflow_cases/simple/coinstats-usd-workflow.chk" file_ctx = load_file_ctx_for_file(filepath) wfdoc = WorkflowDocument.from_file_context(file_ctx) diff --git a/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk index 8caa82f6..82455d15 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/simple/coinstats-usd-workflow.chk @@ -11,6 +11,3 @@ tasks: - name: Validate the content is okay uses: validate file: ./coinstats-usd-validate.chk -# variables: { "var": 2 } -# arguments: -# data: <% _tasks.0._expose.0 %> From 0e3c07cbf80eba894e0543d20862e792c71e212f Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 29 Aug 2024 12:40:23 +0600 Subject: [PATCH 03/70] refactor: add url params as separate section --- .../workflow_cases/get-req-vars/coinstats-usd-request.chk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk index 1973269f..f368902c 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-request.chk @@ -1,8 +1,13 @@ --- version: default:http:0.7.2 +variables: + convertCurrency: USD + request: - url: https://openapiv1.coinstats.app/coins/bitcoin?currency=USD + url: "https://openapiv1.coinstats.app/coins/bitcoin" + url_params: + currency: <% convertCurrency %> method: GET headers: "X-API-KEY": <% _ENV.COINSTATS_API_KEY %> From 136ede7c7236aa389b5ae3aae2027cbaff874782 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 29 Aug 2024 19:02:19 +0600 Subject: [PATCH 04/70] refactor: to make similar sign as other module --- chk/modules/workflow/__init__.py | 36 ++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 1a66cf3c..45d58124 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -175,18 +175,10 @@ def process_task_template( ) -def execute( - ctx: FileContext, exec_ctx: ExecuteContext, cb: abc.Callable = lambda *args: ... -) -> None: - """Run a workflow document - - Args: - ctx: FileContext object to handle - exec_ctx: ExecuteContext - cb: Callable - """ +def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: + """Call a workflow document""" - wflow_doc = WorkflowDocument.from_file_context(ctx) + wflow_doc = WorkflowDocument.from_file_context(file_ctx) ic(wflow_doc) variable_doc = Variables() @@ -202,3 +194,25 @@ def execute( # VersionedDocumentSupport.validate_with_schema( # HttpDocumentSupport.build_schema(), http_doc # ) + + return ExecResponse( + file_ctx=file_ctx, + exec_ctx=exec_ctx, + variables_exec={}, + variables=variable_doc, + extra={}, + ) + + +def execute( + ctx: FileContext, exec_ctx: ExecuteContext, cb: abc.Callable = lambda *args: ... +) -> None: + """Run a workflow document + + Args: + ctx: FileContext object to handle + exec_ctx: ExecuteContext + cb: Callable + """ + + _ = call(file_ctx=ctx, exec_ctx=exec_ctx) From 75f0434e89a561f44d165584d6c21b48a629dcd4 Mon Sep 17 00:00:00 2001 From: HSN Date: Sat, 31 Aug 2024 16:36:27 +0600 Subject: [PATCH 05/70] refactor: handling obj init in contractor --- chk/modules/workflow/__init__.py | 4 ++-- chk/modules/workflow/entities.py | 20 ++++---------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 45d58124..8f7702e4 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -84,9 +84,9 @@ def from_file_context(ctx: FileContext) -> WorkflowDocument: if "uses" in task: if task["uses"] == "fetch": - tasks.append(ChkwareTask.from_dict(task)) + tasks.append(ChkwareTask(**task)) elif task["uses"] == "validate": - tasks.append(ChkwareValidateTask.from_dict(task)) + tasks.append(ChkwareValidateTask(**task)) else: raise RuntimeError("Malformed task item found.") diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index f2f5efb6..ed7469ea 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -28,14 +28,8 @@ class ChkwareTask(BaseModel): file: str variables: dict = Field(default_factory=dict) - @staticmethod - def from_dict(data: dict) -> ChkwareTask: - """constractor""" - - if not data: - raise AttributeError("ChkwareTask:from_dict Empty data given") - - return ChkwareTask(**data) + def __init__(self, **kwargs: dict) -> None: + super().__init__(**kwargs) class ChkwareValidateTask(ChkwareTask): @@ -52,11 +46,5 @@ class ChkwareTaskDataArgument(BaseModel): arguments: ChkwareTaskDataArgument = Field(default_factory=ChkwareTaskDataArgument) - @staticmethod - def from_dict(data: dict) -> ChkwareValidateTask: - """constructor""" - - if not data: - raise AttributeError("ChkwareValidateTask:from_dict Empty data given") - - return ChkwareValidateTask(**data) + def __init__(self, **kwargs: dict) -> None: + super().__init__(**kwargs) From a54888e668b8a2223f043918f9a84b85a9d36c4a Mon Sep 17 00:00:00 2001 From: HSN Date: Sat, 31 Aug 2024 17:18:41 +0600 Subject: [PATCH 06/70] feat: handle absolute path conversion in ChkwareTask --- chk/modules/workflow/__init__.py | 10 +++++----- chk/modules/workflow/entities.py | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 8f7702e4..affb43dc 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -77,6 +77,8 @@ def from_file_context(ctx: FileContext) -> WorkflowDocument: raise RuntimeError("`tasks:` is not list.") tasks = [] + base_fpath: str = ctx.filepath + for task in tasks_lst: # @TODO can this be done in ParsedTask class if not isinstance(task, dict): @@ -84,9 +86,9 @@ def from_file_context(ctx: FileContext) -> WorkflowDocument: if "uses" in task: if task["uses"] == "fetch": - tasks.append(ChkwareTask(**task)) + tasks.append(ChkwareTask(base_fpath, **task)) elif task["uses"] == "validate": - tasks.append(ChkwareValidateTask(**task)) + tasks.append(ChkwareValidateTask(base_fpath, **task)) else: raise RuntimeError("Malformed task item found.") @@ -118,13 +120,11 @@ def process_task_template( formatter(f"\n\nExecuting: {document.name}") formatter("-" * 5) - base_filepath: str = FileContext(*document.context).filepath task_executable_lst = [] for task in document.tasks: # @TODO should be done in ChkwareTask calls _task_d = task.model_dump() - _task_d["file"] = generate_abs_path(base_filepath, task.file) execution_ctx = ExecuteContext( {"dump": True, "format": True}, @@ -198,7 +198,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, - variables_exec={}, + variables_exec=ExposableVariables({}), variables=variable_doc, extra={}, ) diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index ed7469ea..91969f36 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -5,11 +5,10 @@ from __future__ import annotations import enum -import typing -from uuid import uuid4 - from pydantic import BaseModel, Field, ConfigDict +from chk.infrastructure.file_loader import generate_abs_path + class WorkflowUses(enum.StrEnum): """Types of Workflow Uses""" @@ -28,7 +27,12 @@ class ChkwareTask(BaseModel): file: str variables: dict = Field(default_factory=dict) - def __init__(self, **kwargs: dict) -> None: + def __init__(self, basepath: str, /, **kwargs: dict) -> None: + """Constructor""" + + if isinstance(kwargs["file"], str) and len(kwargs["file"]) != 0: + kwargs["file"] = generate_abs_path(basepath, kwargs["file"]) + super().__init__(**kwargs) @@ -46,5 +50,7 @@ class ChkwareTaskDataArgument(BaseModel): arguments: ChkwareTaskDataArgument = Field(default_factory=ChkwareTaskDataArgument) - def __init__(self, **kwargs: dict) -> None: - super().__init__(**kwargs) + def __init__(self, basepath: str, /, **kwargs: dict) -> None: + """Constructor""" + + super().__init__(basepath, **kwargs) From 1f26da6910752fe52d2ce1315a79d9ba072c37b6 Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 1 Sep 2024 14:18:06 +0600 Subject: [PATCH 07/70] docs: added todo for next update --- chk/modules/fetch.py | 2 ++ chk/modules/validate/__init__.py | 2 ++ chk/modules/workflow/__init__.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 5153d5b8..78254d29 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -343,6 +343,8 @@ def from_file_context(ctx: FileContext) -> HttpDocument: if not (request_dct := data_get(ctx.document, "request")): raise RuntimeError("`request:` not found.") + # @TODO keep `context`, `version` as object + # @TODO implement __repr__ for WorkflowDocument return HttpDocument( context=tuple(ctx), version=version_str, diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index e166a8a3..7827a3ee 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -91,6 +91,8 @@ def from_file_context(ctx: FileContext) -> ValidationDocument: _data = data_get(ctx.document, ValidationConfigNode.DATA, {}) + # @TODO keep `context`, `version` as object + # @TODO implement __repr__ for WorkflowDocument return ValidationDocument( context=tuple(ctx), version=_version, diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index affb43dc..ef68e464 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -92,6 +92,8 @@ def from_file_context(ctx: FileContext) -> WorkflowDocument: else: raise RuntimeError("Malformed task item found.") + # @TODO keep `context`, `version` as object + # @TODO implement __repr__ for WorkflowDocument return WorkflowDocument( context=tuple(ctx), version=version_str, From d75bf8512c4d521ea5ce4c1c3bb51bacecd596c7 Mon Sep 17 00:00:00 2001 From: HSN Date: Mon, 2 Sep 2024 16:05:46 +0600 Subject: [PATCH 08/70] refactor: improve checking --- chk/modules/workflow/entities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index 91969f36..19b0bc24 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -30,7 +30,11 @@ class ChkwareTask(BaseModel): def __init__(self, basepath: str, /, **kwargs: dict) -> None: """Constructor""" - if isinstance(kwargs["file"], str) and len(kwargs["file"]) != 0: + if ( + "file" in kwargs + and isinstance(kwargs["file"], str) + and len(kwargs["file"]) != 0 + ): kwargs["file"] = generate_abs_path(basepath, kwargs["file"]) super().__init__(**kwargs) From c551b83b76250ace2f29cfe45c8d085dc6c4b187 Mon Sep 17 00:00:00 2001 From: HSN Date: Mon, 2 Sep 2024 16:06:19 +0600 Subject: [PATCH 09/70] refactor: move making task to separate function --- chk/modules/workflow/__init__.py | 42 ++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index ef68e464..9bfc7a4f 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -76,22 +76,6 @@ def from_file_context(ctx: FileContext) -> WorkflowDocument: if not isinstance(tasks_lst, list): raise RuntimeError("`tasks:` is not list.") - tasks = [] - base_fpath: str = ctx.filepath - - for task in tasks_lst: - # @TODO can this be done in ParsedTask class - if not isinstance(task, dict): - raise RuntimeError("`tasks.*.item` should be map.") - - if "uses" in task: - if task["uses"] == "fetch": - tasks.append(ChkwareTask(base_fpath, **task)) - elif task["uses"] == "validate": - tasks.append(ChkwareValidateTask(base_fpath, **task)) - else: - raise RuntimeError("Malformed task item found.") - # @TODO keep `context`, `version` as object # @TODO implement __repr__ for WorkflowDocument return WorkflowDocument( @@ -115,6 +99,32 @@ def _prepare_validate_task_argument_data_(cls, task: ChkwareTask) -> dict: return {} + @classmethod + def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: + """validate task data""" + if "base_file_path" not in kwargs: + raise ValueError("`base_file_path` not passed.") + + if "uses" not in task_d_: + raise RuntimeError("Malformed task item found.") + + if task_d_["uses"] not in ( + WorkflowUses.fetch.value, + WorkflowUses.validate.value, + ): + raise RuntimeError("task.uses unsupported.") + + base_file_path = str(kwargs["base_file_path"]) + + return ( + ChkwareTask(base_file_path, **task_d_) + if task_d_["uses"] == "fetch" + else ChkwareValidateTask(base_file_path, **task_d_) + ) + + @classmethod + def exectute_tasks(cls, task_list: list[ChkwareTask]): ... + @classmethod def process_task_template( cls, document: WorkflowDocument, variables: Variables From 1df229146fce7882a6e796dc9b45fb2b4923591f Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 3 Sep 2024 12:11:10 +0600 Subject: [PATCH 10/70] chore: remove hence --- Pipfile | 1 - Pipfile.lock | 13 +------------ requirements-dev.txt | 32 +++++++++++++++----------------- requirements.txt | 7 ++----- 4 files changed, 18 insertions(+), 35 deletions(-) diff --git a/Pipfile b/Pipfile index 6b5525b8..27115972 100644 --- a/Pipfile +++ b/Pipfile @@ -12,7 +12,6 @@ defusedxml = "*" xmltodict = "*" python-dotenv = "*" pydantic = "*" -hence = {ref = "v0.10.1", git = "git+https://github.com/0hsn/hence.git"} [dev-packages] pytest = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 0beeff8a..7c7862b3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "69851935505471f0311c54705c6803b90f0ee6c22ffabd4380e260282e0b16b8" + "sha256": "392659112522bebd6fdaf2d24c384cc546c19f65e7c2b260538daf8cd70f43b3" }, "pipfile-spec": 6, "requires": { @@ -154,10 +154,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==0.7.1" }, - "hence": { - "git": "git+https://github.com/0hsn/hence.git", - "ref": "c0697edf97bc67b563302223cdbd162d7144a69f" - }, "idna": { "hashes": [ "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac", @@ -166,13 +162,6 @@ "markers": "python_version >= '3.6'", "version": "==3.8" }, - "paradag": { - "hashes": [ - "sha256:3d2977892de62bd111c517c25f4c75750259c94c9711a190094b942723697ab7", - "sha256:dbd57185a1553970877c452aedf961912eb7825a9a25e8a71010e84660710c42" - ], - "version": "==1.2.0" - }, "pydantic": { "hashes": [ "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a", diff --git a/requirements-dev.txt b/requirements-dev.txt index 28bcd2ed..c23e2deb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,43 +1,44 @@ -i https://pypi.org/simple -aiohttp==3.9.5 +aiohappyeyeballs==2.4.0; python_version >= '3.8' +aiohttp==3.10.5 aiosignal==1.3.1; python_version >= '3.7' -astroid==3.2.3; python_full_version >= '3.8.0' +astroid==3.2.4; python_full_version >= '3.8.0' asttokens==2.4.1 -attrs==23.2.0; python_version >= '3.7' -black[d]==24.4.2; python_version >= '3.8' +attrs==24.2.0; python_version >= '3.7' +black[d]==24.8.0; python_version >= '3.8' certifi==2024.7.4; python_version >= '3.6' charset-normalizer==3.3.2; python_full_version >= '3.7.0' click==8.1.7; python_version >= '3.7' colorama==0.4.6; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' -coverage[toml]==7.6.0; python_version >= '3.8' +coverage[toml]==7.6.1; python_version >= '3.8' coveralls==4.0.1; python_version < '3.13' and python_version >= '3.8' dill==0.3.8; python_version >= '3.11' docopt==0.6.2 executing==2.0.1; python_version >= '3.5' -flake8==7.1.0; python_full_version >= '3.8.1' +flake8==7.1.1; python_full_version >= '3.8.1' frozenlist==1.4.1; python_version >= '3.8' icecream==2.1.3 -idna==3.7; python_version >= '3.5' +idna==3.8; python_version >= '3.6' iniconfig==2.0.0; python_version >= '3.7' isort==5.13.2; python_full_version >= '3.8.0' mccabe==0.7.0; python_version >= '3.6' multidict==6.0.5; python_version >= '3.7' -mypy==1.10.1; python_version >= '3.8' +mypy==1.11.2; python_version >= '3.8' mypy-extensions==1.0.0; python_version >= '3.5' packaging==24.1; python_version >= '3.8' pathspec==0.12.1; python_version >= '3.8' platformdirs==4.2.2; python_version >= '3.8' pluggy==1.5.0; python_version >= '3.8' -pycodestyle==2.12.0; python_version >= '3.8' +pycodestyle==2.12.1; python_version >= '3.8' pyflakes==3.2.0; python_version >= '3.8' pygments==2.18.0; python_version >= '3.8' -pylint==3.2.5; python_full_version >= '3.8.0' -pytest==8.2.2; python_version >= '3.8' +pylint==3.2.6; python_full_version >= '3.8.0' +pytest==8.3.2; python_version >= '3.8' pytest-cov==5.0.0; python_version >= '3.8' requests==2.32.3; python_version >= '3.8' six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -tomlkit==0.13.0; python_version >= '3.8' -types-pyyaml==6.0.12.20240311; python_version >= '3.8' +tomlkit==0.13.2; python_version >= '3.8' +types-pyyaml==6.0.12.20240808; python_version >= '3.8' types-requests==2.32.0.20240712; python_version >= '3.8' typing-extensions==4.12.2; python_version < '3.13' urllib3==2.2.2; python_version >= '3.8' @@ -45,11 +46,8 @@ yarl==1.9.4; python_version >= '3.7' annotated-types==0.7.0; python_version >= '3.8' cerberus==1.3.5 defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -hence@ git+https://github.com/0hsn/hence.git@c671a79907c2fed46e89323fd411825d8697d416 -immutabledict==4.2.0; python_version >= '3.8' and python_version < '4.0' -paradag==1.2.0 pydantic==2.8.2; python_version >= '3.8' pydantic-core==2.20.1; python_version >= '3.8' python-dotenv==1.0.1; python_version >= '3.8' -pyyaml==6.0.1; python_version >= '3.6' +pyyaml==6.0.2; python_version >= '3.8' xmltodict==0.13.0; python_version >= '3.4' diff --git a/requirements.txt b/requirements.txt index 1fb88124..539b07ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,14 +4,11 @@ certifi==2024.7.4; python_version >= '3.6' charset-normalizer==3.3.2; python_full_version >= '3.7.0' click==8.1.7; python_version >= '3.7' defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -hence@ git+https://github.com/0hsn/hence.git@c671a79907c2fed46e89323fd411825d8697d416 -idna==3.7; python_version >= '3.5' -immutabledict==4.2.0; python_version >= '3.8' and python_version < '4.0' -paradag==1.2.0 +idna==3.8; python_version >= '3.6' pydantic==2.8.2; python_version >= '3.8' pydantic-core==2.20.1; python_version >= '3.8' python-dotenv==1.0.1; python_version >= '3.8' -pyyaml==6.0.1; python_version >= '3.6' +pyyaml==6.0.2; python_version >= '3.8' requests==2.32.3; python_version >= '3.8' typing-extensions==4.12.2; python_version < '3.13' urllib3==2.2.2; python_version >= '3.8' From e43c75b7e9e3ed711116617cb566734511fd90d7 Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 3 Sep 2024 13:04:29 +0600 Subject: [PATCH 11/70] refactor: remove hence usages --- chk/modules/fetch.py | 2 -- chk/modules/validate/__init__.py | 2 -- chk/modules/workflow/__init__.py | 3 --- 3 files changed, 7 deletions(-) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 78254d29..9450fb2f 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -11,7 +11,6 @@ from collections import UserDict, abc from urllib.parse import unquote, urlparse -from hence import task from pydantic import BaseModel, Field from requests.auth import HTTPBasicAuth @@ -578,7 +577,6 @@ def execute( HttpDocumentSupport.display(exposed_data, exec_ctx) -@task(title="Fetch work :: {fn_task_key}") def task_fetch(**kwargs: dict) -> ExecResponse: """Task impl""" diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 7827a3ee..f0670c59 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -9,7 +9,6 @@ from collections import abc import cerberus -from hence import task from chk.infrastructure.document import VersionedDocument, VersionedDocumentSupport from chk.infrastructure.file_loader import FileContext, ExecuteContext @@ -311,7 +310,6 @@ def execute( ValidationDocumentSupport.display(exposed_data, exec_ctx) -@task(title="Validate task :: {fn_task_key}") def task_validation(**kwargs: dict) -> ExecResponse: """Task impl""" diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 9bfc7a4f..77f99b10 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -7,7 +7,6 @@ import pathlib from uuid import uuid4 -from hence import run_tasks, _context, Utils from pydantic import Field, ConfigDict from icecream import ic @@ -155,13 +154,11 @@ def process_task_template( case WorkflowUses.validate.value: task_executable_lst.append((task_validation, _task_params)) - task_executable_keys = run_tasks(task_executable_lst, str(uuid4())) for tx_key in task_executable_keys: seq_id, _ = tx_key.split(".", 1) formatter(f"\nTask: {document.tasks[int(seq_id)].name}") - _task_res: ExecResponse = Utils.get_task(tx_key).result __doc_version: str = data_get(_task_res.file_ctx.document, "version", "") if __doc_version.startswith("default:http"): From 922bd5949418be868f51a47566e732c109c60d26 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 5 Sep 2024 14:38:19 +0600 Subject: [PATCH 12/70] feat: pass variable from wf to validation --- .../get-req-vars/coinstats-usd-validate.chk | 21 +++++++++++-------- .../get-req-vars/coinstats-usd-workflow.chk | 18 +++++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk index 6b4f6729..db55b61e 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-validate.chk @@ -1,19 +1,22 @@ --- version: default:validation:0.7.2 +variables: + vdata: ~ + asserts: - - { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`' } - - { type: Map, actual: <% _data.headers %>, msg_pass: 'Header is a list', msg_fail: 'Header is not a list' } - - { type: Str, actual: <% _data.code %>, msg_pass: 'Code `{type_actual}({value_actual})` is a string', msg_fail: 'Code `{type_actual}({value_actual})` is not a string', cast_actual_to: int } - - { type: StrHave, actual: <% _data.info %>, other: "200 OK" } - - { type: Map, actual: <% _data.body %> } - - { type: List, actual: <% _data.body.explorers %> } - - { type: Float, actual: <% _data.body.price %> } - - { type: MapHasKeys, actual: <% _data.body %>, expected: [ "price", "priceBtc", "priceChange1d", "priceChange1h", "priceChange1w" ] } + - { type: Equal, actual: <% vdata.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`', cast_actual_to: int } + - { type: Map, actual: <% vdata.headers %>, msg_pass: 'Header is a list', msg_fail: 'Header is not a list' } + - { type: Str, actual: <% vdata.code %>, msg_pass: 'Code `{type_actual}({value_actual})` is a string', msg_fail: 'Code `{type_actual}({value_actual})` is not a string', cast_actual_to: int } + - { type: StrHave, actual: <% vdata.info %>, other: "200 OK" } + - { type: Map, actual: <% vdata.body %> } + - { type: List, actual: <% vdata.body.explorers %> } + - { type: Float, actual: <% vdata.body.price %> } + - { type: MapHasKeys, actual: <% vdata.body %>, expected: [ "price", "priceBtc", "priceChange1d", "priceChange1h", "priceChange1w" ] } expose: - <% _asserts_response %> - - <% _data %> + - <% vdata %> # --- shell command --- # pipenv run python -m chk validate -nf tests/resources/storage/spec_docs/validate/btc-usd-validate.chk -D "$(pipenv run python -m chk fetch -nf tests/resources/storage/spec_docs/fetch/bitcoin-usd.chk)" diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk index aa05df78..ca44fb47 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk @@ -1,17 +1,21 @@ version: default:workflow:0.8.0 name: simple Btc workflow -id: simple Btc workflow 1 +id: BtcWF1 + +variables: + group: coinstats + currency: GBP tasks: - name: Fetch some content from URL uses: fetch - file: ./coinstats-usd-request.chk -# variables: { "var": 2 } + file: "./<% group %>-usd-request.chk" + variables: + convertCurrency: <% currency %> - name: Validate the content is okay uses: validate - file: ./coinstats-usd-validate.chk -# variables: { "var": 2 } -# arguments: -# data: <% _tasks.0._expose.0 %> + file: "./<% group %>-usd-validate.chk" + variables: + vdata: <% _steps.0._response %> From 63d82484f91a377abc2cc860fe8760072c1b8d8d Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 6 Sep 2024 12:18:19 +0600 Subject: [PATCH 13/70] refactor: formatting fix --- chk/infrastructure/symbol_table.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index 2c66b7f8..5915a994 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -1,6 +1,7 @@ """ Symbol and variable management """ + import enum import os import typing @@ -77,13 +78,11 @@ class ExecResponse(BaseModel): @typing.overload -def replace_value(doc: dict, var_s: dict) -> dict: - ... +def replace_value(doc: dict, var_s: dict) -> dict: ... @typing.overload -def replace_value(doc: list, var_s: dict) -> list: - ... +def replace_value(doc: list, var_s: dict) -> list: ... def replace_value(doc: dict | list, var_s: dict) -> dict | list: From a011ac6a5b65d626fea233edaca07052fb197976 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 6 Sep 2024 12:18:44 +0600 Subject: [PATCH 14/70] feat: expose data added for wf spec --- .../workflow_cases/get-req-vars/coinstats-usd-workflow.chk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk index ca44fb47..4ce74078 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk @@ -19,3 +19,6 @@ tasks: file: "./<% group %>-usd-validate.chk" variables: vdata: <% _steps.0._response %> + +expose: + - <% _steps.0 %> From de5591d754b7b7ac42328c74a82cb753ebad8ba2 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 6 Sep 2024 12:19:12 +0600 Subject: [PATCH 15/70] feat: chkware task validation --- chk/modules/workflow/services.py | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 chk/modules/workflow/services.py diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py new file mode 100644 index 00000000..554b0662 --- /dev/null +++ b/chk/modules/workflow/services.py @@ -0,0 +1,33 @@ +""" +Workflow services module +""" + +from chk.modules.workflow import ChkwareTask, WorkflowUses, ChkwareValidateTask + + +class ChkwareTaskSupport: + """ChkwareTaskSupport""" + + @classmethod + def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: + """validate task data""" + + if "base_file_path" not in kwargs: + raise ValueError("`base_file_path` not passed.") + + if "uses" not in task_d_: + raise RuntimeError("Malformed task item found.") + + if task_d_["uses"] not in ( + WorkflowUses.fetch.value, + WorkflowUses.validate.value, + ): + raise RuntimeError("task.uses unsupported.") + + base_file_path = str(kwargs["base_file_path"]) + + return ( + ChkwareTask(base_file_path, **task_d_) + if task_d_["uses"] == "fetch" + else ChkwareValidateTask(base_file_path, **task_d_) + ) From fae11ba133b3064a876930221e30ca8dba2e3d4d Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 6 Sep 2024 12:22:43 +0600 Subject: [PATCH 16/70] feat: enum and task params entity --- chk/modules/workflow/entities.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index 19b0bc24..08c4ae5e 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -5,9 +5,29 @@ from __future__ import annotations import enum +from typing import NamedTuple + from pydantic import BaseModel, Field, ConfigDict -from chk.infrastructure.file_loader import generate_abs_path +from chk.infrastructure.file_loader import generate_abs_path, ExecuteContext + + +class WorkflowConfigNode(enum.StrEnum): + """WorkflowConfigNode""" + + NODE = "_steps" + + +class TaskExecParam(NamedTuple): + """TaskExecParams""" + + task: ChkwareTask + exec_ctx: ExecuteContext + + def asdict(self) -> dict: + """Convert to dict""" + + return {"task": self.task.model_dump(), "execution_context": self.exec_ctx} class WorkflowUses(enum.StrEnum): From 7a52ad69700156fe6b6dc501bb7206519131ec3c Mon Sep 17 00:00:00 2001 From: HSN Date: Sat, 7 Sep 2024 17:02:52 +0600 Subject: [PATCH 17/70] feat: support for VersionedDocumentV2 on ExposeManager --- chk/infrastructure/symbol_table.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index 5915a994..c7e3e8a2 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -238,7 +238,9 @@ def replace_values( return replace_callback(expose_doc, values) @staticmethod - def get_exposed_replaced_data(document: VersionedDocument, store: dict) -> list: + def get_exposed_replaced_data( + document: VersionedDocument | VersionedDocumentV2, store: dict + ) -> list: """Get expose doc from a `VersionedDocument`, and prepare it from the value of `Variables`, and `store`, and return From d04a072a4c5d492abdb9728eab4e182115776704 Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 8 Sep 2024 11:47:01 +0600 Subject: [PATCH 18/70] refactor: remove ExposableVariables, use Variables instead --- chk/infrastructure/symbol_table.py | 4 ---- chk/modules/fetch.py | 3 +-- chk/modules/validate/__init__.py | 3 +-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index c7e3e8a2..fd10b9e5 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -61,10 +61,6 @@ class Variables(UserDict): """Holds data for a variable""" -class ExposableVariables(UserDict): - """Holds data for a expose data""" - - class ExecResponse(BaseModel): """ExecResponse""" diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 9450fb2f..d11aa8bd 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -27,7 +27,6 @@ VARIABLE_SCHEMA as VAR_SCHEMA, EXPOSE_SCHEMA as EXP_SCHEMA, ExposeManager, - ExposableVariables, ExecResponse, ) @@ -544,7 +543,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: HttpDocumentSupport.process_request_template(http_doc, variable_doc) response = HttpDocumentSupport.execute_request(http_doc) - output_data = ExposableVariables({"_response": response.data}) + output_data = Variables({"_response": response.data}) return ExecResponse( file_ctx=file_ctx, diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index f0670c59..16a31780 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -22,7 +22,6 @@ VariableTableManager, replace_value, ExposeManager, - ExposableVariables, ExecResponse, ) from chk.modules.validate.assertion_services import ( @@ -268,7 +267,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: ) test_run_result = AssertionEntryListRunner.test_run(assert_list, variable_doc.data) - output_data = ExposableVariables( + output_data = Variables( { "_asserts_response": test_run_result.as_dict, "_data": variable_doc["_data"], From 8aea013c3e67857677c03d7030a9521bcc1797ff Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 8 Sep 2024 11:48:28 +0600 Subject: [PATCH 19/70] feat: add extra data by category in ExecResponse --- chk/infrastructure/symbol_table.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index fd10b9e5..403b6dd5 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -68,9 +68,11 @@ class ExecResponse(BaseModel): file_ctx: FileContext exec_ctx: ExecuteContext - variables_exec: ExposableVariables variables: Variables + variables_exec: Variables + variables_disp: Variables = Field(default_factory=Variables) extra: object = Field(default=None) + exception: Exception | None = Field(default=None) @typing.overload From 508905e45ce063476cf5634e1e76f3c5427b5c39 Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 8 Sep 2024 13:35:47 +0600 Subject: [PATCH 20/70] feat: new doc version and str dunder added --- chk/infrastructure/version.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chk/infrastructure/version.py b/chk/infrastructure/version.py index 449ad70f..c8d52f03 100644 --- a/chk/infrastructure/version.py +++ b/chk/infrastructure/version.py @@ -14,12 +14,18 @@ VERSION_STORE = { "http": [ "0.7.2", + "0.8.0", ], "testcase": [ "0.7.2", + "0.8.0", ], "validation": [ "0.7.2", + "0.8.0", + ], + "workflow": [ + "0.8.0", ], } @@ -108,6 +114,11 @@ def verify_doc_type_ver(self) -> bool: return True + def __str__(self) -> str: + """str dunder""" + + return self.original_version_str + class DocumentVersionMaker: """Create document version object""" From a6b3ec6a2c1e2135f2bc1633762db9f4e97d9671 Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 8 Sep 2024 15:46:04 +0600 Subject: [PATCH 21/70] feat: return all steps --- .../workflow_cases/get-req-vars/coinstats-usd-workflow.chk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk index 4ce74078..1ec10f85 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk @@ -21,4 +21,4 @@ tasks: vdata: <% _steps.0._response %> expose: - - <% _steps.0 %> + - <% _steps %> From f10a84eebec309c5a341617531ec35afb5cd6501 Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 8 Sep 2024 15:46:38 +0600 Subject: [PATCH 22/70] feat: workflow run happy path success --- chk/modules/workflow/__init__.py | 171 +++++++++++++++++-------------- 1 file changed, 96 insertions(+), 75 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 77f99b10..78ef57c6 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -5,30 +5,39 @@ from __future__ import annotations from collections import abc import pathlib +from collections.abc import Callable from uuid import uuid4 from pydantic import Field, ConfigDict from icecream import ic -from chk.infrastructure.document import VersionedDocumentV2 as VersionedDocument +from chk.infrastructure.document import ( + VersionedDocumentV2 as VersionedDocument, + VersionedDocumentSupport, +) +from chk.infrastructure.version import DocumentVersionMaker from chk.modules.fetch import task_fetch from chk.modules.validate import task_validation from chk.modules.workflow.entities import ( ChkwareTask, ChkwareValidateTask, WorkflowUses, + TaskExecParam, + WorkflowConfigNode, ) from chk.infrastructure.file_loader import ( FileContext, ExecuteContext, - generate_abs_path, ) from chk.infrastructure.helper import data_get, formatter, slugify from chk.infrastructure.symbol_table import ( Variables, VariableTableManager, ExecResponse, + replace_value, + ExposeManager, ) +from chk.modules.workflow.services import ChkwareTaskSupport VERSION_SCOPE = ["workflow"] @@ -40,16 +49,15 @@ class WorkflowDocument(VersionedDocument): name: str = Field(default_factory=str) id: str = Field(default_factory=str) - tasks: list[ChkwareTask | ChkwareValidateTask] + tasks: list[dict] = Field(default="") @staticmethod def from_file_context(ctx: FileContext) -> WorkflowDocument: """Create a WorkflowDocument from FileContext""" - # @TODO this should to VersionDoc # version - if not (version_str := data_get(ctx.document, "version")): - raise RuntimeError("`version:` not found.") + doc_ver = DocumentVersionMaker.from_dict(ctx.document) + DocumentVersionMaker.verify_if_allowed(doc_ver, VERSION_SCOPE) # id, name # @TODO Name and ID processing should have separate func @@ -79,10 +87,10 @@ def from_file_context(ctx: FileContext) -> WorkflowDocument: # @TODO implement __repr__ for WorkflowDocument return WorkflowDocument( context=tuple(ctx), - version=version_str, + version=str(doc_ver), name=name_str, id=id_str, - tasks=tasks, + tasks=tasks_lst, ) @@ -99,43 +107,31 @@ def _prepare_validate_task_argument_data_(cls, task: ChkwareTask) -> dict: return {} @classmethod - def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: - """validate task data""" - if "base_file_path" not in kwargs: - raise ValueError("`base_file_path` not passed.") - - if "uses" not in task_d_: - raise RuntimeError("Malformed task item found.") - - if task_d_["uses"] not in ( - WorkflowUses.fetch.value, - WorkflowUses.validate.value, - ): - raise RuntimeError("task.uses unsupported.") - - base_file_path = str(kwargs["base_file_path"]) - - return ( - ChkwareTask(base_file_path, **task_d_) - if task_d_["uses"] == "fetch" - else ChkwareValidateTask(base_file_path, **task_d_) - ) + def set_step_template(cls, variables: Variables) -> None: + """sets data or template""" - @classmethod - def exectute_tasks(cls, task_list: list[ChkwareTask]): ... + # @TODO implement data set functionality with validation for variables + variables[WorkflowConfigNode.NODE.value] = [] @classmethod def process_task_template( cls, document: WorkflowDocument, variables: Variables ) -> None: + """Process task block of document""" + formatter(f"\n\nExecuting: {document.name}") formatter("-" * 5) - task_executable_lst = [] + base_fpath: str = FileContext(*document.context).filepath for task in document.tasks: - # @TODO should be done in ChkwareTask calls - _task_d = task.model_dump() + if not isinstance(task, dict): + raise RuntimeError("`tasks.*.item` should be map.") + + # replace values in tasks + task_d_: dict = replace_value(task, variables.data) + # ic(task_d_) + task_o_ = ChkwareTaskSupport.make_task(task_d_, base_file_path=base_fpath) execution_ctx = ExecuteContext( {"dump": True, "format": True}, @@ -147,69 +143,86 @@ def process_task_template( }, ) - _task_params = {"task": _task_d, "execution_context": execution_ctx} - match _task_d["uses"]: + match task_o_.uses: case WorkflowUses.fetch.value: - task_executable_lst.append((task_fetch, _task_params)) + cls.execute_tasks( + task_fetch, + TaskExecParam(task=task_o_, exec_ctx=execution_ctx), + variables, + ) case WorkflowUses.validate.value: - task_executable_lst.append((task_validation, _task_params)) - - - for tx_key in task_executable_keys: - seq_id, _ = tx_key.split(".", 1) - formatter(f"\nTask: {document.tasks[int(seq_id)].name}") - - __doc_version: str = data_get(_task_res.file_ctx.document, "version", "") - - if __doc_version.startswith("default:http"): - formatter( - "-> %s %s" - % ( - data_get(_task_res.file_ctx.document, "request.method"), - data_get(_task_res.file_ctx.document, "request.url"), + cls.execute_tasks( + task_validation, + TaskExecParam(task=task_o_, exec_ctx=execution_ctx), + variables, ) + + @classmethod + def execute_tasks( + cls, task_fn: Callable, task_params: TaskExecParam, variables: Variables + ) -> ExecResponse: + """execute_tasks""" + + formatter(f"\nTask: {task_params.task.name}") + + _task_res: ExecResponse = task_fn(**task_params.asdict()) + variables[WorkflowConfigNode.NODE.value].append(_task_res.variables_exec.data) + + # TODO move the display logic to service + # @SECTION display + __doc_version: str = data_get(_task_res.file_ctx.document, "version", "") + + if __doc_version.startswith("default:http"): + formatter( + "-> %s %s" + % ( + data_get(_task_res.file_ctx.document, "request.method"), + data_get(_task_res.file_ctx.document, "request.url"), ) - elif __doc_version.startswith("default:validation"): - formatter( - "-> Total tests: %s, Failed: %s" - % ( - data_get( - _task_res.variables_exec.data, "_asserts_response.count_all" - ), - data_get( - _task_res.variables_exec.data, - "_asserts_response.count_fail", - ), - ) + ) + elif __doc_version.startswith("default:validation"): + formatter( + "-> Total tests: %s, Failed: %s" + % ( + data_get( + _task_res.variables_exec.data, + "_asserts_response.count_all", + ), + data_get( + _task_res.variables_exec.data, + "_asserts_response.count_fail", + ), ) + ) + # @SECTION display end + + return _task_res + + @classmethod + def display(cls, exposed_data: list, exec_ctx: ExecuteContext) -> None: ... def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: """Call a workflow document""" wflow_doc = WorkflowDocument.from_file_context(file_ctx) - ic(wflow_doc) variable_doc = Variables() VariableTableManager.handle(variable_doc, wflow_doc, exec_ctx) service = WorkflowDocumentSupport() + # @TODO make sure the document do not call self making it repeating + service.set_step_template(variable_doc) service.process_task_template(wflow_doc, variable_doc) - # DocumentVersionMaker.verify_if_allowed( - # DocumentVersionMaker.from_dict(wflow_doc.as_dict), VERSION_SCOPE - # ) - - # VersionedDocumentSupport.validate_with_schema( - # HttpDocumentSupport.build_schema(), http_doc - # ) + output_data = Variables({"_steps": variable_doc[WorkflowConfigNode.NODE.value]}) + # TODO also send failed_details (fail code, message, stacktrace, etc) return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, - variables_exec=ExposableVariables({}), + variables_exec=output_data, variables=variable_doc, - extra={}, ) @@ -224,4 +237,12 @@ def execute( cb: Callable """ - _ = call(file_ctx=ctx, exec_ctx=exec_ctx) + exr = call(file_ctx=ctx, exec_ctx=exec_ctx) + + wf_doc = WorkflowDocument.from_file_context(ctx) + exposed_data = ExposeManager.get_exposed_replaced_data( + wf_doc, {**dict(exr.variables), **dict(exr.variables_exec)} + ) + + cb({ctx.filepath_hash: exr.variables_exec.data}) + WorkflowDocumentSupport.display(exposed_data, exec_ctx) From 13f34ae84048a54fb166cd2d02dbcc693cb4747f Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 17 Sep 2024 13:40:28 +0600 Subject: [PATCH 23/70] refactor: reorder import --- chk/modules/workflow/__init__.py | 33 ++++++++++++++------------------ chk/modules/workflow/entities.py | 4 ++-- chk/modules/workflow/services.py | 4 +++- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 78ef57c6..fdac858d 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -3,17 +3,24 @@ """ from __future__ import annotations -from collections import abc + import pathlib +from collections import abc from collections.abc import Callable -from uuid import uuid4 -from pydantic import Field, ConfigDict -from icecream import ic +from pydantic import ConfigDict, Field from chk.infrastructure.document import ( VersionedDocumentV2 as VersionedDocument, - VersionedDocumentSupport, +) +from chk.infrastructure.file_loader import ExecuteContext, FileContext +from chk.infrastructure.helper import data_get, slugify +from chk.infrastructure.symbol_table import ( + ExecResponse, + ExposeManager, + VariableTableManager, + Variables, + replace_value, ) from chk.infrastructure.version import DocumentVersionMaker from chk.modules.fetch import task_fetch @@ -21,23 +28,11 @@ from chk.modules.workflow.entities import ( ChkwareTask, ChkwareValidateTask, - WorkflowUses, TaskExecParam, WorkflowConfigNode, + WorkflowUses, ) -from chk.infrastructure.file_loader import ( - FileContext, - ExecuteContext, -) -from chk.infrastructure.helper import data_get, formatter, slugify -from chk.infrastructure.symbol_table import ( - Variables, - VariableTableManager, - ExecResponse, - replace_value, - ExposeManager, -) -from chk.modules.workflow.services import ChkwareTaskSupport +from chk.modules.workflow.services import ChkwareTaskSupport, WorkflowPresenter VERSION_SCOPE = ["workflow"] diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index 08c4ae5e..268c05c0 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -7,9 +7,9 @@ import enum from typing import NamedTuple -from pydantic import BaseModel, Field, ConfigDict +from pydantic import BaseModel, ConfigDict, Field -from chk.infrastructure.file_loader import generate_abs_path, ExecuteContext +from chk.infrastructure.file_loader import ExecuteContext, generate_abs_path class WorkflowConfigNode(enum.StrEnum): diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 554b0662..18ee6e6b 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -2,7 +2,9 @@ Workflow services module """ -from chk.modules.workflow import ChkwareTask, WorkflowUses, ChkwareValidateTask +from chk.infrastructure.helper import formatter +from chk.infrastructure.symbol_table import Variables +from chk.modules.workflow import ChkwareTask, ChkwareValidateTask, WorkflowUses class ChkwareTaskSupport: From d69a0f83748706495d01d0c952028c573cc0c123 Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 17 Sep 2024 13:41:30 +0600 Subject: [PATCH 24/70] feat: move presentation to separate display class --- chk/modules/workflow/__init__.py | 37 +++++------------------------ chk/modules/workflow/services.py | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 31 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index fdac858d..fcf8ecee 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -158,43 +158,18 @@ def execute_tasks( ) -> ExecResponse: """execute_tasks""" - formatter(f"\nTask: {task_params.task.name}") - _task_res: ExecResponse = task_fn(**task_params.asdict()) variables[WorkflowConfigNode.NODE.value].append(_task_res.variables_exec.data) - # TODO move the display logic to service - # @SECTION display - __doc_version: str = data_get(_task_res.file_ctx.document, "version", "") - - if __doc_version.startswith("default:http"): - formatter( - "-> %s %s" - % ( - data_get(_task_res.file_ctx.document, "request.method"), - data_get(_task_res.file_ctx.document, "request.url"), - ) - ) - elif __doc_version.startswith("default:validation"): - formatter( - "-> Total tests: %s, Failed: %s" - % ( - data_get( - _task_res.variables_exec.data, - "_asserts_response.count_all", - ), - data_get( - _task_res.variables_exec.data, - "_asserts_response.count_fail", - ), - ) - ) - # @SECTION display end - return _task_res @classmethod - def display(cls, exposed_data: list, exec_ctx: ExecuteContext) -> None: ... + def display(cls, ex_resp: ExecResponse, exec_ctx: ExecuteContext) -> None: + wfp = WorkflowPresenter(ex_resp.variables_exec) + if exec_ctx.options["format"]: + wfp.print() + else: + wfp.printjson() def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 18ee6e6b..958ce093 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -33,3 +33,43 @@ def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: if task_d_["uses"] == "fetch" else ChkwareValidateTask(base_file_path, **task_d_) ) + + +class WorkflowPresenter: + """WorkflowPresenter""" + + __slots__ = ("data",) + + def __init__(self, var: Variables): + """Construct""" + + self.data: Variables = var + + def print(self) -> None: + """print to screen""" + + if "document" in self.data and "name" in self.data["document"]: + formatter(f"\n\nWorkflow: {self.data['document']['name']}") + formatter( + f"Steps total: {self.data['document']['step_count']}, " + f"failed: {self.data['document']['step_failed']}" + ) + formatter("-" * 5) + + exposed_data: list[dict] = [] + + if "steps" in self.data: + exposed_data = self.data["steps"] + + for one_exposed_data in exposed_data: + formatter(f"\nTask: {one_exposed_data['name']}") + if one_exposed_data["uses"] == "fetch": + formatter( + f"-> {one_exposed_data['request_method']} {one_exposed_data['request_url']}" + ) + elif one_exposed_data["uses"] == "validate": + formatter( + f"-> Total tests: {one_exposed_data['asserts_count_all']}, Failed: {one_exposed_data['asserts_count_fail']}" + ) + + def printjson(self) -> None: ... From 2f6110a82ba875191b58219c9821872ade9abaca Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 17 Sep 2024 14:11:52 +0600 Subject: [PATCH 25/70] feat: add step exposed data to response --- chk/infrastructure/symbol_table.py | 2 +- chk/modules/workflow/__init__.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index 403b6dd5..07302266 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -70,9 +70,9 @@ class ExecResponse(BaseModel): exec_ctx: ExecuteContext variables: Variables variables_exec: Variables - variables_disp: Variables = Field(default_factory=Variables) extra: object = Field(default=None) exception: Exception | None = Field(default=None) + exposed: list[typing.Any] = Field(default_factory=list) @typing.overload diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index fcf8ecee..3db4e092 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -183,16 +183,22 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: service = WorkflowDocumentSupport() # @TODO make sure the document do not call self making it repeating service.set_step_template(variable_doc) - service.process_task_template(wflow_doc, variable_doc) + exec_responses = service.process_task_template(wflow_doc, variable_doc) output_data = Variables({"_steps": variable_doc[WorkflowConfigNode.NODE.value]}) + exposed_data = ExposeManager.get_exposed_replaced_data( + wflow_doc, {**variable_doc.data, **output_data.data} + ) + # TODO also send failed_details (fail code, message, stacktrace, etc) return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, - variables_exec=output_data, variables=variable_doc, + variables_exec=output_data, + extra=exec_responses, + exposed=exposed_data, ) @@ -209,10 +215,5 @@ def execute( exr = call(file_ctx=ctx, exec_ctx=exec_ctx) - wf_doc = WorkflowDocument.from_file_context(ctx) - exposed_data = ExposeManager.get_exposed_replaced_data( - wf_doc, {**dict(exr.variables), **dict(exr.variables_exec)} - ) - cb({ctx.filepath_hash: exr.variables_exec.data}) - WorkflowDocumentSupport.display(exposed_data, exec_ctx) + WorkflowDocumentSupport.display(exr, exec_ctx) From 7bec938a9fa197937ea86358e75026aa3cae5278 Mon Sep 17 00:00:00 2001 From: HSN Date: Tue, 17 Sep 2024 14:12:33 +0600 Subject: [PATCH 26/70] feat: pass step response as list of exec response --- chk/modules/workflow/__init__.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 3db4e092..60612162 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -111,13 +111,11 @@ def set_step_template(cls, variables: Variables) -> None: @classmethod def process_task_template( cls, document: WorkflowDocument, variables: Variables - ) -> None: + ) -> list[ExecResponse]: """Process task block of document""" - formatter(f"\n\nExecuting: {document.name}") - formatter("-" * 5) - base_fpath: str = FileContext(*document.context).filepath + exec_responses: list[ExecResponse] = [] for task in document.tasks: if not isinstance(task, dict): @@ -125,7 +123,6 @@ def process_task_template( # replace values in tasks task_d_: dict = replace_value(task, variables.data) - # ic(task_d_) task_o_ = ChkwareTaskSupport.make_task(task_d_, base_file_path=base_fpath) execution_ctx = ExecuteContext( @@ -140,18 +137,24 @@ def process_task_template( match task_o_.uses: case WorkflowUses.fetch.value: - cls.execute_tasks( + _r = cls.execute_tasks( task_fetch, TaskExecParam(task=task_o_, exec_ctx=execution_ctx), variables, ) + + exec_responses.append(_r) case WorkflowUses.validate.value: - cls.execute_tasks( + _r = cls.execute_tasks( task_validation, TaskExecParam(task=task_o_, exec_ctx=execution_ctx), variables, ) + exec_responses.append(_r) + + return exec_responses + @classmethod def execute_tasks( cls, task_fn: Callable, task_params: TaskExecParam, variables: Variables From 6a2549fb0c1d86c223a6c88a21f5174d372bbda0 Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 18 Sep 2024 14:12:16 +0600 Subject: [PATCH 27/70] feat: impl presentation service --- chk/infrastructure/view.py | 24 ++++++++++++++++++++++++ chk/modules/workflow/services.py | 19 +++++++++---------- 2 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 chk/infrastructure/view.py diff --git a/chk/infrastructure/view.py b/chk/infrastructure/view.py new file mode 100644 index 00000000..d97e23d2 --- /dev/null +++ b/chk/infrastructure/view.py @@ -0,0 +1,24 @@ +"""View related utility mod""" + +import abc +import typing + +from pydantic import BaseModel + + +class PresentationBuilder(BaseModel, abc.ABC): + """Presentable signature""" + + data: typing.Any + + @abc.abstractmethod + def dump_fmt(self) -> None: + """Signature to dump formatted string""" + + raise NotImplementedError("Signature to dump formatted string") + + @abc.abstractmethod + def dump_json(self) -> str: + """Signature to dump json""" + + raise NotImplementedError("Signature to dump json") diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 958ce093..3e0c484a 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -2,8 +2,11 @@ Workflow services module """ +import typing + from chk.infrastructure.helper import formatter from chk.infrastructure.symbol_table import Variables +from chk.infrastructure.view import PresentationBuilder from chk.modules.workflow import ChkwareTask, ChkwareValidateTask, WorkflowUses @@ -35,17 +38,10 @@ def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: ) -class WorkflowPresenter: +class WorkflowPresenter(PresentationBuilder): """WorkflowPresenter""" - __slots__ = ("data",) - - def __init__(self, var: Variables): - """Construct""" - - self.data: Variables = var - - def print(self) -> None: + def dump_fmt(self) -> None: """print to screen""" if "document" in self.data and "name" in self.data["document"]: @@ -72,4 +68,7 @@ def print(self) -> None: f"-> Total tests: {one_exposed_data['asserts_count_all']}, Failed: {one_exposed_data['asserts_count_fail']}" ) - def printjson(self) -> None: ... + def dump_json(self) -> str: + """print json""" + + pass From 5e501eb130f294f153c0546d8835f848abe925c4 Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 18 Sep 2024 14:12:50 +0600 Subject: [PATCH 28/70] refactor: normalize code --- chk/modules/workflow/__init__.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 60612162..f6b27b62 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -135,23 +135,17 @@ def process_task_template( }, ) + task_fn = None + match task_o_.uses: case WorkflowUses.fetch.value: - _r = cls.execute_tasks( - task_fetch, - TaskExecParam(task=task_o_, exec_ctx=execution_ctx), - variables, - ) - - exec_responses.append(_r) + task_fn = task_fetch case WorkflowUses.validate.value: - _r = cls.execute_tasks( - task_validation, - TaskExecParam(task=task_o_, exec_ctx=execution_ctx), - variables, - ) + task_fn = task_validation - exec_responses.append(_r) + if task_fn: + te_param = TaskExecParam(task=task_o_, exec_ctx=execution_ctx) + exec_responses.append(cls.execute_tasks(task_fn, te_param, variables)) return exec_responses From c748fb666273f03da0bd98021dac4acc696f4497 Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 18 Sep 2024 18:59:17 +0600 Subject: [PATCH 29/70] refactor: import reorder --- chk/modules/fetch.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index d11aa8bd..2bc6f751 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -3,37 +3,35 @@ """ from __future__ import annotations + import dataclasses import enum import json import pathlib - from collections import UserDict, abc from urllib.parse import unquote, urlparse +import xmltodict +from defusedxml.minidom import parseString from pydantic import BaseModel, Field from requests.auth import HTTPBasicAuth -from defusedxml.minidom import parseString -import xmltodict - from chk.infrastructure.document import VersionedDocument, VersionedDocumentSupport from chk.infrastructure.file_loader import ExecuteContext, FileContext from chk.infrastructure.helper import data_get, formatter from chk.infrastructure.symbol_table import ( + EXPOSE_SCHEMA as EXP_SCHEMA, + ExecResponse, + ExposeManager, + VARIABLE_SCHEMA as VAR_SCHEMA, VariableTableManager, Variables, replace_value, - VARIABLE_SCHEMA as VAR_SCHEMA, - EXPOSE_SCHEMA as EXP_SCHEMA, - ExposeManager, - ExecResponse, ) - from chk.infrastructure.third_party.http_fetcher import ( ApiResponse, - fetch, BearerAuthentication, + fetch, ) from chk.infrastructure.version import DocumentVersionMaker, SCHEMA as VER_SCHEMA From fadb0ef0a24571cdc6711562d8c3fea5a171fba7 Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 18 Sep 2024 19:00:04 +0600 Subject: [PATCH 30/70] feat: sent fetch expection in exec response --- chk/modules/fetch.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 2bc6f751..3156397b 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -526,6 +526,8 @@ def display(expose_list: list, exec_ctx: ExecuteContext) -> None: def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: """Call a http document""" + r_exception: Exception | None = None + http_doc = HttpDocument.from_file_context(file_ctx) DocumentVersionMaker.verify_if_allowed( @@ -540,7 +542,13 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: VariableTableManager.handle(variable_doc, http_doc, exec_ctx) HttpDocumentSupport.process_request_template(http_doc, variable_doc) - response = HttpDocumentSupport.execute_request(http_doc) + response = ApiResponse() + + try: + response = HttpDocumentSupport.execute_request(http_doc) + except Exception as ex: + r_exception = ex + output_data = Variables({"_response": response.data}) return ExecResponse( @@ -548,6 +556,8 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: exec_ctx=exec_ctx, variables_exec=output_data, variables=variable_doc, + exception=r_exception, + report={"is_success": r_exception is None}, ) From b186de004af581804e8cd0b93a083c5c4db19f44 Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 18 Sep 2024 19:00:45 +0600 Subject: [PATCH 31/70] feat: add exposed data to exec response --- chk/infrastructure/symbol_table.py | 1 + chk/modules/fetch.py | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index 07302266..8c869203 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -73,6 +73,7 @@ class ExecResponse(BaseModel): extra: object = Field(default=None) exception: Exception | None = Field(default=None) exposed: list[typing.Any] = Field(default_factory=list) + report: dict = Field(default_factory=dict) @typing.overload diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 3156397b..ad5fcf31 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -551,12 +551,18 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: output_data = Variables({"_response": response.data}) + exposed_data = ExposeManager.get_exposed_replaced_data( + http_doc, + {**variable_doc.data, **output_data.data}, + ) + return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, variables_exec=output_data, variables=variable_doc, exception=r_exception, + exposed=exposed_data, report={"is_success": r_exception is None}, ) @@ -572,16 +578,12 @@ def execute( cb: Callable """ - exec_response = call(file_ctx=ctx, exec_ctx=exec_ctx) - - http_doc = HttpDocument.from_file_context(exec_response.file_ctx) - exposed_data = ExposeManager.get_exposed_replaced_data( - http_doc, - {**exec_response.variables.data, **exec_response.variables_exec.data}, - ) + exr = call(file_ctx=ctx, exec_ctx=exec_ctx) + if exr.exception is not None: + raise exr.exception - cb({ctx.filepath_hash: exec_response.variables_exec.data}) - HttpDocumentSupport.display(exposed_data, exec_ctx) + cb({ctx.filepath_hash: exr.variables_exec.data}) + HttpDocumentSupport.display(exr.exposed, exec_ctx) def task_fetch(**kwargs: dict) -> ExecResponse: From 8435eac97c3e1b8985345c82563597f93229efb5 Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 18 Sep 2024 19:05:16 +0600 Subject: [PATCH 32/70] feat: add exposed data to exec response --- chk/modules/validate/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 16a31780..6e5db765 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -274,12 +274,21 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: } ) + exposed_data = ExposeManager.get_exposed_replaced_data( + validate_doc, + { + **validate_doc.data, + **{"_asserts_response": test_run_result}, + }, + ) + return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, variables_exec=output_data, variables=variable_doc, extra=test_run_result, + exposed=exposed_data, ) @@ -296,17 +305,8 @@ def execute( exec_response = call(file_ctx=ctx, exec_ctx=exec_ctx) - validate_doc = ValidationDocument.from_file_context(ctx) - exposed_data = ExposeManager.get_exposed_replaced_data( - validate_doc, - { - **exec_response.variables.data, - **{"_asserts_response": exec_response.extra}, - }, - ) - cb({ctx.filepath_hash: exec_response.variables_exec.data}) - ValidationDocumentSupport.display(exposed_data, exec_ctx) + ValidationDocumentSupport.display(exec_response.exposed, exec_ctx) def task_validation(**kwargs: dict) -> ExecResponse: From 39aaae554f535b0d4f1054c68e06843160e9c9b1 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 19 Sep 2024 22:17:44 +0600 Subject: [PATCH 33/70] fix: dumping response for validate --- chk/modules/validate/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 6e5db765..a1ebcd7e 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -278,7 +278,10 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: validate_doc, { **validate_doc.data, - **{"_asserts_response": test_run_result}, + **{ + "_asserts_response": test_run_result, + "_data": variable_doc["_data"], + }, }, ) From 459a8bf3e1fecb4be52f266d4e11ba5c0fbef66f Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 19 Sep 2024 22:33:50 +0600 Subject: [PATCH 34/70] feat: add report to validate exec response --- chk/modules/validate/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index a1ebcd7e..7e94efb1 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -292,6 +292,11 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: variables=variable_doc, extra=test_run_result, exposed=exposed_data, + report={ + "is_success": test_run_result["count_fail"] == 0, + "count_all": test_run_result["count_all"], + "count_fail": test_run_result["count_fail"], + }, ) From 645dc854b9d239a72a3cdb20f89ec88c8b68bb77 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 19 Sep 2024 23:04:29 +0600 Subject: [PATCH 35/70] feat: save step results --- chk/modules/workflow/__init__.py | 12 +++++++++--- chk/modules/workflow/entities.py | 9 +++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index f6b27b62..ed01640f 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -28,6 +28,7 @@ from chk.modules.workflow.entities import ( ChkwareTask, ChkwareValidateTask, + StepResult, TaskExecParam, WorkflowConfigNode, WorkflowUses, @@ -116,6 +117,7 @@ def process_task_template( base_fpath: str = FileContext(*document.context).filepath exec_responses: list[ExecResponse] = [] + exec_report: list[StepResult] = [] for task in document.tasks: if not isinstance(task, dict): @@ -145,15 +147,19 @@ def process_task_template( if task_fn: te_param = TaskExecParam(task=task_o_, exec_ctx=execution_ctx) - exec_responses.append(cls.execute_tasks(task_fn, te_param, variables)) + task_resp: ExecResponse = cls.execute_task(task_fn, te_param, variables) + exec_report.append( + StepResult(name=task_o_.name, uses=task_o_.uses, **task_resp.report) + ) + exec_responses.append(task_resp) return exec_responses @classmethod - def execute_tasks( + def execute_task( cls, task_fn: Callable, task_params: TaskExecParam, variables: Variables ) -> ExecResponse: - """execute_tasks""" + """execute_task""" _task_res: ExecResponse = task_fn(**task_params.asdict()) variables[WorkflowConfigNode.NODE.value].append(_task_res.variables_exec.data) diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index 268c05c0..57b6addc 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -78,3 +78,12 @@ def __init__(self, basepath: str, /, **kwargs: dict) -> None: """Constructor""" super().__init__(basepath, **kwargs) + + +class StepResult(BaseModel): + """StepResult""" + + name: str + uses: str + is_success: bool + others: dict = Field(default_factory=dict) From ea56e939b719581c391e13c17f4223683e1447f3 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 20 Sep 2024 12:22:35 +0600 Subject: [PATCH 36/70] feat: pass presentation items --- chk/modules/fetch.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index ad5fcf31..8a343181 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -556,6 +556,10 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: {**variable_doc.data, **output_data.data}, ) + # TODO: instead if sending specific report items, and making presentable in other + # module, we should prepare and long and short form of presentable that can be + # loaded via other module + return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, @@ -563,7 +567,11 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: variables=variable_doc, exception=r_exception, exposed=exposed_data, - report={"is_success": r_exception is None}, + report={ + "is_success": r_exception is None, + "request_method": file_ctx.document["request"]['method'], + "request_url": file_ctx.document["request"]['url'], + }, ) From 0c53a4dd355e008a6cc84a5e316416583b33d4e7 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 20 Sep 2024 12:53:15 +0600 Subject: [PATCH 37/70] feat: dump str final --- chk/modules/workflow/__init__.py | 35 ++++++++---- chk/modules/workflow/services.py | 97 +++++++++++++++++++++++--------- 2 files changed, 96 insertions(+), 36 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index ed01640f..ae973c53 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -23,6 +23,7 @@ replace_value, ) from chk.infrastructure.version import DocumentVersionMaker +from chk.infrastructure.view import PresentationBuilder from chk.modules.fetch import task_fetch from chk.modules.validate import task_validation from chk.modules.workflow.entities import ( @@ -112,7 +113,7 @@ def set_step_template(cls, variables: Variables) -> None: @classmethod def process_task_template( cls, document: WorkflowDocument, variables: Variables - ) -> list[ExecResponse]: + ) -> tuple[list[ExecResponse], list[StepResult]]: """Process task block of document""" base_fpath: str = FileContext(*document.context).filepath @@ -148,12 +149,18 @@ def process_task_template( if task_fn: te_param = TaskExecParam(task=task_o_, exec_ctx=execution_ctx) task_resp: ExecResponse = cls.execute_task(task_fn, te_param, variables) + exec_report.append( - StepResult(name=task_o_.name, uses=task_o_.uses, **task_resp.report) + StepResult( + name=task_o_.name, + uses=task_o_.uses, + is_success=task_resp.report.pop("is_success"), + others=task_resp.report, + ) ) exec_responses.append(task_resp) - return exec_responses + return exec_responses, exec_report @classmethod def execute_task( @@ -166,13 +173,21 @@ def execute_task( return _task_res + # @classmethod + # def prepare_step_results(cls, ) -> dict: + @classmethod - def display(cls, ex_resp: ExecResponse, exec_ctx: ExecuteContext) -> None: - wfp = WorkflowPresenter(ex_resp.variables_exec) + def display( + cls, + ex_resp: ExecResponse, + exec_ctx: ExecuteContext, + presenter: type[PresentationBuilder], + ) -> None: + wfp = presenter(data=ex_resp) if exec_ctx.options["format"]: - wfp.print() + wfp.dump_fmt() else: - wfp.printjson() + wfp.dump_json() def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: @@ -186,7 +201,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: service = WorkflowDocumentSupport() # @TODO make sure the document do not call self making it repeating service.set_step_template(variable_doc) - exec_responses = service.process_task_template(wflow_doc, variable_doc) + exec_responses, exec_report = service.process_task_template(wflow_doc, variable_doc) output_data = Variables({"_steps": variable_doc[WorkflowConfigNode.NODE.value]}) @@ -200,7 +215,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: exec_ctx=exec_ctx, variables=variable_doc, variables_exec=output_data, - extra=exec_responses, + extra=(exec_responses, exec_report), exposed=exposed_data, ) @@ -219,4 +234,4 @@ def execute( exr = call(file_ctx=ctx, exec_ctx=exec_ctx) cb({ctx.filepath_hash: exr.variables_exec.data}) - WorkflowDocumentSupport.display(exr, exec_ctx) + WorkflowDocumentSupport.display(exr, exec_ctx, WorkflowPresenter) diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 3e0c484a..baecd5a5 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -2,12 +2,15 @@ Workflow services module """ -import typing +from __future__ import annotations -from chk.infrastructure.helper import formatter -from chk.infrastructure.symbol_table import Variables from chk.infrastructure.view import PresentationBuilder -from chk.modules.workflow import ChkwareTask, ChkwareValidateTask, WorkflowUses +from chk.modules.workflow import ( + ChkwareTask, + ChkwareValidateTask, + StepResult, + WorkflowUses, +) class ChkwareTaskSupport: @@ -41,34 +44,76 @@ def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: class WorkflowPresenter(PresentationBuilder): """WorkflowPresenter""" - def dump_fmt(self) -> None: - """print to screen""" + def _prepare_dump_data(self) -> dict: + """prepare dump data""" + + _, exec_report = self.data.extra + _document = self.data.file_ctx.document + + r_dump = {} - if "document" in self.data and "name" in self.data["document"]: - formatter(f"\n\nWorkflow: {self.data['document']['name']}") - formatter( - f"Steps total: {self.data['document']['step_count']}, " - f"failed: {self.data['document']['step_failed']}" + if _document and "name" in _document: + r_dump["name"] = _document["name"] + + if exec_report: + r_dump["step_count"] = len(exec_report) + r_dump["step_failed"] = len( + [item for item in exec_report if not item.is_success] ) - formatter("-" * 5) - exposed_data: list[dict] = [] + r_dump["tasks"] = [] + + for item in exec_report: + item: StepResult # type: ignore + + response_task_dump = { + "name": item.name, + "uses": item.uses, + "is_success": item.is_success, + "fetch_request_method": ( + item.others["request_method"] + if "request_method" in item.others + else "" + ), + "fetch_request_url": ( + item.others["request_url"] if "request_url" in item.others else "" + ), + "validate_asserts_count_all": ( + item.others["count_all"] if "count_all" in item.others else "" + ), + "validate_asserts_count_fail": ( + item.others["count_fail"] if "count_fail" in item.others else "" + ), + } + + r_dump["tasks"].append(response_task_dump) + return r_dump + + def dump_fmt(self) -> str: + """print to screen""" + + dump_dct: dict = self._prepare_dump_data() - if "steps" in self.data: - exposed_data = self.data["steps"] + _computed_str = f"\n\nWorkflow: {dump_dct.get('name', '')}\n" + _computed_str += f"Steps total: {dump_dct.get('step_count', '')}, " + _computed_str += f"failed: {dump_dct.get('step_failed', '')}\n" + _computed_str += "------\n" - for one_exposed_data in exposed_data: - formatter(f"\nTask: {one_exposed_data['name']}") - if one_exposed_data["uses"] == "fetch": - formatter( - f"-> {one_exposed_data['request_method']} {one_exposed_data['request_url']}" - ) - elif one_exposed_data["uses"] == "validate": - formatter( - f"-> Total tests: {one_exposed_data['asserts_count_all']}, Failed: {one_exposed_data['asserts_count_fail']}" + tasks = dump_dct.get("tasks", []) + + for one_task in tasks: + _computed_str += "\n\n" + _computed_str += "+ " if one_task["is_success"] else "- " + _computed_str += f"Task: {one_task['name']}\n" + if one_task["uses"] == "fetch": + _computed_str += f">> {one_task['fetch_request_method']} {one_task['fetch_request_url']}" + elif one_task["uses"] == "validate": + _computed_str += ( + f">> Total tests: {one_task['validate_asserts_count_all']}, " ) + _computed_str += f"Failed: {one_task['validate_asserts_count_fail']}" + + return _computed_str def dump_json(self) -> str: """print json""" - - pass From c83e77f5294279c8cd5d377ce34ed9e7f4e5a465 Mon Sep 17 00:00:00 2001 From: HSN Date: Sat, 21 Sep 2024 15:52:28 +0600 Subject: [PATCH 38/70] feat: print displaying wf response --- chk/infrastructure/view.py | 2 +- chk/modules/workflow/__init__.py | 6 +++--- chk/modules/workflow/services.py | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/chk/infrastructure/view.py b/chk/infrastructure/view.py index d97e23d2..fd181949 100644 --- a/chk/infrastructure/view.py +++ b/chk/infrastructure/view.py @@ -12,7 +12,7 @@ class PresentationBuilder(BaseModel, abc.ABC): data: typing.Any @abc.abstractmethod - def dump_fmt(self) -> None: + def dump_fmt(self) -> str: """Signature to dump formatted string""" raise NotImplementedError("Signature to dump formatted string") diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index ae973c53..71ce36e8 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -14,7 +14,7 @@ VersionedDocumentV2 as VersionedDocument, ) from chk.infrastructure.file_loader import ExecuteContext, FileContext -from chk.infrastructure.helper import data_get, slugify +from chk.infrastructure.helper import data_get, formatter, slugify from chk.infrastructure.symbol_table import ( ExecResponse, ExposeManager, @@ -185,9 +185,9 @@ def display( ) -> None: wfp = presenter(data=ex_resp) if exec_ctx.options["format"]: - wfp.dump_fmt() + formatter(wfp.dump_fmt(), dump=exec_ctx.options["dump"]) else: - wfp.dump_json() + formatter(wfp.dump_json(), dump=exec_ctx.options["dump"]) def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index baecd5a5..649b6316 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -4,6 +4,8 @@ from __future__ import annotations +import json + from chk.infrastructure.view import PresentationBuilder from chk.modules.workflow import ( ChkwareTask, @@ -17,7 +19,7 @@ class ChkwareTaskSupport: """ChkwareTaskSupport""" @classmethod - def make_task(cls, task_d_: dict, /, **kwargs) -> ChkwareTask: + def make_task(cls, task_d_: dict, /, **kwargs: dict) -> ChkwareTask: """validate task data""" if "base_file_path" not in kwargs: @@ -90,7 +92,7 @@ def _prepare_dump_data(self) -> dict: return r_dump def dump_fmt(self) -> str: - """print to screen""" + """return formatted string representation""" dump_dct: dict = self._prepare_dump_data() @@ -116,4 +118,6 @@ def dump_fmt(self) -> str: return _computed_str def dump_json(self) -> str: - """print json""" + """return json representation""" + + return json.dumps(self._prepare_dump_data()) From ddd8eb0a683d03407edbc3f7b0586554fd72a0b8 Mon Sep 17 00:00:00 2001 From: HSN Date: Mon, 23 Sep 2024 18:13:52 +0600 Subject: [PATCH 39/70] feat: get_exposed_replaced_data v2 - supports key as exposed item name and value --- chk/infrastructure/symbol_table.py | 32 ++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index 8c869203..25eb198c 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -2,6 +2,7 @@ Symbol and variable management """ +import copy import enum import os import typing @@ -12,7 +13,7 @@ from pydantic import BaseModel, ConfigDict, Field from chk.infrastructure.document import VersionedDocument, VersionedDocumentV2 -from chk.infrastructure.file_loader import FileContext, ExecuteContext +from chk.infrastructure.file_loader import ExecuteContext, FileContext from chk.infrastructure.helper import data_get from chk.infrastructure.templating import StrTemplate @@ -72,7 +73,7 @@ class ExecResponse(BaseModel): variables_exec: Variables extra: object = Field(default=None) exception: Exception | None = Field(default=None) - exposed: list[typing.Any] = Field(default_factory=list) + exposed: list | dict = Field(default_factory=list) report: dict = Field(default_factory=dict) @@ -257,3 +258,30 @@ def get_exposed_replaced_data( return ExposeManager.replace_values(expose_doc, store) return [] + + @staticmethod + def get_exposed_replaced_data_v2( + document: VersionedDocumentV2, store: dict + ) -> dict: + """ + Get expose doc from a `VersionedDocument`, and prepare it from the + value of `Variables`, and `store`, and return + + Args: + document: VersionedDocument to get expose definition from it + store: dict to use as value store + + Returns: + dict: list of expose data + """ + + file_ctx = FileContext(*document.context) + + if expose_doc := ExposeManager.get_expose_doc(file_ctx.document): + + exposed_doc_t = copy.copy(expose_doc) + + expose_val = ExposeManager.replace_values(expose_doc, store) + return dict(zip(exposed_doc_t, expose_val)) + + return {} From 6c95b62db4efa40b5bf124f84d4063a40aa347d7 Mon Sep 17 00:00:00 2001 From: HSN Date: Mon, 23 Sep 2024 18:15:17 +0600 Subject: [PATCH 40/70] refactor: instead of passed task info, pass the task --- chk/modules/workflow/__init__.py | 21 +++++++++++---------- chk/modules/workflow/entities.py | 4 ++-- chk/modules/workflow/services.py | 6 +++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 71ce36e8..07f04106 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -113,11 +113,10 @@ def set_step_template(cls, variables: Variables) -> None: @classmethod def process_task_template( cls, document: WorkflowDocument, variables: Variables - ) -> tuple[list[ExecResponse], list[StepResult]]: + ) -> list: """Process task block of document""" base_fpath: str = FileContext(*document.context).filepath - exec_responses: list[ExecResponse] = [] exec_report: list[StepResult] = [] for task in document.tasks: @@ -126,7 +125,9 @@ def process_task_template( # replace values in tasks task_d_: dict = replace_value(task, variables.data) - task_o_ = ChkwareTaskSupport.make_task(task_d_, base_file_path=base_fpath) + task_o_ = ChkwareTaskSupport.make_task( + task_d_, **dict(base_file_path=base_fpath) + ) execution_ctx = ExecuteContext( {"dump": True, "format": True}, @@ -152,15 +153,14 @@ def process_task_template( exec_report.append( StepResult( - name=task_o_.name, - uses=task_o_.uses, + task=task_o_, is_success=task_resp.report.pop("is_success"), others=task_resp.report, + exposed=task_resp.exposed, ) ) - exec_responses.append(task_resp) - return exec_responses, exec_report + return exec_report @classmethod def execute_task( @@ -201,11 +201,12 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: service = WorkflowDocumentSupport() # @TODO make sure the document do not call self making it repeating service.set_step_template(variable_doc) - exec_responses, exec_report = service.process_task_template(wflow_doc, variable_doc) + exec_report = service.process_task_template(wflow_doc, variable_doc) + # output_data = Variables() output_data = Variables({"_steps": variable_doc[WorkflowConfigNode.NODE.value]}) - exposed_data = ExposeManager.get_exposed_replaced_data( + exposed_data: dict = ExposeManager.get_exposed_replaced_data_v2( wflow_doc, {**variable_doc.data, **output_data.data} ) @@ -215,7 +216,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: exec_ctx=exec_ctx, variables=variable_doc, variables_exec=output_data, - extra=(exec_responses, exec_report), + extra=exec_report, exposed=exposed_data, ) diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index 57b6addc..f8c3be6e 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -83,7 +83,7 @@ def __init__(self, basepath: str, /, **kwargs: dict) -> None: class StepResult(BaseModel): """StepResult""" - name: str - uses: str + task: ChkwareTask | ChkwareValidateTask is_success: bool others: dict = Field(default_factory=dict) + exposed: list | dict = Field(default_factory=list) diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 649b6316..04aaa505 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -49,7 +49,7 @@ class WorkflowPresenter(PresentationBuilder): def _prepare_dump_data(self) -> dict: """prepare dump data""" - _, exec_report = self.data.extra + exec_report = self.data.extra _document = self.data.file_ctx.document r_dump = {} @@ -69,8 +69,8 @@ def _prepare_dump_data(self) -> dict: item: StepResult # type: ignore response_task_dump = { - "name": item.name, - "uses": item.uses, + "name": item.task.name, + "uses": item.task.uses, "is_success": item.is_success, "fetch_request_method": ( item.others["request_method"] From ca09d778a8aef36f520c1d5ff87c724172fe580e Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 27 Sep 2024 23:09:12 +0600 Subject: [PATCH 41/70] feat: try to covert to dict service method --- chk/infrastructure/helper.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chk/infrastructure/helper.py b/chk/infrastructure/helper.py index 0a8386ed..d2475ad8 100644 --- a/chk/infrastructure/helper.py +++ b/chk/infrastructure/helper.py @@ -1,6 +1,7 @@ """ Helper functions module """ + import ast import re from collections.abc import Callable @@ -158,6 +159,16 @@ def to_auto(var: str) -> Any: return var + @staticmethod + def try_dict(to_dict: Any, say_exception: bool = False) -> dict | Any: + try: + return dict(to_dict) + except ValueError as ex: + if say_exception: + raise ex + else: + return to_dict + def formatter(message: object, cb: Callable = str, dump: bool = True) -> str: """Format message with given callback From 36528f532a6bed45e83e270cf3e0ef5085ebe598 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 27 Sep 2024 23:09:52 +0600 Subject: [PATCH 42/70] feat: update messaging for list for exportables --- chk/modules/workflow/services.py | 37 ++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 04aaa505..df65bfed 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -6,11 +6,13 @@ import json +from chk.infrastructure.helper import Cast from chk.infrastructure.view import PresentationBuilder from chk.modules.workflow import ( ChkwareTask, ChkwareValidateTask, StepResult, + WorkflowConfigNode, WorkflowUses, ) @@ -94,6 +96,25 @@ def _prepare_dump_data(self) -> dict: def dump_fmt(self) -> str: """return formatted string representation""" + exposed_fmt_str = [] + + for key in self.data.exposed: + _t_key = str(key).replace("%>", "").replace("<%", "").strip() + _t_marker = str(WorkflowConfigNode.NODE) + _str_to_append = "" + + if _t_marker in _t_key and len(_t_key) == len(_t_marker): + _str_to_append = self._prepare_dump_str_for_steps() + else: + _str_to_append = json.dumps(self.data.exposed[key]) + + exposed_fmt_str.append(_str_to_append) + + return "\n------\n".join(exposed_fmt_str) + + def _prepare_dump_str_for_steps(self) -> str: + """prepare dump str for steps""" + dump_dct: dict = self._prepare_dump_data() _computed_str = f"\n\nWorkflow: {dump_dct.get('name', '')}\n" @@ -104,7 +125,6 @@ def dump_fmt(self) -> str: tasks = dump_dct.get("tasks", []) for one_task in tasks: - _computed_str += "\n\n" _computed_str += "+ " if one_task["is_success"] else "- " _computed_str += f"Task: {one_task['name']}\n" if one_task["uses"] == "fetch": @@ -119,5 +139,18 @@ def dump_fmt(self) -> str: def dump_json(self) -> str: """return json representation""" + exposed_fmt_str = [] + + for key in self.data.exposed: + _t_key = str(key).replace("%>", "").replace("<%", "").strip() + _t_marker = str(WorkflowConfigNode.NODE) + _to_append = {} + + if _t_marker in _t_key and len(_t_key) == len(_t_marker): + _to_append = self._prepare_dump_data() + else: + _to_append = Cast.try_dict(self.data.exposed[key]) + + exposed_fmt_str.append(_to_append) - return json.dumps(self._prepare_dump_data()) + return json.dumps(exposed_fmt_str) From d700be9887cf352c5ee0bb1e3398964435b417ea Mon Sep 17 00:00:00 2001 From: HSN Date: Sat, 28 Sep 2024 12:34:08 +0600 Subject: [PATCH 43/70] refactor: reformation of spacing in output --- chk/modules/workflow/services.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index df65bfed..722376d5 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -110,21 +110,21 @@ def dump_fmt(self) -> str: exposed_fmt_str.append(_str_to_append) - return "\n------\n".join(exposed_fmt_str) + return "\n======\n".join(exposed_fmt_str) def _prepare_dump_str_for_steps(self) -> str: """prepare dump str for steps""" dump_dct: dict = self._prepare_dump_data() - _computed_str = f"\n\nWorkflow: {dump_dct.get('name', '')}\n" - _computed_str += f"Steps total: {dump_dct.get('step_count', '')}, " - _computed_str += f"failed: {dump_dct.get('step_failed', '')}\n" - _computed_str += "------\n" + _computed_str = f"\n\nWorkflow: {dump_dct.get('name', '')}" + _computed_str += f"\nSteps total: {dump_dct.get('step_count', '')}, " + _computed_str += f"failed: {dump_dct.get('step_failed', '')}" tasks = dump_dct.get("tasks", []) for one_task in tasks: + _computed_str += "\n------\n" _computed_str += "+ " if one_task["is_success"] else "- " _computed_str += f"Task: {one_task['name']}\n" if one_task["uses"] == "fetch": From 4d5a6cd6a05d9cd12dae7baa3fd4040dee76a977 Mon Sep 17 00:00:00 2001 From: HSN Date: Sun, 29 Sep 2024 09:59:13 +0600 Subject: [PATCH 44/70] feat: using the value of the enum --- chk/modules/validate/__init__.py | 24 ++++++++++++++----- .../modules/validate/validate_entity_test.py | 12 +++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 7e94efb1..0a896346 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -133,19 +133,19 @@ def set_data_template( """sets data or template""" data = data_get(exec_ctx.arguments, "data", {}) - variables[ValidationConfigNode.VAR_NODE] = data if data else validate_doc.data + variables[ValidationConfigNode.VAR_NODE.value] = data if data else validate_doc.data @staticmethod def process_data_template(variables: Variables) -> None: """process data or template before assertion""" - data = variables[ValidationConfigNode.VAR_NODE] + data = variables[ValidationConfigNode.VAR_NODE.value] tmp_variables = { key: val for key, val in variables.data.items() - if key != ValidationConfigNode.VAR_NODE + if key != ValidationConfigNode.VAR_NODE.value } - variables[ValidationConfigNode.VAR_NODE] = replace_value(data, tmp_variables) + variables[ValidationConfigNode.VAR_NODE.value] = replace_value(data, tmp_variables) @staticmethod def make_assertion_entry_list(assert_lst: list[dict]) -> list[AssertionEntry]: @@ -277,14 +277,26 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: exposed_data = ExposeManager.get_exposed_replaced_data( validate_doc, { - **validate_doc.data, + **variable_doc.data, **{ "_asserts_response": test_run_result, - "_data": variable_doc["_data"], + # "_data": variable_doc["_data"], }, }, ) + import icecream + + # icecream.ic(exposed_data) + icecream.ic(variable_doc.data) + # icecream.ic({ + # **variable_doc.data, + # **{ + # "_asserts_response": test_run_result, + # "_data": variable_doc["_data"], + # }, + # }) + return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, diff --git a/tests/modules/validate/validate_entity_test.py b/tests/modules/validate/validate_entity_test.py index 021758b4..3fa7cac6 100644 --- a/tests/modules/validate/validate_entity_test.py +++ b/tests/modules/validate/validate_entity_test.py @@ -156,7 +156,7 @@ def test_set_data_template_pass_when_set_from_exec_ctx(self): variables = Variables() ValidationDocumentSupport.set_data_template(doc, variables, exec_ctx) - assert bool(variables[ValidationConfigNode.VAR_NODE]) + assert bool(variables[ValidationConfigNode.VAR_NODE.value]) def test_set_data_template_pass_when_set_from_doc(self): ctx = FileContext( @@ -185,7 +185,7 @@ def test_set_data_template_pass_when_set_from_doc(self): variables = Variables() ValidationDocumentSupport.set_data_template(doc, variables, exec_ctx) - assert bool(variables[ValidationConfigNode.VAR_NODE]) + assert bool(variables[ValidationConfigNode.VAR_NODE.value]) def test_set_data_template_pass_exec_ctx_prioritise(self): ctx = FileContext( @@ -215,8 +215,8 @@ def test_set_data_template_pass_exec_ctx_prioritise(self): variables = Variables() ValidationDocumentSupport.set_data_template(doc, variables, exec_ctx) - assert bool(variables[ValidationConfigNode.VAR_NODE]) - assert variables[ValidationConfigNode.VAR_NODE].get("name") == "Some Name Two" + assert bool(variables[ValidationConfigNode.VAR_NODE.value]) + assert variables[ValidationConfigNode.VAR_NODE.value].get("name") == "Some Name Two" @staticmethod def test_process_data_template_pass(): @@ -251,8 +251,8 @@ def test_process_data_template_pass(): ValidationDocumentSupport.set_data_template(doc, variables, exec_ctx) ValidationDocumentSupport.process_data_template(variables) - assert bool(variables[ValidationConfigNode.VAR_NODE]) - assert variables[ValidationConfigNode.VAR_NODE].get("greet") == "Hello Somebody" + assert bool(variables[ValidationConfigNode.VAR_NODE.value]) + assert variables[ValidationConfigNode.VAR_NODE.value].get("greet") == "Hello Somebody" @staticmethod def test_make_assertion_entry_list_pass(): From 68947cce40a6c6e43df8a3f4af0b2d549c8eaa39 Mon Sep 17 00:00:00 2001 From: HSN Date: Mon, 30 Sep 2024 19:45:47 +0600 Subject: [PATCH 45/70] refactor: remoce dumping --- chk/modules/validate/__init__.py | 47 ++++++++++++-------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 0a896346..d590c91e 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -3,37 +3,37 @@ """ from __future__ import annotations + import dataclasses import enum import json -from collections import abc import cerberus +from collections import abc from chk.infrastructure.document import VersionedDocument, VersionedDocumentSupport -from chk.infrastructure.file_loader import FileContext, ExecuteContext +from chk.infrastructure.file_loader import ExecuteContext, FileContext from chk.infrastructure.helper import data_get, formatter -from chk.infrastructure.version import DocumentVersionMaker, SCHEMA as VER_SCHEMA - from chk.infrastructure.symbol_table import ( - VARIABLE_SCHEMA as VAR_SCHEMA, EXPOSE_SCHEMA as EXP_SCHEMA, - Variables, + ExecResponse, + ExposeManager, + VARIABLE_SCHEMA as VAR_SCHEMA, VariableTableManager, + Variables, replace_value, - ExposeManager, - ExecResponse, ) +from chk.infrastructure.version import DocumentVersionMaker, SCHEMA as VER_SCHEMA from chk.modules.validate.assertion_services import ( + AllTestRunResult, AssertionEntry, AssertionEntryListRunner, - AllTestRunResult, - ValidationTask, MAP_TYPE_TO_FN, + ValidationTask, ) from chk.modules.validate.assertion_validation import ( - get_schema_map, AssertionEntityProperty, + get_schema_map, ) VERSION_SCOPE = ["validation"] @@ -133,7 +133,9 @@ def set_data_template( """sets data or template""" data = data_get(exec_ctx.arguments, "data", {}) - variables[ValidationConfigNode.VAR_NODE.value] = data if data else validate_doc.data + variables[ValidationConfigNode.VAR_NODE.value] = ( + data if data else validate_doc.data + ) @staticmethod def process_data_template(variables: Variables) -> None: @@ -145,7 +147,9 @@ def process_data_template(variables: Variables) -> None: if key != ValidationConfigNode.VAR_NODE.value } - variables[ValidationConfigNode.VAR_NODE.value] = replace_value(data, tmp_variables) + variables[ValidationConfigNode.VAR_NODE.value] = replace_value( + data, tmp_variables + ) @staticmethod def make_assertion_entry_list(assert_lst: list[dict]) -> list[AssertionEntry]: @@ -278,25 +282,10 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: validate_doc, { **variable_doc.data, - **{ - "_asserts_response": test_run_result, - # "_data": variable_doc["_data"], - }, + **{"_asserts_response": test_run_result}, }, ) - import icecream - - # icecream.ic(exposed_data) - icecream.ic(variable_doc.data) - # icecream.ic({ - # **variable_doc.data, - # **{ - # "_asserts_response": test_run_result, - # "_data": variable_doc["_data"], - # }, - # }) - return ExecResponse( file_ctx=file_ctx, exec_ctx=exec_ctx, From f53acfa388d58ea9d42a738b26b7b47b669c5cc9 Mon Sep 17 00:00:00 2001 From: HSN Date: Mon, 30 Sep 2024 22:35:16 +0600 Subject: [PATCH 46/70] refactor: change fn sign --- chk/modules/workflow/__init__.py | 1 + chk/modules/workflow/entities.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 07f04106..909d4285 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -170,6 +170,7 @@ def execute_task( _task_res: ExecResponse = task_fn(**task_params.asdict()) variables[WorkflowConfigNode.NODE.value].append(_task_res.variables_exec.data) + _task_res: ExecResponse = task_fn(**task_params.as_dict()) return _task_res diff --git a/chk/modules/workflow/entities.py b/chk/modules/workflow/entities.py index f8c3be6e..7ea556fb 100644 --- a/chk/modules/workflow/entities.py +++ b/chk/modules/workflow/entities.py @@ -24,7 +24,7 @@ class TaskExecParam(NamedTuple): task: ChkwareTask exec_ctx: ExecuteContext - def asdict(self) -> dict: + def as_dict(self) -> dict: """Convert to dict""" return {"task": self.task.model_dump(), "execution_context": self.exec_ctx} From a0196964895e3330ac39fd70253d789f06d511fb Mon Sep 17 00:00:00 2001 From: HSN Date: Wed, 2 Oct 2024 09:37:18 +0600 Subject: [PATCH 47/70] fix: json object dumping iissue --- chk/modules/workflow/services.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 722376d5..96e84032 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -98,7 +98,7 @@ def dump_fmt(self) -> str: exposed_fmt_str = [] - for key in self.data.exposed: + for key, value in self.data.exposed.items(): _t_key = str(key).replace("%>", "").replace("<%", "").strip() _t_marker = str(WorkflowConfigNode.NODE) _str_to_append = "" @@ -106,8 +106,15 @@ def dump_fmt(self) -> str: if _t_marker in _t_key and len(_t_key) == len(_t_marker): _str_to_append = self._prepare_dump_str_for_steps() else: - _str_to_append = json.dumps(self.data.exposed[key]) + _value = [] + for item in value: + if hasattr(item, "as_dict"): + _value.append(item.as_dict) + else: + _value.append(item) + + _str_to_append = json.dumps(_value) exposed_fmt_str.append(_str_to_append) return "\n======\n".join(exposed_fmt_str) @@ -141,7 +148,7 @@ def dump_json(self) -> str: """return json representation""" exposed_fmt_str = [] - for key in self.data.exposed: + for key, value in self.data.exposed.items(): _t_key = str(key).replace("%>", "").replace("<%", "").strip() _t_marker = str(WorkflowConfigNode.NODE) _to_append = {} @@ -149,7 +156,15 @@ def dump_json(self) -> str: if _t_marker in _t_key and len(_t_key) == len(_t_marker): _to_append = self._prepare_dump_data() else: - _to_append = Cast.try_dict(self.data.exposed[key]) + _value = [] + + for item in value: + if hasattr(item, "as_dict"): + _value.append(item.as_dict) + else: + _value.append(item) + + _to_append = Cast.try_dict(_value) exposed_fmt_str.append(_to_append) From dae7fb8a0db0ba4859322d43016d41257fc17f6b Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 12:50:58 +0600 Subject: [PATCH 48/70] feat: convert validation doc to v2 --- chk/modules/validate/__init__.py | 15 +++++++++------ chk/modules/workflow/__init__.py | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index d590c91e..31129c02 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -7,11 +7,15 @@ import dataclasses import enum import json +from collections import abc import cerberus -from collections import abc +from pydantic import BaseModel, Field -from chk.infrastructure.document import VersionedDocument, VersionedDocumentSupport +from chk.infrastructure.document import ( + VersionedDocumentSupport, + VersionedDocumentV2, +) from chk.infrastructure.file_loader import ExecuteContext, FileContext from chk.infrastructure.helper import data_get, formatter from chk.infrastructure.symbol_table import ( @@ -66,14 +70,13 @@ class ValidationConfigNode(enum.StrEnum): } -@dataclasses.dataclass(slots=True) -class ValidationDocument(VersionedDocument): +class ValidationDocument(VersionedDocumentV2, BaseModel): """ Http document entity """ - data: dict = dataclasses.field(default_factory=dict) - asserts: list = dataclasses.field(default_factory=list) + data: dict = Field(default_factory=dict) + asserts: list = Field(default_factory=list) @staticmethod def from_file_context(ctx: FileContext) -> ValidationDocument: diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 909d4285..4ab77862 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -8,10 +8,10 @@ from collections import abc from collections.abc import Callable -from pydantic import ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field from chk.infrastructure.document import ( - VersionedDocumentV2 as VersionedDocument, + VersionedDocumentV2, ) from chk.infrastructure.file_loader import ExecuteContext, FileContext from chk.infrastructure.helper import data_get, formatter, slugify @@ -39,7 +39,7 @@ VERSION_SCOPE = ["workflow"] -class WorkflowDocument(VersionedDocument): +class WorkflowDocument(VersionedDocumentV2, BaseModel): """WorkflowDocument""" model_config = ConfigDict(extra="forbid") From 557dd60992e72b8eee3b0cc5a3ebc85169fac3a1 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 12:58:20 +0600 Subject: [PATCH 49/70] feat: replace dataclass with basemodel --- chk/infrastructure/document.py | 5 ++++- chk/modules/validate/__init__.py | 9 +-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/chk/infrastructure/document.py b/chk/infrastructure/document.py index 37a5083b..2f592564 100644 --- a/chk/infrastructure/document.py +++ b/chk/infrastructure/document.py @@ -1,6 +1,7 @@ """ Base document and utility """ + import dataclasses import cerberus @@ -32,7 +33,9 @@ class VersionedDocumentSupport: """DocumentVersionSupport""" @staticmethod - def validate_with_schema(schema: dict, doc: VersionedDocument) -> bool: + def validate_with_schema( + schema: dict, doc: VersionedDocument | VersionedDocumentV2 + ) -> bool: """Validate a document with given schema Args: diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 31129c02..a962ced9 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -4,7 +4,6 @@ from __future__ import annotations -import dataclasses import enum import json from collections import abc @@ -101,12 +100,6 @@ def from_file_context(ctx: FileContext) -> ValidationDocument: data=_data, ) - @property - def as_dict(self) -> dict: - """Return a dict of the data""" - - return dataclasses.asdict(self) - class ValidationDocumentSupport: """Service class for ValidationDocument""" @@ -255,7 +248,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: validate_doc = ValidationDocument.from_file_context(file_ctx) DocumentVersionMaker.verify_if_allowed( - DocumentVersionMaker.from_dict(validate_doc.as_dict), VERSION_SCOPE + DocumentVersionMaker.from_dict(validate_doc.model_dump()), VERSION_SCOPE ) VersionedDocumentSupport.validate_with_schema( From d556d693a450bcf72706e8358a47235e58186ee8 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 13:00:18 +0600 Subject: [PATCH 50/70] docs: add feature suggestion --- chk/modules/validate/assertion_services.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chk/modules/validate/assertion_services.py b/chk/modules/validate/assertion_services.py index 2ed62d83..90e5a732 100644 --- a/chk/modules/validate/assertion_services.py +++ b/chk/modules/validate/assertion_services.py @@ -65,7 +65,9 @@ @dataclasses.dataclass class AssertionEntry: - """AssertionEntry holds one assertion operation""" + """AssertionEntry holds one assertion operation + TODO: implement __iter__ for this class + """ assert_type: str actual: typing.Any @@ -123,6 +125,7 @@ def as_fmt_str(self) -> str: class AllTestRunResult(UserDict): """Result of a test run + TODO: implement __iter__ for this class keys: id, time_start, time_end, count_all, results, count_fail """ From a1e95d010f2755b8f8f4769bf489c986b36a7d51 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 16:41:26 +0600 Subject: [PATCH 51/70] feat: remove templating notation --- chk/infrastructure/symbol_table.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index 25eb198c..f1054dfe 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -280,6 +280,10 @@ def get_exposed_replaced_data_v2( if expose_doc := ExposeManager.get_expose_doc(file_ctx.document): exposed_doc_t = copy.copy(expose_doc) + exposed_doc_t = [ + str(key).replace("%>", "").replace("<%", "").strip() + for key in exposed_doc_t + ] expose_val = ExposeManager.replace_values(expose_doc, store) return dict(zip(exposed_doc_t, expose_val)) From 55d6dea79ef5ab0f716f3329e1af5b70ae8e2183 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 16:42:07 +0600 Subject: [PATCH 52/70] feat: exposing dict based data in validation --- chk/modules/validate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index a962ced9..430b56e6 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -274,7 +274,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: } ) - exposed_data = ExposeManager.get_exposed_replaced_data( + exposed_data = ExposeManager.get_exposed_replaced_data_v2( validate_doc, { **variable_doc.data, From c2f251c061a77791095290fa0b8d5069e84cc716 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 19:22:27 +0600 Subject: [PATCH 53/70] feat: convert dataclass to basemodel based doc --- chk/modules/fetch.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 8a343181..9e2ac2aa 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -4,7 +4,6 @@ from __future__ import annotations -import dataclasses import enum import json import pathlib @@ -16,7 +15,10 @@ from pydantic import BaseModel, Field from requests.auth import HTTPBasicAuth -from chk.infrastructure.document import VersionedDocument, VersionedDocumentSupport +from chk.infrastructure.document import ( + VersionedDocumentSupport, + VersionedDocumentV2, +) from chk.infrastructure.file_loader import ExecuteContext, FileContext from chk.infrastructure.helper import data_get, formatter from chk.infrastructure.symbol_table import ( @@ -319,13 +321,12 @@ def add_generic_args(request_data: dict, request_arg: dict) -> None: HttpRequestArgCompiler.add_body(request_data, request_arg) -@dataclasses.dataclass(slots=True) -class HttpDocument(VersionedDocument): +class HttpDocument(VersionedDocumentV2, BaseModel): """ Http document entity """ - request: dict = dataclasses.field(default_factory=dict) + request: dict = Field(default_factory=dict) @staticmethod def from_file_context(ctx: FileContext) -> HttpDocument: @@ -347,12 +348,6 @@ def from_file_context(ctx: FileContext) -> HttpDocument: request=request_dct, ) - @property - def as_dict(self) -> dict: - """Return a dict of the data""" - - return dataclasses.asdict(self) - class ApiResponseDict(UserDict): """Represents a API response with body in dict representation""" @@ -531,7 +526,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: http_doc = HttpDocument.from_file_context(file_ctx) DocumentVersionMaker.verify_if_allowed( - DocumentVersionMaker.from_dict(http_doc.as_dict), VERSION_SCOPE + DocumentVersionMaker.from_dict(http_doc.model_dump()), VERSION_SCOPE ) VersionedDocumentSupport.validate_with_schema( From b7ec614965309c61efeba9302996bc6be388c7b2 Mon Sep 17 00:00:00 2001 From: HSN Date: Thu, 3 Oct 2024 19:25:33 +0600 Subject: [PATCH 54/70] feat: use replace utils ver2 --- chk/modules/fetch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chk/modules/fetch.py b/chk/modules/fetch.py index 9e2ac2aa..52619e0b 100644 --- a/chk/modules/fetch.py +++ b/chk/modules/fetch.py @@ -546,7 +546,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: output_data = Variables({"_response": response.data}) - exposed_data = ExposeManager.get_exposed_replaced_data( + exposed_data = ExposeManager.get_exposed_replaced_data_v2( http_doc, {**variable_doc.data, **output_data.data}, ) @@ -564,8 +564,8 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: exposed=exposed_data, report={ "is_success": r_exception is None, - "request_method": file_ctx.document["request"]['method'], - "request_url": file_ctx.document["request"]['url'], + "request_method": file_ctx.document["request"]["method"], + "request_url": file_ctx.document["request"]["url"], }, ) From e28c99392735bfb4eb3b691707538294c8f65558 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 08:44:33 +0600 Subject: [PATCH 55/70] chore: package version update --- Pipfile.lock | 838 ++++++++++++++++++++++--------------------- requirements-dev.txt | 34 +- requirements.txt | 10 +- 3 files changed, 443 insertions(+), 439 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 7c7862b3..86fe17ae 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -34,11 +34,11 @@ }, "certifi": { "hashes": [ - "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b", - "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90" + "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8", + "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9" ], "markers": "python_version >= '3.6'", - "version": "==2024.7.4" + "version": "==2024.8.30" }, "charset-normalizer": { "hashes": [ @@ -156,115 +156,115 @@ }, "idna": { "hashes": [ - "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac", - "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603" + "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", + "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" ], "markers": "python_version >= '3.6'", - "version": "==3.8" + "version": "==3.10" }, "pydantic": { "hashes": [ - "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a", - "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8" + "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f", + "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==2.8.2" + "version": "==2.9.2" }, "pydantic-core": { "hashes": [ - "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d", - "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f", - "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686", - "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482", - "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006", - "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83", - "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6", - "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88", - "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86", - "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a", - "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6", - "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a", - "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6", - "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6", - "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43", - "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c", - "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4", - "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e", - "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203", - "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd", - "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1", - "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24", - "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc", - "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc", - "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3", - "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598", - "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98", - "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331", - "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2", - "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a", - "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6", - "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688", - "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91", - "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa", - "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b", - "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0", - "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840", - "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c", - "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd", - "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3", - "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231", - "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1", - "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953", - "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250", - "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a", - "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2", - "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20", - "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434", - "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab", - "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703", - "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a", - "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2", - "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac", - "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611", - "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121", - "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e", - "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b", - "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09", - "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906", - "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9", - "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7", - "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b", - "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987", - "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c", - "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b", - "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e", - "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237", - "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1", - "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19", - "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b", - "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad", - "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0", - "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94", - "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312", - "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f", - "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669", - "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1", - "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe", - "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99", - "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a", - "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a", - "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52", - "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c", - "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad", - "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1", - "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a", - "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f", - "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a", - "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27" + "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36", + "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05", + "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071", + "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327", + "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c", + "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36", + "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29", + "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744", + "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d", + "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec", + "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e", + "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e", + "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577", + "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232", + "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863", + "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6", + "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368", + "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480", + "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2", + "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2", + "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6", + "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769", + "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d", + "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2", + "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84", + "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166", + "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271", + "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5", + "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb", + "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13", + "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323", + "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556", + "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665", + "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef", + "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb", + "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119", + "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126", + "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510", + "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b", + "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87", + "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f", + "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc", + "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8", + "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21", + "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f", + "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6", + "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658", + "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b", + "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3", + "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb", + "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59", + "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24", + "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9", + "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3", + "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd", + "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753", + "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55", + "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad", + "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a", + "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605", + "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e", + "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b", + "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433", + "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8", + "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07", + "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728", + "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0", + "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327", + "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555", + "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64", + "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6", + "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea", + "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b", + "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df", + "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e", + "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd", + "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068", + "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3", + "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040", + "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12", + "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916", + "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f", + "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f", + "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801", + "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231", + "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5", + "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8", + "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee", + "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607" ], "markers": "python_version >= '3.8'", - "version": "==2.20.1" + "version": "==2.23.4" }, "python-dotenv": { "hashes": [ @@ -354,11 +354,11 @@ }, "urllib3": { "hashes": [ - "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472", - "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168" + "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac", + "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9" ], "markers": "python_version >= '3.8'", - "version": "==2.2.2" + "version": "==2.2.3" }, "xmltodict": { "hashes": [ @@ -373,107 +373,107 @@ "develop": { "aiohappyeyeballs": { "hashes": [ - "sha256:55a1714f084e63d49639800f95716da97a1f173d46a16dfcfda0016abb93b6b2", - "sha256:7ce92076e249169a13c2f49320d1967425eaf1f407522d707d59cac7628d62bd" + "sha256:75cf88a15106a5002a8eb1dab212525c00d1f4c0fa96e551c9fbe6f09a621586", + "sha256:8a7a83727b2756f394ab2895ea0765a0a8c475e3c71e98d43d76f22b4b435572" ], "markers": "python_version >= '3.8'", - "version": "==2.4.0" + "version": "==2.4.3" }, "aiohttp": { "hashes": [ - "sha256:02594361128f780eecc2a29939d9dfc870e17b45178a867bf61a11b2a4367277", - "sha256:03f2645adbe17f274444953bdea69f8327e9d278d961d85657cb0d06864814c1", - "sha256:074d1bff0163e107e97bd48cad9f928fa5a3eb4b9d33366137ffce08a63e37fe", - "sha256:0912b8a8fadeb32ff67a3ed44249448c20148397c1ed905d5dac185b4ca547bb", - "sha256:0d277cfb304118079e7044aad0b76685d30ecb86f83a0711fc5fb257ffe832ca", - "sha256:0d93400c18596b7dc4794d48a63fb361b01a0d8eb39f28800dc900c8fbdaca91", - "sha256:123dd5b16b75b2962d0fff566effb7a065e33cd4538c1692fb31c3bda2bfb972", - "sha256:17e997105bd1a260850272bfb50e2a328e029c941c2708170d9d978d5a30ad9a", - "sha256:18a01eba2574fb9edd5f6e5fb25f66e6ce061da5dab5db75e13fe1558142e0a3", - "sha256:1923a5c44061bffd5eebeef58cecf68096e35003907d8201a4d0d6f6e387ccaa", - "sha256:1942244f00baaacaa8155eca94dbd9e8cc7017deb69b75ef67c78e89fdad3c77", - "sha256:1b2c16a919d936ca87a3c5f0e43af12a89a3ce7ccbce59a2d6784caba945b68b", - "sha256:1c19de68896747a2aa6257ae4cf6ef59d73917a36a35ee9d0a6f48cff0f94db8", - "sha256:1e72589da4c90337837fdfe2026ae1952c0f4a6e793adbbfbdd40efed7c63599", - "sha256:22c0a23a3b3138a6bf76fc553789cb1a703836da86b0f306b6f0dc1617398abc", - "sha256:2c634a3207a5445be65536d38c13791904fda0748b9eabf908d3fe86a52941cf", - "sha256:2d21ac12dc943c68135ff858c3a989f2194a709e6e10b4c8977d7fcd67dfd511", - "sha256:2f1f1c75c395991ce9c94d3e4aa96e5c59c8356a15b1c9231e783865e2772699", - "sha256:305be5ff2081fa1d283a76113b8df7a14c10d75602a38d9f012935df20731487", - "sha256:33e6bc4bab477c772a541f76cd91e11ccb6d2efa2b8d7d7883591dfb523e5987", - "sha256:349ef8a73a7c5665cca65c88ab24abe75447e28aa3bc4c93ea5093474dfdf0ff", - "sha256:380f926b51b92d02a34119d072f178d80bbda334d1a7e10fa22d467a66e494db", - "sha256:38172a70005252b6893088c0f5e8a47d173df7cc2b2bd88650957eb84fcf5022", - "sha256:391cc3a9c1527e424c6865e087897e766a917f15dddb360174a70467572ac6ce", - "sha256:3a1c32a19ee6bbde02f1cb189e13a71b321256cc1d431196a9f824050b160d5a", - "sha256:4120d7fefa1e2d8fb6f650b11489710091788de554e2b6f8347c7a20ceb003f5", - "sha256:424ae21498790e12eb759040bbb504e5e280cab64693d14775c54269fd1d2bb7", - "sha256:44b324a6b8376a23e6ba25d368726ee3bc281e6ab306db80b5819999c737d820", - "sha256:4790f0e15f00058f7599dab2b206d3049d7ac464dc2e5eae0e93fa18aee9e7bf", - "sha256:4aff049b5e629ef9b3e9e617fa6e2dfeda1bf87e01bcfecaf3949af9e210105e", - "sha256:4b38b1570242fbab8d86a84128fb5b5234a2f70c2e32f3070143a6d94bc854cf", - "sha256:4d46c7b4173415d8e583045fbc4daa48b40e31b19ce595b8d92cf639396c15d5", - "sha256:4f1c9866ccf48a6df2b06823e6ae80573529f2af3a0992ec4fe75b1a510df8a6", - "sha256:4f7acae3cf1a2a2361ec4c8e787eaaa86a94171d2417aae53c0cca6ca3118ff6", - "sha256:54d9ddea424cd19d3ff6128601a4a4d23d54a421f9b4c0fff740505813739a91", - "sha256:58718e181c56a3c02d25b09d4115eb02aafe1a732ce5714ab70326d9776457c3", - "sha256:5ede29d91a40ba22ac1b922ef510aab871652f6c88ef60b9dcdf773c6d32ad7a", - "sha256:61645818edd40cc6f455b851277a21bf420ce347baa0b86eaa41d51ef58ba23d", - "sha256:66bf9234e08fe561dccd62083bf67400bdbf1c67ba9efdc3dac03650e97c6088", - "sha256:673f988370f5954df96cc31fd99c7312a3af0a97f09e407399f61583f30da9bc", - "sha256:676f94c5480d8eefd97c0c7e3953315e4d8c2b71f3b49539beb2aa676c58272f", - "sha256:6c225286f2b13bab5987425558baa5cbdb2bc925b2998038fa028245ef421e75", - "sha256:7384d0b87d4635ec38db9263e6a3f1eb609e2e06087f0aa7f63b76833737b471", - "sha256:7e2fe37ac654032db1f3499fe56e77190282534810e2a8e833141a021faaab0e", - "sha256:7f2bfc0032a00405d4af2ba27f3c429e851d04fad1e5ceee4080a1c570476697", - "sha256:7f6b639c36734eaa80a6c152a238242bedcee9b953f23bb887e9102976343092", - "sha256:814375093edae5f1cb31e3407997cf3eacefb9010f96df10d64829362ae2df69", - "sha256:8224f98be68a84b19f48e0bdc14224b5a71339aff3a27df69989fa47d01296f3", - "sha256:898715cf566ec2869d5cb4d5fb4be408964704c46c96b4be267442d265390f32", - "sha256:8989f46f3d7ef79585e98fa991e6ded55d2f48ae56d2c9fa5e491a6e4effb589", - "sha256:8ba01ebc6175e1e6b7275c907a3a36be48a2d487549b656aa90c8a910d9f3178", - "sha256:8c5c6fa16412b35999320f5c9690c0f554392dc222c04e559217e0f9ae244b92", - "sha256:8c6a4e5e40156d72a40241a25cc226051c0a8d816610097a8e8f517aeacd59a2", - "sha256:8eaf44ccbc4e35762683078b72bf293f476561d8b68ec8a64f98cf32811c323e", - "sha256:8fb4fc029e135859f533025bc82047334e24b0d489e75513144f25408ecaf058", - "sha256:9093a81e18c45227eebe4c16124ebf3e0d893830c6aca7cc310bfca8fe59d857", - "sha256:94c4381ffba9cc508b37d2e536b418d5ea9cfdc2848b9a7fea6aebad4ec6aac1", - "sha256:94fac7c6e77ccb1ca91e9eb4cb0ac0270b9fb9b289738654120ba8cebb1189c6", - "sha256:95c4dc6f61d610bc0ee1edc6f29d993f10febfe5b76bb470b486d90bbece6b22", - "sha256:975218eee0e6d24eb336d0328c768ebc5d617609affaca5dbbd6dd1984f16ed0", - "sha256:ad146dae5977c4dd435eb31373b3fe9b0b1bf26858c6fc452bf6af394067e10b", - "sha256:afe16a84498441d05e9189a15900640a2d2b5e76cf4efe8cbb088ab4f112ee57", - "sha256:b1c43eb1ab7cbf411b8e387dc169acb31f0ca0d8c09ba63f9eac67829585b44f", - "sha256:b90078989ef3fc45cf9221d3859acd1108af7560c52397ff4ace8ad7052a132e", - "sha256:b98e698dc34966e5976e10bbca6d26d6724e6bdea853c7c10162a3235aba6e16", - "sha256:ba5a8b74c2a8af7d862399cdedce1533642fa727def0b8c3e3e02fcb52dca1b1", - "sha256:c31ad0c0c507894e3eaa843415841995bf8de4d6b2d24c6e33099f4bc9fc0d4f", - "sha256:c3b9162bab7e42f21243effc822652dc5bb5e8ff42a4eb62fe7782bcbcdfacf6", - "sha256:c58c6837a2c2a7cf3133983e64173aec11f9c2cd8e87ec2fdc16ce727bcf1a04", - "sha256:c83f7a107abb89a227d6c454c613e7606c12a42b9a4ca9c5d7dad25d47c776ae", - "sha256:cde98f323d6bf161041e7627a5fd763f9fd829bcfcd089804a5fdce7bb6e1b7d", - "sha256:ce91db90dbf37bb6fa0997f26574107e1b9d5ff939315247b7e615baa8ec313b", - "sha256:d00f3c5e0d764a5c9aa5a62d99728c56d455310bcc288a79cab10157b3af426f", - "sha256:d17920f18e6ee090bdd3d0bfffd769d9f2cb4c8ffde3eb203777a3895c128862", - "sha256:d55f011da0a843c3d3df2c2cf4e537b8070a419f891c930245f05d329c4b0689", - "sha256:d742c36ed44f2798c8d3f4bc511f479b9ceef2b93f348671184139e7d708042c", - "sha256:d9a487ef090aea982d748b1b0d74fe7c3950b109df967630a20584f9a99c0683", - "sha256:d9ef084e3dc690ad50137cc05831c52b6ca428096e6deb3c43e95827f531d5ef", - "sha256:da452c2c322e9ce0cfef392e469a26d63d42860f829026a63374fde6b5c5876f", - "sha256:dc4826823121783dccc0871e3f405417ac116055bf184ac04c36f98b75aacd12", - "sha256:de7a5299827253023c55ea549444e058c0eb496931fa05d693b95140a947cb73", - "sha256:e04a1f2a65ad2f93aa20f9ff9f1b672bf912413e5547f60749fa2ef8a644e061", - "sha256:e1ca1ef5ba129718a8fc827b0867f6aa4e893c56eb00003b7367f8a733a9b072", - "sha256:ee40b40aa753d844162dcc80d0fe256b87cba48ca0054f64e68000453caead11", - "sha256:f071854b47d39591ce9a17981c46790acb30518e2f83dfca8db2dfa091178691", - "sha256:f29930bc2921cef955ba39a3ff87d2c4398a0394ae217f41cb02d5c26c8b1b77", - "sha256:f489a2c9e6455d87eabf907ac0b7d230a9786be43fbe884ad184ddf9e9c1e385", - "sha256:f5bf3ead3cb66ab990ee2561373b009db5bc0e857549b6c9ba84b20bc462e172", - "sha256:f6f18898ace4bcd2d41a122916475344a87f1dfdec626ecde9ee802a711bc569", - "sha256:f8112fb501b1e0567a1251a2fd0747baae60a4ab325a871e975b7bb67e59221f", - "sha256:fd31f176429cecbc1ba499d4aba31aaccfea488f418d60376b911269d3b883c5" + "sha256:10c7932337285a6bfa3a5fe1fd4da90b66ebfd9d0cbd1544402e1202eb9a8c3e", + "sha256:177126e971782769b34933e94fddd1089cef0fe6b82fee8a885e539f5b0f0c6a", + "sha256:1ce46dfb49cfbf9e92818be4b761d4042230b1f0e05ffec0aad15b3eb162b905", + "sha256:1e7a6af57091056a79a35104d6ec29d98ec7f1fb7270ad9c6fff871b678d1ff8", + "sha256:21a72f4a9c69a8567a0aca12042f12bba25d3139fd5dd8eeb9931f4d9e8599cd", + "sha256:21c1925541ca84f7b5e0df361c0a813a7d6a56d3b0030ebd4b220b8d232015f9", + "sha256:21f8225f7dc187018e8433c9326be01477fb2810721e048b33ac49091b19fb4a", + "sha256:22cdeb684d8552490dd2697a5138c4ecb46f844892df437aaf94f7eea99af879", + "sha256:270e653b5a4b557476a1ed40e6b6ce82f331aab669620d7c95c658ef976c9c5e", + "sha256:2df786c96c57cd6b87156ba4c5f166af7b88f3fc05f9d592252fdc83d8615a3c", + "sha256:32710d6b3b6c09c60c794d84ca887a3a2890131c0b02b3cefdcc6709a2260a7c", + "sha256:33a68011a38020ed4ff41ae0dbf4a96a202562ecf2024bdd8f65385f1d07f6ef", + "sha256:365783e1b7c40b59ed4ce2b5a7491bae48f41cd2c30d52647a5b1ee8604c68ad", + "sha256:3a95d2686bc4794d66bd8de654e41b5339fab542b2bca9238aa63ed5f4f2ce82", + "sha256:3b2036479b6b94afaaca7d07b8a68dc0e67b0caf5f6293bb6a5a1825f5923000", + "sha256:3c7f270f4ca92760f98a42c45a58674fff488e23b144ec80b1cc6fa2effed377", + "sha256:3f6d47e392c27206701565c8df4cac6ebed28fdf6dcaea5b1eea7a4631d8e6db", + "sha256:40d2d719c3c36a7a65ed26400e2b45b2d9ed7edf498f4df38b2ae130f25a0d01", + "sha256:4618f0d2bf523043866a9ff8458900d8eb0a6d4018f251dae98e5f1fb699f3a8", + "sha256:471a8c47344b9cc309558b3fcc469bd2c12b49322b4b31eb386c4a2b2d44e44a", + "sha256:4954e6b06dd0be97e1a5751fc606be1f9edbdc553c5d9b57d72406a8fbd17f9d", + "sha256:497a7d20caea8855c5429db3cdb829385467217d7feb86952a6107e033e031b9", + "sha256:4b91f4f62ad39a8a42d511d66269b46cb2fb7dea9564c21ab6c56a642d28bff5", + "sha256:4dbf252ac19860e0ab56cd480d2805498f47c5a2d04f5995d8d8a6effd04b48c", + "sha256:4e10b04542d27e21538e670156e88766543692a0a883f243ba8fad9ddea82e53", + "sha256:5284997e3d88d0dfb874c43e51ae8f4a6f4ca5b90dcf22995035187253d430db", + "sha256:57359785f27394a8bcab0da6dcd46706d087dfebf59a8d0ad2e64a4bc2f6f94f", + "sha256:597128cb7bc5f068181b49a732961f46cb89f85686206289d6ccb5e27cb5fbe2", + "sha256:5aa1a073514cf59c81ad49a4ed9b5d72b2433638cd53160fd2f3a9cfa94718db", + "sha256:680dbcff5adc7f696ccf8bf671d38366a1f620b5616a1d333d0cb33956065395", + "sha256:6984dda9d79064361ab58d03f6c1e793ea845c6cfa89ffe1a7b9bb400dfd56bd", + "sha256:69de056022e7abf69cb9fec795515973cc3eeaff51e3ea8d72a77aa933a91c52", + "sha256:6c7efa6616a95e3bd73b8a69691012d2ef1f95f9ea0189e42f338fae080c2fc6", + "sha256:6d1ad868624f6cea77341ef2877ad4e71f7116834a6cd7ec36ec5c32f94ee6ae", + "sha256:713dff3f87ceec3bde4f3f484861464e722cf7533f9fa6b824ec82bb5a9010a7", + "sha256:71462f8eeca477cbc0c9700a9464e3f75f59068aed5e9d4a521a103692da72dc", + "sha256:7c38cfd355fd86c39b2d54651bd6ed7d63d4fe3b5553f364bae3306e2445f847", + "sha256:8296edd99d0dd9d0eb8b9e25b3b3506eef55c1854e9cc230f0b3f885f680410b", + "sha256:85431c9131a9a0f65260dc7a65c800ca5eae78c4c9931618f18c8e0933a0e0c1", + "sha256:85e4d7bd05d18e4b348441e7584c681eff646e3bf38f68b2626807f3add21aa2", + "sha256:8885ca09d3a9317219c0831276bfe26984b17b2c37b7bf70dd478d17092a4772", + "sha256:8960fabc20bfe4fafb941067cda8e23c8c17c98c121aa31c7bf0cdab11b07842", + "sha256:9443d9ebc5167ce1fbb552faf2d666fb22ef5716a8750be67efd140a7733738c", + "sha256:9721554bfa9e15f6e462da304374c2f1baede3cb06008c36c47fa37ea32f1dc4", + "sha256:98a4eb60e27033dee9593814ca320ee8c199489fbc6b2699d0f710584db7feb7", + "sha256:98fae99d5c2146f254b7806001498e6f9ffb0e330de55a35e72feb7cb2fa399b", + "sha256:9a281cba03bdaa341c70b7551b2256a88d45eead149f48b75a96d41128c240b3", + "sha256:a087c84b4992160ffef7afd98ef24177c8bd4ad61c53607145a8377457385100", + "sha256:a1ba7bc139592339ddeb62c06486d0fa0f4ca61216e14137a40d626c81faf10c", + "sha256:a3081246bab4d419697ee45e555cef5cd1def7ac193dff6f50be761d2e44f194", + "sha256:a72f89aea712c619b2ca32c6f4335c77125ede27530ad9705f4f349357833695", + "sha256:a78ba86d5a08207d1d1ad10b97aed6ea48b374b3f6831d02d0b06545ac0f181e", + "sha256:a961ee6f2cdd1a2be4735333ab284691180d40bad48f97bb598841bfcbfb94ec", + "sha256:ab1546fc8e00676febc81c548a876c7bde32f881b8334b77f84719ab2c7d28dc", + "sha256:ab2d6523575fc98896c80f49ac99e849c0b0e69cc80bf864eed6af2ae728a52b", + "sha256:aff048793d05e1ce05b62e49dccf81fe52719a13f4861530706619506224992b", + "sha256:b1a012677b8e0a39e181e218de47d6741c5922202e3b0b65e412e2ce47c39337", + "sha256:b667e2a03407d79a76c618dc30cedebd48f082d85880d0c9c4ec2faa3e10f43e", + "sha256:b91557ee0893da52794b25660d4f57bb519bcad8b7df301acd3898f7197c5d81", + "sha256:badb51d851358cd7535b647bb67af4854b64f3c85f0d089c737f75504d5910ec", + "sha256:c36074b26f3263879ba8e4dbd33db2b79874a3392f403a70b772701363148b9f", + "sha256:c4916070e12ae140110aa598031876c1bf8676a36a750716ea0aa5bd694aa2e7", + "sha256:c6769d71bfb1ed60321363a9bc05e94dcf05e38295ef41d46ac08919e5b00d19", + "sha256:c887019dbcb4af58a091a45ccf376fffe800b5531b45c1efccda4bedf87747ea", + "sha256:cd9716ef0224fe0d0336997eb242f40619f9f8c5c57e66b525a1ebf9f1d8cebe", + "sha256:ceacea31f8a55cdba02bc72c93eb2e1b77160e91f8abd605969c168502fd71eb", + "sha256:d088ca05381fd409793571d8e34eca06daf41c8c50a05aeed358d2d340c7af81", + "sha256:d3a79200a9d5e621c4623081ddb25380b713c8cf5233cd11c1aabad990bb9381", + "sha256:d82404a0e7b10e0d7f022cf44031b78af8a4f99bd01561ac68f7c24772fed021", + "sha256:d95ae4420669c871667aad92ba8cce6251d61d79c1a38504621094143f94a8b4", + "sha256:da57af0c54a302b7c655fa1ccd5b1817a53739afa39924ef1816e7b7c8a07ccb", + "sha256:ddb9b9764cfb4459acf01c02d2a59d3e5066b06a846a364fd1749aa168efa2be", + "sha256:de23085cf90911600ace512e909114385026b16324fa203cc74c81f21fd3276a", + "sha256:e1f0f7b27171b2956a27bd8f899751d0866ddabdd05cbddf3520f945130a908c", + "sha256:e32148b4a745e70a255a1d44b5664de1f2e24fcefb98a75b60c83b9e260ddb5b", + "sha256:e45fdfcb2d5bcad83373e4808825b7512953146d147488114575780640665027", + "sha256:e56bb7e31c4bc79956b866163170bc89fd619e0581ce813330d4ea46921a4881", + "sha256:e860985f30f3a015979e63e7ba1a391526cdac1b22b7b332579df7867848e255", + "sha256:ee3587506898d4a404b33bd19689286ccf226c3d44d7a73670c8498cd688e42c", + "sha256:ee97c4e54f457c366e1f76fbbf3e8effee9de57dae671084a161c00f481106ce", + "sha256:ef9b484604af05ca745b6108ca1aaa22ae1919037ae4f93aaf9a37ba42e0b835", + "sha256:f21e8f2abed9a44afc3d15bba22e0dfc71e5fa859bea916e42354c16102b036f", + "sha256:f23a6c1d09de5de89a33c9e9b229106cb70dcfdd55e81a3a3580eaadaa32bc92", + "sha256:f5d5d5401744dda50b943d8764508d0e60cc2d3305ac1e6420935861a9d544bc", + "sha256:f78e2a78432c537ae876a93013b7bc0027ba5b93ad7b3463624c4b6906489332", + "sha256:f8179855a4e4f3b931cb1764ec87673d3fbdcca2af496c8d30567d7b034a13db", + "sha256:fc0e7f91705445d79beafba9bb3057dd50830e40fe5417017a76a214af54e122", + "sha256:fe285a697c851734285369614443451462ce78aac2b77db23567507484b1dc6f", + "sha256:fe3d79d6af839ffa46fdc5d2cf34295390894471e9875050eafa584cb781508d", + "sha256:fecd55e7418fabd297fd836e65cbd6371aa4035a264998a091bbf13f94d9c44d", + "sha256:ffef3d763e4c8fc97e740da5b4d0f080b78630a3914f4e772a122bbfa608c1db" ], - "version": "==3.10.5" + "version": "==3.10.8" }, "aiosignal": { "hashes": [ @@ -485,11 +485,11 @@ }, "astroid": { "hashes": [ - "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a", - "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25" + "sha256:5eba185467253501b62a9f113c263524b4f5d55e1b30456370eed4cdbd6438fd", + "sha256:e73d0b62dd680a7c07cb2cd0ce3c22570b044dd01bd994bc3a2dd16c6cbba162" ], - "markers": "python_full_version >= '3.8.0'", - "version": "==3.2.4" + "markers": "python_full_version >= '3.9.0'", + "version": "==3.3.4" }, "asttokens": { "hashes": [ @@ -539,11 +539,11 @@ }, "certifi": { "hashes": [ - "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b", - "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90" + "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8", + "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9" ], "markers": "python_version >= '3.6'", - "version": "==2024.7.4" + "version": "==2024.8.30" }, "charset-normalizer": { "hashes": [ @@ -750,11 +750,11 @@ }, "dill": { "hashes": [ - "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca", - "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7" + "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a", + "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c" ], "markers": "python_version >= '3.11'", - "version": "==0.3.8" + "version": "==0.3.9" }, "docopt": { "hashes": [ @@ -764,11 +764,11 @@ }, "executing": { "hashes": [ - "sha256:35afe2ce3affba8ee97f2d69927fa823b08b472b7b994e36a52a964b93d16147", - "sha256:eac49ca94516ccc753f9fb5ce82603156e590b27525a8bc32cce8ae302eb61bc" + "sha256:8d63781349375b5ebccc3142f4b30350c0cd9c79f921cde38be2be4637e98eaf", + "sha256:8ea27ddd260da8150fa5a708269c4a10e76161e2496ec3e587da9e3c0fe4b9ab" ], - "markers": "python_version >= '3.5'", - "version": "==2.0.1" + "markers": "python_version >= '3.8'", + "version": "==2.1.0" }, "flake8": { "hashes": [ @@ -872,11 +872,11 @@ }, "idna": { "hashes": [ - "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac", - "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603" + "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", + "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" ], "markers": "python_version >= '3.6'", - "version": "==3.8" + "version": "==3.10" }, "iniconfig": { "hashes": [ @@ -904,99 +904,101 @@ }, "multidict": { "hashes": [ - "sha256:01265f5e40f5a17f8241d52656ed27192be03bfa8764d88e8220141d1e4b3556", - "sha256:0275e35209c27a3f7951e1ce7aaf93ce0d163b28948444bec61dd7badc6d3f8c", - "sha256:04bde7a7b3de05732a4eb39c94574db1ec99abb56162d6c520ad26f83267de29", - "sha256:04da1bb8c8dbadf2a18a452639771951c662c5ad03aefe4884775454be322c9b", - "sha256:09a892e4a9fb47331da06948690ae38eaa2426de97b4ccbfafbdcbe5c8f37ff8", - "sha256:0d63c74e3d7ab26de115c49bffc92cc77ed23395303d496eae515d4204a625e7", - "sha256:107c0cdefe028703fb5dafe640a409cb146d44a6ae201e55b35a4af8e95457dd", - "sha256:141b43360bfd3bdd75f15ed811850763555a251e38b2405967f8e25fb43f7d40", - "sha256:14c2976aa9038c2629efa2c148022ed5eb4cb939e15ec7aace7ca932f48f9ba6", - "sha256:19fe01cea168585ba0f678cad6f58133db2aa14eccaf22f88e4a6dccadfad8b3", - "sha256:1d147090048129ce3c453f0292e7697d333db95e52616b3793922945804a433c", - "sha256:1d9ea7a7e779d7a3561aade7d596649fbecfa5c08a7674b11b423783217933f9", - "sha256:215ed703caf15f578dca76ee6f6b21b7603791ae090fbf1ef9d865571039ade5", - "sha256:21fd81c4ebdb4f214161be351eb5bcf385426bf023041da2fd9e60681f3cebae", - "sha256:220dd781e3f7af2c2c1053da9fa96d9cf3072ca58f057f4c5adaaa1cab8fc442", - "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9", - "sha256:29bfeb0dff5cb5fdab2023a7a9947b3b4af63e9c47cae2a10ad58394b517fddc", - "sha256:2f4848aa3baa109e6ab81fe2006c77ed4d3cd1e0ac2c1fbddb7b1277c168788c", - "sha256:2faa5ae9376faba05f630d7e5e6be05be22913782b927b19d12b8145968a85ea", - "sha256:2ffc42c922dbfddb4a4c3b438eb056828719f07608af27d163191cb3e3aa6cc5", - "sha256:37b15024f864916b4951adb95d3a80c9431299080341ab9544ed148091b53f50", - "sha256:3cc2ad10255f903656017363cd59436f2111443a76f996584d1077e43ee51182", - "sha256:3d25f19500588cbc47dc19081d78131c32637c25804df8414463ec908631e453", - "sha256:403c0911cd5d5791605808b942c88a8155c2592e05332d2bf78f18697a5fa15e", - "sha256:411bf8515f3be9813d06004cac41ccf7d1cd46dfe233705933dd163b60e37600", - "sha256:425bf820055005bfc8aa9a0b99ccb52cc2f4070153e34b701acc98d201693733", - "sha256:435a0984199d81ca178b9ae2c26ec3d49692d20ee29bc4c11a2a8d4514c67eda", - "sha256:4a6a4f196f08c58c59e0b8ef8ec441d12aee4125a7d4f4fef000ccb22f8d7241", - "sha256:4cc0ef8b962ac7a5e62b9e826bd0cd5040e7d401bc45a6835910ed699037a461", - "sha256:51d035609b86722963404f711db441cf7134f1889107fb171a970c9701f92e1e", - "sha256:53689bb4e102200a4fafa9de9c7c3c212ab40a7ab2c8e474491914d2305f187e", - "sha256:55205d03e8a598cfc688c71ca8ea5f66447164efff8869517f175ea632c7cb7b", - "sha256:5c0631926c4f58e9a5ccce555ad7747d9a9f8b10619621f22f9635f069f6233e", - "sha256:5cb241881eefd96b46f89b1a056187ea8e9ba14ab88ba632e68d7a2ecb7aadf7", - "sha256:60d698e8179a42ec85172d12f50b1668254628425a6bd611aba022257cac1386", - "sha256:612d1156111ae11d14afaf3a0669ebf6c170dbb735e510a7438ffe2369a847fd", - "sha256:6214c5a5571802c33f80e6c84713b2c79e024995b9c5897f794b43e714daeec9", - "sha256:6939c95381e003f54cd4c5516740faba40cf5ad3eeff460c3ad1d3e0ea2549bf", - "sha256:69db76c09796b313331bb7048229e3bee7928eb62bab5e071e9f7fcc4879caee", - "sha256:6bf7a982604375a8d49b6cc1b781c1747f243d91b81035a9b43a2126c04766f5", - "sha256:766c8f7511df26d9f11cd3a8be623e59cca73d44643abab3f8c8c07620524e4a", - "sha256:76c0de87358b192de7ea9649beb392f107dcad9ad27276324c24c91774ca5271", - "sha256:76f067f5121dcecf0d63a67f29080b26c43c71a98b10c701b0677e4a065fbd54", - "sha256:7901c05ead4b3fb75113fb1dd33eb1253c6d3ee37ce93305acd9d38e0b5f21a4", - "sha256:79660376075cfd4b2c80f295528aa6beb2058fd289f4c9252f986751a4cd0496", - "sha256:79a6d2ba910adb2cbafc95dad936f8b9386e77c84c35bc0add315b856d7c3abb", - "sha256:7afcdd1fc07befad18ec4523a782cde4e93e0a2bf71239894b8d61ee578c1319", - "sha256:7be7047bd08accdb7487737631d25735c9a04327911de89ff1b26b81745bd4e3", - "sha256:7c6390cf87ff6234643428991b7359b5f59cc15155695deb4eda5c777d2b880f", - "sha256:7df704ca8cf4a073334e0427ae2345323613e4df18cc224f647f251e5e75a527", - "sha256:85f67aed7bb647f93e7520633d8f51d3cbc6ab96957c71272b286b2f30dc70ed", - "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604", - "sha256:92d16a3e275e38293623ebf639c471d3e03bb20b8ebb845237e0d3664914caef", - "sha256:99f60d34c048c5c2fabc766108c103612344c46e35d4ed9ae0673d33c8fb26e8", - "sha256:9fe7b0653ba3d9d65cbe7698cca585bf0f8c83dbbcc710db9c90f478e175f2d5", - "sha256:a3145cb08d8625b2d3fee1b2d596a8766352979c9bffe5d7833e0503d0f0b5e5", - "sha256:aeaf541ddbad8311a87dd695ed9642401131ea39ad7bc8cf3ef3967fd093b626", - "sha256:b55358304d7a73d7bdf5de62494aaf70bd33015831ffd98bc498b433dfe5b10c", - "sha256:b82cc8ace10ab5bd93235dfaab2021c70637005e1ac787031f4d1da63d493c1d", - "sha256:c0868d64af83169e4d4152ec612637a543f7a336e4a307b119e98042e852ad9c", - "sha256:c1c1496e73051918fcd4f58ff2e0f2f3066d1c76a0c6aeffd9b45d53243702cc", - "sha256:c9bf56195c6bbd293340ea82eafd0071cb3d450c703d2c93afb89f93b8386ccc", - "sha256:cbebcd5bcaf1eaf302617c114aa67569dd3f090dd0ce8ba9e35e9985b41ac35b", - "sha256:cd6c8fca38178e12c00418de737aef1261576bd1b6e8c6134d3e729a4e858b38", - "sha256:ceb3b7e6a0135e092de86110c5a74e46bda4bd4fbfeeb3a3bcec79c0f861e450", - "sha256:cf590b134eb70629e350691ecca88eac3e3b8b3c86992042fb82e3cb1830d5e1", - "sha256:d3eb1ceec286eba8220c26f3b0096cf189aea7057b6e7b7a2e60ed36b373b77f", - "sha256:d65f25da8e248202bd47445cec78e0025c0fe7582b23ec69c3b27a640dd7a8e3", - "sha256:d6f6d4f185481c9669b9447bf9d9cf3b95a0e9df9d169bbc17e363b7d5487755", - "sha256:d84a5c3a5f7ce6db1f999fb9438f686bc2e09d38143f2d93d8406ed2dd6b9226", - "sha256:d946b0a9eb8aaa590df1fe082cee553ceab173e6cb5b03239716338629c50c7a", - "sha256:dce1c6912ab9ff5f179eaf6efe7365c1f425ed690b03341911bf4939ef2f3046", - "sha256:de170c7b4fe6859beb8926e84f7d7d6c693dfe8e27372ce3b76f01c46e489fcf", - "sha256:e02021f87a5b6932fa6ce916ca004c4d441509d33bbdbeca70d05dff5e9d2479", - "sha256:e030047e85cbcedbfc073f71836d62dd5dadfbe7531cae27789ff66bc551bd5e", - "sha256:e0e79d91e71b9867c73323a3444724d496c037e578a0e1755ae159ba14f4f3d1", - "sha256:e4428b29611e989719874670fd152b6625500ad6c686d464e99f5aaeeaca175a", - "sha256:e4972624066095e52b569e02b5ca97dbd7a7ddd4294bf4e7247d52635630dd83", - "sha256:e7be68734bd8c9a513f2b0cfd508802d6609da068f40dc57d4e3494cefc92929", - "sha256:e8e94e6912639a02ce173341ff62cc1201232ab86b8a8fcc05572741a5dc7d93", - "sha256:ea1456df2a27c73ce51120fa2f519f1bea2f4a03a917f4a43c8707cf4cbbae1a", - "sha256:ebd8d160f91a764652d3e51ce0d2956b38efe37c9231cd82cfc0bed2e40b581c", - "sha256:eca2e9d0cc5a889850e9bbd68e98314ada174ff6ccd1129500103df7a94a7a44", - "sha256:edd08e6f2f1a390bf137080507e44ccc086353c8e98c657e666c017718561b89", - "sha256:f285e862d2f153a70586579c15c44656f888806ed0e5b56b64489afe4a2dbfba", - "sha256:f2a1dee728b52b33eebff5072817176c172050d44d67befd681609b4746e1c2e", - "sha256:f7e301075edaf50500f0b341543c41194d8df3ae5caf4702f2095f3ca73dd8da", - "sha256:fb616be3538599e797a2017cccca78e354c767165e8858ab5116813146041a24", - "sha256:fce28b3c8a81b6b36dfac9feb1de115bab619b3c13905b419ec71d03a3fc1423", - "sha256:fe5d7785250541f7f5019ab9cba2c71169dc7d74d0f45253f8313f436458a4ef" + "sha256:052e10d2d37810b99cc170b785945421141bf7bb7d2f8799d431e7db229c385f", + "sha256:06809f4f0f7ab7ea2cabf9caca7d79c22c0758b58a71f9d32943ae13c7ace056", + "sha256:071120490b47aa997cca00666923a83f02c7fbb44f71cf7f136df753f7fa8761", + "sha256:0c3f390dc53279cbc8ba976e5f8035eab997829066756d811616b652b00a23a3", + "sha256:0e2b90b43e696f25c62656389d32236e049568b39320e2735d51f08fd362761b", + "sha256:0e5f362e895bc5b9e67fe6e4ded2492d8124bdf817827f33c5b46c2fe3ffaca6", + "sha256:10524ebd769727ac77ef2278390fb0068d83f3acb7773792a5080f2b0abf7748", + "sha256:10a9b09aba0c5b48c53761b7c720aaaf7cf236d5fe394cd399c7ba662d5f9966", + "sha256:16e5f4bf4e603eb1fdd5d8180f1a25f30056f22e55ce51fb3d6ad4ab29f7d96f", + "sha256:188215fc0aafb8e03341995e7c4797860181562380f81ed0a87ff455b70bf1f1", + "sha256:189f652a87e876098bbc67b4da1049afb5f5dfbaa310dd67c594b01c10388db6", + "sha256:1ca0083e80e791cffc6efce7660ad24af66c8d4079d2a750b29001b53ff59ada", + "sha256:1e16bf3e5fc9f44632affb159d30a437bfe286ce9e02754759be5536b169b305", + "sha256:2090f6a85cafc5b2db085124d752757c9d251548cedabe9bd31afe6363e0aff2", + "sha256:20b9b5fbe0b88d0bdef2012ef7dee867f874b72528cf1d08f1d59b0e3850129d", + "sha256:22ae2ebf9b0c69d206c003e2f6a914ea33f0a932d4aa16f236afc049d9958f4a", + "sha256:22f3105d4fb15c8f57ff3959a58fcab6ce36814486500cd7485651230ad4d4ef", + "sha256:23bfd518810af7de1116313ebd9092cb9aa629beb12f6ed631ad53356ed6b86c", + "sha256:27e5fc84ccef8dfaabb09d82b7d179c7cf1a3fbc8a966f8274fcb4ab2eb4cadb", + "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60", + "sha256:3702ea6872c5a2a4eeefa6ffd36b042e9773f05b1f37ae3ef7264b1163c2dcf6", + "sha256:37bb93b2178e02b7b618893990941900fd25b6b9ac0fa49931a40aecdf083fe4", + "sha256:3914f5aaa0f36d5d60e8ece6a308ee1c9784cd75ec8151062614657a114c4478", + "sha256:3a37ffb35399029b45c6cc33640a92bef403c9fd388acce75cdc88f58bd19a81", + "sha256:3c8b88a2ccf5493b6c8da9076fb151ba106960a2df90c2633f342f120751a9e7", + "sha256:3e97b5e938051226dc025ec80980c285b053ffb1e25a3db2a3aa3bc046bf7f56", + "sha256:3ec660d19bbc671e3a6443325f07263be452c453ac9e512f5eb935e7d4ac28b3", + "sha256:3efe2c2cb5763f2f1b275ad2bf7a287d3f7ebbef35648a9726e3b69284a4f3d6", + "sha256:483a6aea59cb89904e1ceabd2b47368b5600fb7de78a6e4a2c2987b2d256cf30", + "sha256:4867cafcbc6585e4b678876c489b9273b13e9fff9f6d6d66add5e15d11d926cb", + "sha256:48e171e52d1c4d33888e529b999e5900356b9ae588c2f09a52dcefb158b27506", + "sha256:4a9cb68166a34117d6646c0023c7b759bf197bee5ad4272f420a0141d7eb03a0", + "sha256:4b820514bfc0b98a30e3d85462084779900347e4d49267f747ff54060cc33925", + "sha256:4e18b656c5e844539d506a0a06432274d7bd52a7487e6828c63a63d69185626c", + "sha256:4e9f48f58c2c523d5a06faea47866cd35b32655c46b443f163d08c6d0ddb17d6", + "sha256:50b3a2710631848991d0bf7de077502e8994c804bb805aeb2925a981de58ec2e", + "sha256:55b6d90641869892caa9ca42ff913f7ff1c5ece06474fbd32fb2cf6834726c95", + "sha256:57feec87371dbb3520da6192213c7d6fc892d5589a93db548331954de8248fd2", + "sha256:58130ecf8f7b8112cdb841486404f1282b9c86ccb30d3519faf301b2e5659133", + "sha256:5845c1fd4866bb5dd3125d89b90e57ed3138241540897de748cdf19de8a2fca2", + "sha256:59bfeae4b25ec05b34f1956eaa1cb38032282cd4dfabc5056d0a1ec4d696d3aa", + "sha256:5b48204e8d955c47c55b72779802b219a39acc3ee3d0116d5080c388970b76e3", + "sha256:5c09fcfdccdd0b57867577b719c69e347a436b86cd83747f179dbf0cc0d4c1f3", + "sha256:6180c0ae073bddeb5a97a38c03f30c233e0a4d39cd86166251617d1bbd0af436", + "sha256:682b987361e5fd7a139ed565e30d81fd81e9629acc7d925a205366877d8c8657", + "sha256:6b5d83030255983181005e6cfbac1617ce9746b219bc2aad52201ad121226581", + "sha256:6bb5992037f7a9eff7991ebe4273ea7f51f1c1c511e6a2ce511d0e7bdb754492", + "sha256:73eae06aa53af2ea5270cc066dcaf02cc60d2994bbb2c4ef5764949257d10f43", + "sha256:76f364861c3bfc98cbbcbd402d83454ed9e01a5224bb3a28bf70002a230f73e2", + "sha256:820c661588bd01a0aa62a1283f20d2be4281b086f80dad9e955e690c75fb54a2", + "sha256:82176036e65644a6cc5bd619f65f6f19781e8ec2e5330f51aa9ada7504cc1926", + "sha256:87701f25a2352e5bf7454caa64757642734da9f6b11384c1f9d1a8e699758057", + "sha256:9079dfc6a70abe341f521f78405b8949f96db48da98aeb43f9907f342f627cdc", + "sha256:90f8717cb649eea3504091e640a1b8568faad18bd4b9fcd692853a04475a4b80", + "sha256:957cf8e4b6e123a9eea554fa7ebc85674674b713551de587eb318a2df3e00255", + "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1", + "sha256:9f636b730f7e8cb19feb87094949ba54ee5357440b9658b2a32a5ce4bce53972", + "sha256:a114d03b938376557927ab23f1e950827c3b893ccb94b62fd95d430fd0e5cf53", + "sha256:a185f876e69897a6f3325c3f19f26a297fa058c5e456bfcff8015e9a27e83ae1", + "sha256:a7a9541cd308eed5e30318430a9c74d2132e9a8cb46b901326272d780bf2d423", + "sha256:aa466da5b15ccea564bdab9c89175c762bc12825f4659c11227f515cee76fa4a", + "sha256:aaed8b0562be4a0876ee3b6946f6869b7bcdb571a5d1496683505944e268b160", + "sha256:ab7c4ceb38d91570a650dba194e1ca87c2b543488fe9309b4212694174fd539c", + "sha256:ac10f4c2b9e770c4e393876e35a7046879d195cd123b4f116d299d442b335bcd", + "sha256:b04772ed465fa3cc947db808fa306d79b43e896beb677a56fb2347ca1a49c1fa", + "sha256:b1c416351ee6271b2f49b56ad7f308072f6f44b37118d69c2cad94f3fa8a40d5", + "sha256:b225d95519a5bf73860323e633a664b0d85ad3d5bede6d30d95b35d4dfe8805b", + "sha256:b2f59caeaf7632cc633b5cf6fc449372b83bbdf0da4ae04d5be36118e46cc0aa", + "sha256:b58c621844d55e71c1b7f7c498ce5aa6985d743a1a59034c57a905b3f153c1ef", + "sha256:bf6bea52ec97e95560af5ae576bdac3aa3aae0b6758c6efa115236d9e07dae44", + "sha256:c08be4f460903e5a9d0f76818db3250f12e9c344e79314d1d570fc69d7f4eae4", + "sha256:c7053d3b0353a8b9de430a4f4b4268ac9a4fb3481af37dfe49825bf45ca24156", + "sha256:c943a53e9186688b45b323602298ab727d8865d8c9ee0b17f8d62d14b56f0753", + "sha256:ce2186a7df133a9c895dea3331ddc5ddad42cdd0d1ea2f0a51e5d161e4762f28", + "sha256:d093be959277cb7dee84b801eb1af388b6ad3ca6a6b6bf1ed7585895789d027d", + "sha256:d094ddec350a2fb899fec68d8353c78233debde9b7d8b4beeafa70825f1c281a", + "sha256:d1a9dd711d0877a1ece3d2e4fea11a8e75741ca21954c919406b44e7cf971304", + "sha256:d569388c381b24671589335a3be6e1d45546c2988c2ebe30fdcada8457a31008", + "sha256:d618649d4e70ac6efcbba75be98b26ef5078faad23592f9b51ca492953012429", + "sha256:d83a047959d38a7ff552ff94be767b7fd79b831ad1cd9920662db05fec24fe72", + "sha256:d8fff389528cad1618fb4b26b95550327495462cd745d879a8c7c2115248e399", + "sha256:da1758c76f50c39a2efd5e9859ce7d776317eb1dd34317c8152ac9251fc574a3", + "sha256:db7457bac39421addd0c8449933ac32d8042aae84a14911a757ae6ca3eef1392", + "sha256:e27bbb6d14416713a8bd7aaa1313c0fc8d44ee48d74497a0ff4c3a1b6ccb5167", + "sha256:e617fb6b0b6953fffd762669610c1c4ffd05632c138d61ac7e14ad187870669c", + "sha256:e9aa71e15d9d9beaad2c6b9319edcdc0a49a43ef5c0a4c8265ca9ee7d6c67774", + "sha256:ec2abea24d98246b94913b76a125e855eb5c434f7c46546046372fe60f666351", + "sha256:f179dee3b863ab1c59580ff60f9d99f632f34ccb38bf67a33ec6b3ecadd0fd76", + "sha256:f4c035da3f544b1882bac24115f3e2e8760f10a0107614fc9839fd232200b875", + "sha256:f67f217af4b1ff66c68a87318012de788dd95fcfeb24cc889011f4e1c7454dfd", + "sha256:f90c822a402cb865e396a504f9fc8173ef34212a342d92e362ca498cad308e28", + "sha256:ff3827aef427c89a25cc96ded1759271a93603aba9fb977a6d264648ebf989db" ], - "markers": "python_version >= '3.7'", - "version": "==6.0.5" + "markers": "python_version >= '3.8'", + "version": "==6.1.0" }, "mypy": { "hashes": [ @@ -1058,11 +1060,11 @@ }, "platformdirs": { "hashes": [ - "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee", - "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3" + "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907", + "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb" ], "markers": "python_version >= '3.8'", - "version": "==4.2.2" + "version": "==4.3.6" }, "pluggy": { "hashes": [ @@ -1098,21 +1100,21 @@ }, "pylint": { "hashes": [ - "sha256:03c8e3baa1d9fb995b12c1dbe00aa6c4bcef210c2a2634374aedeb22fb4a8f8f", - "sha256:a5d01678349454806cff6d886fb072294f56a58c4761278c97fb557d708e1eb3" + "sha256:2f846a466dd023513240bc140ad2dd73bfc080a5d85a710afdb728c420a5a2b9", + "sha256:9f3dcc87b1203e612b78d91a896407787e708b3f189b5fa0b307712d49ff0c6e" ], "index": "pypi", - "markers": "python_full_version >= '3.8.0'", - "version": "==3.2.6" + "markers": "python_full_version >= '3.9.0'", + "version": "==3.3.1" }, "pytest": { "hashes": [ - "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5", - "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce" + "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181", + "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==8.3.2" + "version": "==8.3.3" }, "pytest-cov": { "hashes": [ @@ -1150,21 +1152,21 @@ }, "types-pyyaml": { "hashes": [ - "sha256:b8f76ddbd7f65440a8bda5526a9607e4c7a322dc2f8e1a8c405644f9a6f4b9af", - "sha256:deda34c5c655265fc517b546c902aa6eed2ef8d3e921e4765fe606fe2afe8d35" + "sha256:392b267f1c0fe6022952462bf5d6523f31e37f6cea49b14cee7ad634b6301570", + "sha256:d1405a86f9576682234ef83bcb4e6fff7c9305c8b1fbad5e0bcd4f7dbdc9c587" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==6.0.12.20240808" + "version": "==6.0.12.20240917" }, "types-requests": { "hashes": [ - "sha256:90c079ff05e549f6bf50e02e910210b98b8ff1ebdd18e19c873cd237737c1358", - "sha256:f754283e152c752e46e70942fa2a146b5bc70393522257bb85bd1ef7e019dcc3" + "sha256:2850e178db3919d9bf809e434eef65ba49d0e7e33ac92d588f4a5e295fffd405", + "sha256:59c2f673eb55f32a99b2894faf6020e1a9f4a402ad0f192bfee0b64469054310" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==2.32.0.20240712" + "version": "==2.32.0.20240914" }, "typing-extensions": { "hashes": [ @@ -1176,107 +1178,109 @@ }, "urllib3": { "hashes": [ - "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472", - "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168" + "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac", + "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9" ], "markers": "python_version >= '3.8'", - "version": "==2.2.2" + "version": "==2.2.3" }, "yarl": { "hashes": [ - "sha256:008d3e808d03ef28542372d01057fd09168419cdc8f848efe2804f894ae03e51", - "sha256:03caa9507d3d3c83bca08650678e25364e1843b484f19986a527630ca376ecce", - "sha256:07574b007ee20e5c375a8fe4a0789fad26db905f9813be0f9fef5a68080de559", - "sha256:09efe4615ada057ba2d30df871d2f668af661e971dfeedf0c159927d48bbeff0", - "sha256:0d2454f0aef65ea81037759be5ca9947539667eecebca092733b2eb43c965a81", - "sha256:0e9d124c191d5b881060a9e5060627694c3bdd1fe24c5eecc8d5d7d0eb6faabc", - "sha256:18580f672e44ce1238b82f7fb87d727c4a131f3a9d33a5e0e82b793362bf18b4", - "sha256:1f23e4fe1e8794f74b6027d7cf19dc25f8b63af1483d91d595d4a07eca1fb26c", - "sha256:206a55215e6d05dbc6c98ce598a59e6fbd0c493e2de4ea6cc2f4934d5a18d130", - "sha256:23d32a2594cb5d565d358a92e151315d1b2268bc10f4610d098f96b147370136", - "sha256:26a1dc6285e03f3cc9e839a2da83bcbf31dcb0d004c72d0730e755b33466c30e", - "sha256:29e0f83f37610f173eb7e7b5562dd71467993495e568e708d99e9d1944f561ec", - "sha256:2b134fd795e2322b7684155b7855cc99409d10b2e408056db2b93b51a52accc7", - "sha256:2d47552b6e52c3319fede1b60b3de120fe83bde9b7bddad11a69fb0af7db32f1", - "sha256:357495293086c5b6d34ca9616a43d329317feab7917518bc97a08f9e55648455", - "sha256:35a2b9396879ce32754bd457d31a51ff0a9d426fd9e0e3c33394bf4b9036b099", - "sha256:3777ce5536d17989c91696db1d459574e9a9bd37660ea7ee4d3344579bb6f129", - "sha256:3986b6f41ad22988e53d5778f91855dc0399b043fc8946d4f2e68af22ee9ff10", - "sha256:44d8ffbb9c06e5a7f529f38f53eda23e50d1ed33c6c869e01481d3fafa6b8142", - "sha256:49a180c2e0743d5d6e0b4d1a9e5f633c62eca3f8a86ba5dd3c471060e352ca98", - "sha256:4aa9741085f635934f3a2583e16fcf62ba835719a8b2b28fb2917bb0537c1dfa", - "sha256:4b21516d181cd77ebd06ce160ef8cc2a5e9ad35fb1c5930882baff5ac865eee7", - "sha256:4b3c1ffe10069f655ea2d731808e76e0f452fc6c749bea04781daf18e6039525", - "sha256:4c7d56b293cc071e82532f70adcbd8b61909eec973ae9d2d1f9b233f3d943f2c", - "sha256:4e9035df8d0880b2f1c7f5031f33f69e071dfe72ee9310cfc76f7b605958ceb9", - "sha256:54525ae423d7b7a8ee81ba189f131054defdb122cde31ff17477951464c1691c", - "sha256:549d19c84c55d11687ddbd47eeb348a89df9cb30e1993f1b128f4685cd0ebbf8", - "sha256:54beabb809ffcacbd9d28ac57b0db46e42a6e341a030293fb3185c409e626b8b", - "sha256:566db86717cf8080b99b58b083b773a908ae40f06681e87e589a976faf8246bf", - "sha256:5a2e2433eb9344a163aced6a5f6c9222c0786e5a9e9cac2c89f0b28433f56e23", - "sha256:5aef935237d60a51a62b86249839b51345f47564208c6ee615ed2a40878dccdd", - "sha256:604f31d97fa493083ea21bd9b92c419012531c4e17ea6da0f65cacdcf5d0bd27", - "sha256:63b20738b5aac74e239622d2fe30df4fca4942a86e31bf47a81a0e94c14df94f", - "sha256:686a0c2f85f83463272ddffd4deb5e591c98aac1897d65e92319f729c320eece", - "sha256:6a962e04b8f91f8c4e5917e518d17958e3bdee71fd1d8b88cdce74dd0ebbf434", - "sha256:6ad6d10ed9b67a382b45f29ea028f92d25bc0bc1daf6c5b801b90b5aa70fb9ec", - "sha256:6f5cb257bc2ec58f437da2b37a8cd48f666db96d47b8a3115c29f316313654ff", - "sha256:6fe79f998a4052d79e1c30eeb7d6c1c1056ad33300f682465e1b4e9b5a188b78", - "sha256:7855426dfbddac81896b6e533ebefc0af2f132d4a47340cee6d22cac7190022d", - "sha256:7d5aaac37d19b2904bb9dfe12cdb08c8443e7ba7d2852894ad448d4b8f442863", - "sha256:801e9264d19643548651b9db361ce3287176671fb0117f96b5ac0ee1c3530d53", - "sha256:81eb57278deb6098a5b62e88ad8281b2ba09f2f1147c4767522353eaa6260b31", - "sha256:824d6c50492add5da9374875ce72db7a0733b29c2394890aef23d533106e2b15", - "sha256:8397a3817d7dcdd14bb266283cd1d6fc7264a48c186b986f32e86d86d35fbac5", - "sha256:848cd2a1df56ddbffeb375535fb62c9d1645dde33ca4d51341378b3f5954429b", - "sha256:84fc30f71689d7fc9168b92788abc977dc8cefa806909565fc2951d02f6b7d57", - "sha256:8619d6915b3b0b34420cf9b2bb6d81ef59d984cb0fde7544e9ece32b4b3043c3", - "sha256:8a854227cf581330ffa2c4824d96e52ee621dd571078a252c25e3a3b3d94a1b1", - "sha256:8be9e837ea9113676e5754b43b940b50cce76d9ed7d2461df1af39a8ee674d9f", - "sha256:928cecb0ef9d5a7946eb6ff58417ad2fe9375762382f1bf5c55e61645f2c43ad", - "sha256:957b4774373cf6f709359e5c8c4a0af9f6d7875db657adb0feaf8d6cb3c3964c", - "sha256:992f18e0ea248ee03b5a6e8b3b4738850ae7dbb172cc41c966462801cbf62cf7", - "sha256:9fc5fc1eeb029757349ad26bbc5880557389a03fa6ada41703db5e068881e5f2", - "sha256:a00862fb23195b6b8322f7d781b0dc1d82cb3bcac346d1e38689370cc1cc398b", - "sha256:a3a6ed1d525bfb91b3fc9b690c5a21bb52de28c018530ad85093cc488bee2dd2", - "sha256:a6327976c7c2f4ee6816eff196e25385ccc02cb81427952414a64811037bbc8b", - "sha256:a7409f968456111140c1c95301cadf071bd30a81cbd7ab829169fb9e3d72eae9", - "sha256:a825ec844298c791fd28ed14ed1bffc56a98d15b8c58a20e0e08c1f5f2bea1be", - "sha256:a8c1df72eb746f4136fe9a2e72b0c9dc1da1cbd23b5372f94b5820ff8ae30e0e", - "sha256:a9bd00dc3bc395a662900f33f74feb3e757429e545d831eef5bb280252631984", - "sha256:aa102d6d280a5455ad6a0f9e6d769989638718e938a6a0a2ff3f4a7ff8c62cc4", - "sha256:aaaea1e536f98754a6e5c56091baa1b6ce2f2700cc4a00b0d49eca8dea471074", - "sha256:ad4d7a90a92e528aadf4965d685c17dacff3df282db1121136c382dc0b6014d2", - "sha256:b8477c1ee4bd47c57d49621a062121c3023609f7a13b8a46953eb6c9716ca392", - "sha256:ba6f52cbc7809cd8d74604cce9c14868306ae4aa0282016b641c661f981a6e91", - "sha256:bac8d525a8dbc2a1507ec731d2867025d11ceadcb4dd421423a5d42c56818541", - "sha256:bef596fdaa8f26e3d66af846bbe77057237cb6e8efff8cd7cc8dff9a62278bbf", - "sha256:c0ec0ed476f77db9fb29bca17f0a8fcc7bc97ad4c6c1d8959c507decb22e8572", - "sha256:c38c9ddb6103ceae4e4498f9c08fac9b590c5c71b0370f98714768e22ac6fa66", - "sha256:c7224cab95645c7ab53791022ae77a4509472613e839dab722a72abe5a684575", - "sha256:c74018551e31269d56fab81a728f683667e7c28c04e807ba08f8c9e3bba32f14", - "sha256:ca06675212f94e7a610e85ca36948bb8fc023e458dd6c63ef71abfd482481aa5", - "sha256:d1d2532b340b692880261c15aee4dc94dd22ca5d61b9db9a8a361953d36410b1", - "sha256:d25039a474c4c72a5ad4b52495056f843a7ff07b632c1b92ea9043a3d9950f6e", - "sha256:d5ff2c858f5f6a42c2a8e751100f237c5e869cbde669a724f2062d4c4ef93551", - "sha256:d7d7f7de27b8944f1fee2c26a88b4dabc2409d2fea7a9ed3df79b67277644e17", - "sha256:d7eeb6d22331e2fd42fce928a81c697c9ee2d51400bd1a28803965883e13cead", - "sha256:d8a1c6c0be645c745a081c192e747c5de06e944a0d21245f4cf7c05e457c36e0", - "sha256:d8b889777de69897406c9fb0b76cdf2fd0f31267861ae7501d93003d55f54fbe", - "sha256:d9e09c9d74f4566e905a0b8fa668c58109f7624db96a2171f21747abc7524234", - "sha256:db8e58b9d79200c76956cefd14d5c90af54416ff5353c5bfd7cbe58818e26ef0", - "sha256:ddb2a5c08a4eaaba605340fdee8fc08e406c56617566d9643ad8bf6852778fc7", - "sha256:e0381b4ce23ff92f8170080c97678040fc5b08da85e9e292292aba67fdac6c34", - "sha256:e23a6d84d9d1738dbc6e38167776107e63307dfc8ad108e580548d1f2c587f42", - "sha256:e516dc8baf7b380e6c1c26792610230f37147bb754d6426462ab115a02944385", - "sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78", - "sha256:ec61d826d80fc293ed46c9dd26995921e3a82146feacd952ef0757236fc137be", - "sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958", - "sha256:f3bc6af6e2b8f92eced34ef6a96ffb248e863af20ef4fde9448cc8c9b858b749", - "sha256:f7d6b36dd2e029b6bcb8a13cf19664c7b8e19ab3a58e0fefbb5b8461447ed5ec" + "sha256:08d7148ff11cb8e886d86dadbfd2e466a76d5dd38c7ea8ebd9b0e07946e76e4b", + "sha256:098b870c18f1341786f290b4d699504e18f1cd050ed179af8123fd8232513424", + "sha256:11b3ca8b42a024513adce810385fcabdd682772411d95bbbda3b9ed1a4257644", + "sha256:1891d69a6ba16e89473909665cd355d783a8a31bc84720902c5911dbb6373465", + "sha256:1bbb418f46c7f7355084833051701b2301092e4611d9e392360c3ba2e3e69f88", + "sha256:1d0828e17fa701b557c6eaed5edbd9098eb62d8838344486248489ff233998b8", + "sha256:1d8e3ca29f643dd121f264a7c89f329f0fcb2e4461833f02de6e39fef80f89da", + "sha256:1fa56f34b2236f5192cb5fceba7bbb09620e5337e0b6dfe2ea0ddbd19dd5b154", + "sha256:216a6785f296169ed52cd7dcdc2612f82c20f8c9634bf7446327f50398732a51", + "sha256:22b739f99c7e4787922903f27a892744189482125cc7b95b747f04dd5c83aa9f", + "sha256:2430cf996113abe5aee387d39ee19529327205cda975d2b82c0e7e96e5fdabdc", + "sha256:269c201bbc01d2cbba5b86997a1e0f73ba5e2f471cfa6e226bcaa7fd664b598d", + "sha256:298c1eecfd3257aa16c0cb0bdffb54411e3e831351cd69e6b0739be16b1bdaa8", + "sha256:2a93a4557f7fc74a38ca5a404abb443a242217b91cd0c4840b1ebedaad8919d4", + "sha256:2b2442a415a5f4c55ced0fade7b72123210d579f7d950e0b5527fc598866e62c", + "sha256:2db874dd1d22d4c2c657807562411ffdfabec38ce4c5ce48b4c654be552759dc", + "sha256:309c104ecf67626c033845b860d31594a41343766a46fa58c3309c538a1e22b2", + "sha256:31497aefd68036d8e31bfbacef915826ca2e741dbb97a8d6c7eac66deda3b606", + "sha256:373f16f38721c680316a6a00ae21cc178e3a8ef43c0227f88356a24c5193abd6", + "sha256:396e59b8de7e4d59ff5507fb4322d2329865b909f29a7ed7ca37e63ade7f835c", + "sha256:3bb83a0f12701c0b91112a11148b5217617982e1e466069d0555be9b372f2734", + "sha256:3de86547c820e4f4da4606d1c8ab5765dd633189791f15247706a2eeabc783ae", + "sha256:3fdbf0418489525231723cdb6c79e7738b3cbacbaed2b750cb033e4ea208f220", + "sha256:40c6e73c03a6befb85b72da213638b8aaa80fe4136ec8691560cf98b11b8ae6e", + "sha256:44a4c40a6f84e4d5955b63462a0e2a988f8982fba245cf885ce3be7618f6aa7d", + "sha256:44b07e1690f010c3c01d353b5790ec73b2f59b4eae5b0000593199766b3f7a5c", + "sha256:45d23c4668d4925688e2ea251b53f36a498e9ea860913ce43b52d9605d3d8177", + "sha256:45f209fb4bbfe8630e3d2e2052535ca5b53d4ce2d2026bed4d0637b0416830da", + "sha256:4afdf84610ca44dcffe8b6c22c68f309aff96be55f5ea2fa31c0c225d6b83e23", + "sha256:4feaaa4742517eaceafcbe74595ed335a494c84634d33961214b278126ec1485", + "sha256:576365c9f7469e1f6124d67b001639b77113cfd05e85ce0310f5f318fd02fe85", + "sha256:5820bd4178e6a639b3ef1db8b18500a82ceab6d8b89309e121a6859f56585b05", + "sha256:5989a38ba1281e43e4663931a53fbf356f78a0325251fd6af09dd03b1d676a09", + "sha256:5a9bacedbb99685a75ad033fd4de37129449e69808e50e08034034c0bf063f99", + "sha256:5b66c87da3c6da8f8e8b648878903ca54589038a0b1e08dde2c86d9cd92d4ac9", + "sha256:5c5e32fef09ce101fe14acd0f498232b5710effe13abac14cd95de9c274e689e", + "sha256:658e8449b84b92a4373f99305de042b6bd0d19bf2080c093881e0516557474a5", + "sha256:6a2acde25be0cf9be23a8f6cbd31734536a264723fca860af3ae5e89d771cd71", + "sha256:6a5185ad722ab4dd52d5fb1f30dcc73282eb1ed494906a92d1a228d3f89607b0", + "sha256:6b7f6e699304717fdc265a7e1922561b02a93ceffdaefdc877acaf9b9f3080b8", + "sha256:703b0f584fcf157ef87816a3c0ff868e8c9f3c370009a8b23b56255885528f10", + "sha256:7055bbade838d68af73aea13f8c86588e4bcc00c2235b4b6d6edb0dbd174e246", + "sha256:78f271722423b2d4851cf1f4fa1a1c4833a128d020062721ba35e1a87154a049", + "sha256:7addd26594e588503bdef03908fc207206adac5bd90b6d4bc3e3cf33a829f57d", + "sha256:81bad32c8f8b5897c909bf3468bf601f1b855d12f53b6af0271963ee67fff0d2", + "sha256:82e692fb325013a18a5b73a4fed5a1edaa7c58144dc67ad9ef3d604eccd451ad", + "sha256:84bbcdcf393139f0abc9f642bf03f00cac31010f3034faa03224a9ef0bb74323", + "sha256:86c438ce920e089c8c2388c7dcc8ab30dfe13c09b8af3d306bcabb46a053d6f7", + "sha256:8be8cdfe20787e6a5fcbd010f8066227e2bb9058331a4eccddec6c0db2bb85b2", + "sha256:8c723c91c94a3bc8033dd2696a0f53e5d5f8496186013167bddc3fb5d9df46a3", + "sha256:8ca53632007c69ddcdefe1e8cbc3920dd88825e618153795b57e6ebcc92e752a", + "sha256:8f722f30366474a99745533cc4015b1781ee54b08de73260b2bbe13316079851", + "sha256:942c80a832a79c3707cca46bd12ab8aa58fddb34b1626d42b05aa8f0bcefc206", + "sha256:94a993f976cdcb2dc1b855d8b89b792893220db8862d1a619efa7451817c836b", + "sha256:95c6737f28069153c399d875317f226bbdea939fd48a6349a3b03da6829fb550", + "sha256:9915300fe5a0aa663c01363db37e4ae8e7c15996ebe2c6cce995e7033ff6457f", + "sha256:9a18595e6a2ee0826bf7dfdee823b6ab55c9b70e8f80f8b77c37e694288f5de1", + "sha256:9c8854b9f80693d20cec797d8e48a848c2fb273eb6f2587b57763ccba3f3bd4b", + "sha256:9cec42a20eae8bebf81e9ce23fb0d0c729fc54cf00643eb251ce7c0215ad49fe", + "sha256:9d2e1626be8712333a9f71270366f4a132f476ffbe83b689dd6dc0d114796c74", + "sha256:9d74f3c335cfe9c21ea78988e67f18eb9822f5d31f88b41aec3a1ec5ecd32da5", + "sha256:9fb4134cc6e005b99fa29dbc86f1ea0a298440ab6b07c6b3ee09232a3b48f495", + "sha256:a0ae6637b173d0c40b9c1462e12a7a2000a71a3258fa88756a34c7d38926911c", + "sha256:a31d21089894942f7d9a8df166b495101b7258ff11ae0abec58e32daf8088813", + "sha256:a3442c31c11088e462d44a644a454d48110f0588de830921fd201060ff19612a", + "sha256:ab9524e45ee809a083338a749af3b53cc7efec458c3ad084361c1dbf7aaf82a2", + "sha256:b1481c048fe787f65e34cb06f7d6824376d5d99f1231eae4778bbe5c3831076d", + "sha256:b8c837ab90c455f3ea8e68bee143472ee87828bff19ba19776e16ff961425b57", + "sha256:bbf2c3f04ff50f16404ce70f822cdc59760e5e2d7965905f0e700270feb2bbfc", + "sha256:bbf9c2a589be7414ac4a534d54e4517d03f1cbb142c0041191b729c2fa23f320", + "sha256:bcd5bf4132e6a8d3eb54b8d56885f3d3a38ecd7ecae8426ecf7d9673b270de43", + "sha256:c14c16831b565707149c742d87a6203eb5597f4329278446d5c0ae7a1a43928e", + "sha256:c49f3e379177f4477f929097f7ed4b0622a586b0aa40c07ac8c0f8e40659a1ac", + "sha256:c92b89bffc660f1274779cb6fbb290ec1f90d6dfe14492523a0667f10170de26", + "sha256:cd66152561632ed4b2a9192e7f8e5a1d41e28f58120b4761622e0355f0fe034c", + "sha256:cf1ad338620249f8dd6d4b6a91a69d1f265387df3697ad5dc996305cf6c26fb2", + "sha256:d07b52c8c450f9366c34aa205754355e933922c79135125541daae6cbf31c799", + "sha256:d0d12fe78dcf60efa205e9a63f395b5d343e801cf31e5e1dda0d2c1fb618073d", + "sha256:d4ee1d240b84e2f213565f0ec08caef27a0e657d4c42859809155cf3a29d1735", + "sha256:d959fe96e5c2712c1876d69af0507d98f0b0e8d81bee14cfb3f6737470205419", + "sha256:dcaef817e13eafa547cdfdc5284fe77970b891f731266545aae08d6cce52161e", + "sha256:df4e82e68f43a07735ae70a2d84c0353e58e20add20ec0af611f32cd5ba43fb4", + "sha256:ec8cfe2295f3e5e44c51f57272afbd69414ae629ec7c6b27f5a410efc78b70a0", + "sha256:ec9dd328016d8d25702a24ee274932aebf6be9787ed1c28d021945d264235b3c", + "sha256:ef9b85fa1bc91c4db24407e7c4da93a5822a73dd4513d67b454ca7064e8dc6a3", + "sha256:f3bf60444269345d712838bb11cc4eadaf51ff1a364ae39ce87a5ca8ad3bb2c8", + "sha256:f452cc1436151387d3d50533523291d5f77c6bc7913c116eb985304abdbd9ec9", + "sha256:f7917697bcaa3bc3e83db91aa3a0e448bf5cde43c84b7fc1ae2427d2417c0224", + "sha256:f90575e9fe3aae2c1e686393a9689c724cd00045275407f71771ae5d690ccf38", + "sha256:fb382fd7b4377363cc9f13ba7c819c3c78ed97c36a82f16f3f92f108c787cbbf", + "sha256:fb9f59f3848edf186a76446eb8bcf4c900fe147cb756fbbd730ef43b2e67c6a7", + "sha256:fc2931ac9ce9c61c9968989ec831d3a5e6fcaaff9474e7cfa8de80b7aff5a093" ], - "markers": "python_version >= '3.7'", - "version": "==1.9.4" + "markers": "python_version >= '3.8'", + "version": "==1.13.1" } } } diff --git a/requirements-dev.txt b/requirements-dev.txt index c23e2deb..512672a0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,53 +1,53 @@ -i https://pypi.org/simple -aiohappyeyeballs==2.4.0; python_version >= '3.8' -aiohttp==3.10.5 +aiohappyeyeballs==2.4.3; python_version >= '3.8' +aiohttp==3.10.8 aiosignal==1.3.1; python_version >= '3.7' -astroid==3.2.4; python_full_version >= '3.8.0' +astroid==3.3.4; python_full_version >= '3.9.0' asttokens==2.4.1 attrs==24.2.0; python_version >= '3.7' black[d]==24.8.0; python_version >= '3.8' -certifi==2024.7.4; python_version >= '3.6' +certifi==2024.8.30; python_version >= '3.6' charset-normalizer==3.3.2; python_full_version >= '3.7.0' click==8.1.7; python_version >= '3.7' colorama==0.4.6; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' coverage[toml]==7.6.1; python_version >= '3.8' coveralls==4.0.1; python_version < '3.13' and python_version >= '3.8' -dill==0.3.8; python_version >= '3.11' +dill==0.3.9; python_version >= '3.11' docopt==0.6.2 -executing==2.0.1; python_version >= '3.5' +executing==2.1.0; python_version >= '3.8' flake8==7.1.1; python_full_version >= '3.8.1' frozenlist==1.4.1; python_version >= '3.8' icecream==2.1.3 -idna==3.8; python_version >= '3.6' +idna==3.10; python_version >= '3.6' iniconfig==2.0.0; python_version >= '3.7' isort==5.13.2; python_full_version >= '3.8.0' mccabe==0.7.0; python_version >= '3.6' -multidict==6.0.5; python_version >= '3.7' +multidict==6.1.0; python_version >= '3.8' mypy==1.11.2; python_version >= '3.8' mypy-extensions==1.0.0; python_version >= '3.5' packaging==24.1; python_version >= '3.8' pathspec==0.12.1; python_version >= '3.8' -platformdirs==4.2.2; python_version >= '3.8' +platformdirs==4.3.6; python_version >= '3.8' pluggy==1.5.0; python_version >= '3.8' pycodestyle==2.12.1; python_version >= '3.8' pyflakes==3.2.0; python_version >= '3.8' pygments==2.18.0; python_version >= '3.8' -pylint==3.2.6; python_full_version >= '3.8.0' -pytest==8.3.2; python_version >= '3.8' +pylint==3.3.1; python_full_version >= '3.9.0' +pytest==8.3.3; python_version >= '3.8' pytest-cov==5.0.0; python_version >= '3.8' requests==2.32.3; python_version >= '3.8' six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' tomlkit==0.13.2; python_version >= '3.8' -types-pyyaml==6.0.12.20240808; python_version >= '3.8' -types-requests==2.32.0.20240712; python_version >= '3.8' +types-pyyaml==6.0.12.20240917; python_version >= '3.8' +types-requests==2.32.0.20240914; python_version >= '3.8' typing-extensions==4.12.2; python_version < '3.13' -urllib3==2.2.2; python_version >= '3.8' -yarl==1.9.4; python_version >= '3.7' +urllib3==2.2.3; python_version >= '3.8' +yarl==1.13.1; python_version >= '3.8' annotated-types==0.7.0; python_version >= '3.8' cerberus==1.3.5 defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -pydantic==2.8.2; python_version >= '3.8' -pydantic-core==2.20.1; python_version >= '3.8' +pydantic==2.9.2; python_version >= '3.8' +pydantic-core==2.23.4; python_version >= '3.8' python-dotenv==1.0.1; python_version >= '3.8' pyyaml==6.0.2; python_version >= '3.8' xmltodict==0.13.0; python_version >= '3.4' diff --git a/requirements.txt b/requirements.txt index 539b07ea..d2fb427b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ annotated-types==0.7.0; python_version >= '3.8' cerberus==1.3.5 -certifi==2024.7.4; python_version >= '3.6' +certifi==2024.8.30; python_version >= '3.6' charset-normalizer==3.3.2; python_full_version >= '3.7.0' click==8.1.7; python_version >= '3.7' defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -idna==3.8; python_version >= '3.6' -pydantic==2.8.2; python_version >= '3.8' -pydantic-core==2.20.1; python_version >= '3.8' +idna==3.10; python_version >= '3.6' +pydantic==2.9.2; python_version >= '3.8' +pydantic-core==2.23.4; python_version >= '3.8' python-dotenv==1.0.1; python_version >= '3.8' pyyaml==6.0.2; python_version >= '3.8' requests==2.32.3; python_version >= '3.8' typing-extensions==4.12.2; python_version < '3.13' -urllib3==2.2.2; python_version >= '3.8' +urllib3==2.2.3; python_version >= '3.8' xmltodict==0.13.0; python_version >= '3.4' From eae1fd8dbfe4134dc6808f90bad43199e78a310a Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 09:38:32 +0600 Subject: [PATCH 56/70] feat: add duct converted value --- chk/modules/validate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 430b56e6..28394365 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -278,7 +278,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: validate_doc, { **variable_doc.data, - **{"_asserts_response": test_run_result}, + **{"_asserts_response": test_run_result.as_dict}, }, ) From be757b65ebe4cf47baa6932905b93c5d2d111043 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 09:38:59 +0600 Subject: [PATCH 57/70] feat: pass variables --- chk/modules/workflow/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 4ab77862..9debc668 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -4,12 +4,14 @@ from __future__ import annotations +import json import pathlib from collections import abc from collections.abc import Callable from pydantic import BaseModel, ConfigDict, Field +from chk.console.main import combine_initial_variables from chk.infrastructure.document import ( VersionedDocumentV2, ) @@ -131,12 +133,7 @@ def process_task_template( execution_ctx = ExecuteContext( {"dump": True, "format": True}, - { - # "variables": combine_initial_variables( - # variables, - # except_msg="-V, --variables accept values as JSON object", - # ), - }, + {"variables": combine_initial_variables(json.dumps(task_o_.variables))}, ) task_fn = None From f0dcd56166bb1ce8b509265dafc70cbecd00fdf4 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 09:39:26 +0600 Subject: [PATCH 58/70] feat: use exposed value for dumping --- chk/modules/workflow/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 9debc668..b63cc18e 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -165,9 +165,8 @@ def execute_task( ) -> ExecResponse: """execute_task""" - _task_res: ExecResponse = task_fn(**task_params.asdict()) - variables[WorkflowConfigNode.NODE.value].append(_task_res.variables_exec.data) _task_res: ExecResponse = task_fn(**task_params.as_dict()) + variables[WorkflowConfigNode.NODE.value].append(_task_res.exposed) return _task_res From a5c7196f34a48056c7082b409a4aa35f85a77372 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 09:39:46 +0600 Subject: [PATCH 59/70] refactor: remove unused func --- chk/modules/workflow/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index b63cc18e..32d1d28b 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -170,9 +170,6 @@ def execute_task( return _task_res - # @classmethod - # def prepare_step_results(cls, ) -> dict: - @classmethod def display( cls, From f63bdeba42bb8ac2331c080cd7b82ecd0bc4f535 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 09:40:42 +0600 Subject: [PATCH 60/70] refactor: remove output data in exposed data uses --- chk/modules/workflow/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chk/modules/workflow/__init__.py b/chk/modules/workflow/__init__.py index 32d1d28b..464747f4 100644 --- a/chk/modules/workflow/__init__.py +++ b/chk/modules/workflow/__init__.py @@ -197,11 +197,10 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: service.set_step_template(variable_doc) exec_report = service.process_task_template(wflow_doc, variable_doc) - # output_data = Variables() output_data = Variables({"_steps": variable_doc[WorkflowConfigNode.NODE.value]}) exposed_data: dict = ExposeManager.get_exposed_replaced_data_v2( - wflow_doc, {**variable_doc.data, **output_data.data} + wflow_doc, variable_doc.data ) # TODO also send failed_details (fail code, message, stacktrace, etc) From c6a7e9a2d88effa5ce8220da98c0dc77c2959fcc Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 10:07:42 +0600 Subject: [PATCH 61/70] feat: finalize formatted and json dump for wf --- chk/modules/workflow/services.py | 35 ++++++++------------------------ 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index 96e84032..6185fdba 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -97,25 +97,15 @@ def dump_fmt(self) -> str: """return formatted string representation""" exposed_fmt_str = [] - for key, value in self.data.exposed.items(): - _t_key = str(key).replace("%>", "").replace("<%", "").strip() - _t_marker = str(WorkflowConfigNode.NODE) - _str_to_append = "" + node = str(WorkflowConfigNode.NODE) - if _t_marker in _t_key and len(_t_key) == len(_t_marker): - _str_to_append = self._prepare_dump_str_for_steps() + if node in key and len(key) == len(node): + to_append = self._prepare_dump_str_for_steps() else: - _value = [] - - for item in value: - if hasattr(item, "as_dict"): - _value.append(item.as_dict) - else: - _value.append(item) + to_append = json.dumps(value) - _str_to_append = json.dumps(_value) - exposed_fmt_str.append(_str_to_append) + exposed_fmt_str.append(to_append) return "\n======\n".join(exposed_fmt_str) @@ -149,22 +139,13 @@ def dump_json(self) -> str: exposed_fmt_str = [] for key, value in self.data.exposed.items(): - _t_key = str(key).replace("%>", "").replace("<%", "").strip() - _t_marker = str(WorkflowConfigNode.NODE) + node = str(WorkflowConfigNode.NODE) _to_append = {} - if _t_marker in _t_key and len(_t_key) == len(_t_marker): + if node in key and len(key) == len(node): _to_append = self._prepare_dump_data() else: - _value = [] - - for item in value: - if hasattr(item, "as_dict"): - _value.append(item.as_dict) - else: - _value.append(item) - - _to_append = Cast.try_dict(_value) + _to_append = value exposed_fmt_str.append(_to_append) From 5adddcc461c2d23cd6a3e75411c65e86dba9f3fe Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 10:26:03 +0600 Subject: [PATCH 62/70] fix: document type change in test --- tests/modules/validate/validate_entity_test.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/modules/validate/validate_entity_test.py b/tests/modules/validate/validate_entity_test.py index 3fa7cac6..2e706a22 100644 --- a/tests/modules/validate/validate_entity_test.py +++ b/tests/modules/validate/validate_entity_test.py @@ -117,8 +117,8 @@ def test_as_dict_pass(): doc = ValidationDocument.from_file_context(ctx) - assert isinstance(doc.as_dict, dict) - assert len(doc.as_dict) == 4 + assert isinstance(doc.model_dump(), dict) + assert len(doc.model_dump()) == 4 class TestValidationDocumentSupport: @@ -216,7 +216,10 @@ def test_set_data_template_pass_exec_ctx_prioritise(self): ValidationDocumentSupport.set_data_template(doc, variables, exec_ctx) assert bool(variables[ValidationConfigNode.VAR_NODE.value]) - assert variables[ValidationConfigNode.VAR_NODE.value].get("name") == "Some Name Two" + assert ( + variables[ValidationConfigNode.VAR_NODE.value].get("name") + == "Some Name Two" + ) @staticmethod def test_process_data_template_pass(): @@ -252,7 +255,10 @@ def test_process_data_template_pass(): ValidationDocumentSupport.process_data_template(variables) assert bool(variables[ValidationConfigNode.VAR_NODE.value]) - assert variables[ValidationConfigNode.VAR_NODE.value].get("greet") == "Hello Somebody" + assert ( + variables[ValidationConfigNode.VAR_NODE.value].get("greet") + == "Hello Somebody" + ) @staticmethod def test_make_assertion_entry_list_pass(): From 596817943df8443cfc387f8a1e64dcc194017016 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 12:54:22 +0600 Subject: [PATCH 63/70] fix: issues with object type change --- tests/modules/workflow/wf_domain_test.py | 27 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/tests/modules/workflow/wf_domain_test.py b/tests/modules/workflow/wf_domain_test.py index 5655c4a5..2f20eada 100644 --- a/tests/modules/workflow/wf_domain_test.py +++ b/tests/modules/workflow/wf_domain_test.py @@ -2,17 +2,23 @@ """ Domain test code """ -from icecream import ic +from pydantic import BaseModel, Field +from chk.infrastructure.symbol_table import Variables from chk.modules.workflow import WorkflowDocument, WorkflowDocumentSupport -from chk.modules.workflow.entities import ChkwareTask - -from tests import load_chk_file, load_file_ctx_for_file, SPEC_DIR +from chk.modules.workflow.entities import ChkwareTask, WorkflowUses +from tests import SPEC_DIR, load_chk_file, load_file_ctx_for_file class TestWorkflowDocument: @staticmethod def test_from_file_context_pass(load_chk_file, load_file_ctx_for_file): + + class TaskDict(BaseModel): + file: str = Field(default=str) + name: str = Field(default=str) + uses: WorkflowUses + filepath = f"{SPEC_DIR}workflow/simple-btc-wf.chk" file_ctx = load_file_ctx_for_file(filepath) @@ -20,10 +26,16 @@ def test_from_file_context_pass(load_chk_file, load_file_ctx_for_file): assert wfdoc.id == "simple-btc-workflow-1" assert isinstance(wfdoc.tasks, list) - assert all(isinstance(i, ChkwareTask) for i in wfdoc.tasks) + assert all(TaskDict(**i) for i in wfdoc.tasks) @staticmethod def test_from_file_context_pass_noid(load_chk_file, load_file_ctx_for_file): + + class TaskDict(BaseModel): + file: str = Field(default=str) + name: str = Field(default=str) + uses: WorkflowUses + filepath = f"{SPEC_DIR}workflow/simple-btc-wf.chk" file_ctx = load_file_ctx_for_file(filepath) @@ -34,7 +46,7 @@ def test_from_file_context_pass_noid(load_chk_file, load_file_ctx_for_file): assert wfdoc.id == "simple-btc-workflow" assert isinstance(wfdoc.tasks, list) - assert all(isinstance(i, ChkwareTask) for i in wfdoc.tasks) + assert all(TaskDict(**i) for i in wfdoc.tasks) class TestWorkflowDocumentSupport: @@ -46,4 +58,5 @@ def test_process_task_template_pass(load_chk_file, load_file_ctx_for_file): wfdoc = WorkflowDocument.from_file_context(file_ctx) - WorkflowDocumentSupport.process_task_template(wfdoc, ...) + rpt = WorkflowDocumentSupport.process_task_template(wfdoc, Variables({"_steps": []})) + assert isinstance(rpt, list) From 353fa49cb2245b99dad3ab0429952bf02fe8f5ac Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 12:54:34 +0600 Subject: [PATCH 64/70] feat: return inner data --- .../workflow_cases/get-req-vars/coinstats-usd-workflow.chk | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk index 1ec10f85..c091d7a3 100644 --- a/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk +++ b/tests/resources/storage/spec_docs/workflow_cases/get-req-vars/coinstats-usd-workflow.chk @@ -22,3 +22,4 @@ tasks: expose: - <% _steps %> + - <% _steps.1.vdata.body %> From d288434897190f7c578fb95317f4c69f12cb5473 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 16:35:46 +0600 Subject: [PATCH 65/70] fix: tests for wf tasks and services --- tests/modules/workflow/wf_entities_test.py | 54 +++++++++++++--------- tests/modules/workflow/wf_module_test.py | 29 +++++++++--- 2 files changed, 55 insertions(+), 28 deletions(-) diff --git a/tests/modules/workflow/wf_entities_test.py b/tests/modules/workflow/wf_entities_test.py index 88c5ea33..b3afe811 100644 --- a/tests/modules/workflow/wf_entities_test.py +++ b/tests/modules/workflow/wf_entities_test.py @@ -7,40 +7,50 @@ from chk.modules.workflow.entities import ChkwareTask, ChkwareValidateTask +fp = "/Users/mlbdmba21/Works/chkware/cli/tests/resources/storage/spec_docs/workflow_cases/simple" + class TestChkwareTask: @staticmethod def test_from_dict_pass(): - task = ChkwareTask.from_dict( - {"name": "Sample fetch", "uses": "fetch", "file": "file.chk"} + + task = ChkwareTask( + fp, + **{ + "name": "Sample fetch", + "uses": "fetch", + "file": "./coinstats-usd-validate.chk", + }, ) assert task.uses == "fetch" - assert task.file == "file.chk" + assert task.file == f"{fp}/coinstats-usd-validate.chk" class TestChkwareValidateTask: @staticmethod def test_from_dict_pass(): - task = ChkwareValidateTask.from_dict( - { + task = ChkwareValidateTask( + fp, + **{ "name": "Sample validate", "uses": "validate", - "file": "validate-file-1.chk", - } + "file": "./coinstats-usd-validate.chk", + }, ) assert task.uses == "validate" - assert task.file == "validate-file-1.chk" - assert task.arguments is None + assert task.file == f"{fp}/coinstats-usd-validate.chk" + assert isinstance(task.arguments, ChkwareValidateTask.ChkwareTaskDataArgument) - task = ChkwareValidateTask.from_dict( - { + task = ChkwareValidateTask( + fp, + **{ "name": "Sample validate - 2", "uses": "validate", - "file": "validate-file.chk", + "file": "./coinstats-usd-validate.chk", "arguments": {"data": {"some": 12, "data": [1, "a"]}}, - } + }, ) assert task.arguments and "data" in task.arguments.model_dump() @@ -48,25 +58,27 @@ def test_from_dict_pass(): @staticmethod def test_from_dict_fail(): with pytest.raises(ValidationError): - ChkwareValidateTask.from_dict( - { + ChkwareValidateTask( + fp, + **{ "name": "Sample validate - 3", "uses": "validate", - "file": "validate-file.chk", + "file": "./coinstats-usd-validate.chk", "arguments": { "data": {"some": 12, "data": [1, "a"]}, "other_data": 1, }, - } + }, ) with pytest.raises(ValidationError): - ChkwareValidateTask.from_dict( - { + ChkwareValidateTask( + fp, + **{ "name": "Sample validate - 4", "uses": "validate", - "file": "validate-file.chk", + "file": "./coinstats-usd-validate.chk", "other_data": 1, "arguments": {"data": {"some": 12, "data": [1, "a"]}}, - } + }, ) diff --git a/tests/modules/workflow/wf_module_test.py b/tests/modules/workflow/wf_module_test.py index 3a838390..6fdd2e8d 100644 --- a/tests/modules/workflow/wf_module_test.py +++ b/tests/modules/workflow/wf_module_test.py @@ -2,17 +2,32 @@ """ Workflow module test """ - -from chk.modules.workflow import execute - -from tests import load_chk_file, load_file_ctx_for_file, get_exec_ctx, SPEC_DIR +from chk.infrastructure.symbol_table import ExecResponse +from chk.modules.workflow import call, execute +from tests import SPEC_DIR, get_exec_ctx, load_chk_file, load_file_ctx_for_file class TestWorkflowExecute: @staticmethod - def test_execute(load_chk_file, load_file_ctx_for_file, get_exec_ctx): - filepath = f"{SPEC_DIR}workflow/simple-btc-wf.chk" + def test_execute(load_chk_file, load_file_ctx_for_file, get_exec_ctx, capsys): + """test_execute""" + + filepath = f"{SPEC_DIR}workflow_cases/get-req-vars/coinstats-usd-workflow.chk" file_ctx = load_file_ctx_for_file(filepath) - execution_ctx = get_exec_ctx(False) + execution_ctx = get_exec_ctx(True) execute(file_ctx, execution_ctx) + + captured = capsys.readouterr() + assert "======" in captured.out + + @staticmethod + def test_call(load_chk_file, load_file_ctx_for_file, get_exec_ctx): + """test_call""" + + filepath = f"{SPEC_DIR}workflow_cases/get-req-vars/coinstats-usd-workflow.chk" + file_ctx = load_file_ctx_for_file(filepath) + execution_ctx = get_exec_ctx(True) + + er = call(file_ctx, execution_ctx) + assert isinstance(er, ExecResponse) From 767251f28bf4c35685abc1e4ff2ba31834f5edcd Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 16:54:26 +0600 Subject: [PATCH 66/70] fix: path issue caught on ci --- tests/modules/workflow/wf_entities_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/modules/workflow/wf_entities_test.py b/tests/modules/workflow/wf_entities_test.py index b3afe811..b07ae203 100644 --- a/tests/modules/workflow/wf_entities_test.py +++ b/tests/modules/workflow/wf_entities_test.py @@ -2,12 +2,14 @@ """ Testing Entities for workflow """ +from pathlib import Path + import pytest from pydantic import ValidationError from chk.modules.workflow.entities import ChkwareTask, ChkwareValidateTask -fp = "/Users/mlbdmba21/Works/chkware/cli/tests/resources/storage/spec_docs/workflow_cases/simple" +fp = f"{Path.cwd()}/tests/resources/storage/spec_docs/workflow_cases/simple" class TestChkwareTask: From 157f9cde4e0d04af4563c7ef3d16a10a37e642f1 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 22:39:50 +0600 Subject: [PATCH 67/70] fix: OS neutral path --- tests/modules/workflow/wf_entities_test.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/modules/workflow/wf_entities_test.py b/tests/modules/workflow/wf_entities_test.py index b07ae203..e0f1ccd9 100644 --- a/tests/modules/workflow/wf_entities_test.py +++ b/tests/modules/workflow/wf_entities_test.py @@ -9,7 +9,17 @@ from chk.modules.workflow.entities import ChkwareTask, ChkwareValidateTask -fp = f"{Path.cwd()}/tests/resources/storage/spec_docs/workflow_cases/simple" +fp_p = ( + Path.cwd() + / "tests" + / "resources" + / "storage" + / "spec_docs" + / "workflow_cases" + / "simple" +) + +fp = str(fp_p) class TestChkwareTask: From c1642d9a0f466941ee58ac4080f167b475bdb5ea Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 22:47:07 +0600 Subject: [PATCH 68/70] refactor: from str concat to path concat --- chk/infrastructure/file_loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chk/infrastructure/file_loader.py b/chk/infrastructure/file_loader.py index de9f93cb..139c235f 100644 --- a/chk/infrastructure/file_loader.py +++ b/chk/infrastructure/file_loader.py @@ -136,7 +136,7 @@ def generate_abs_path(base_: str, target_: str) -> str: if part == "..": to_path = to_path.parent else: - to_path = Path(str(to_path) + "/" + part) + to_path = to_path / part return str(to_path) From 78b95499ba50ba82a8f3ee603b76ff067ae6dc32 Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 23:18:08 +0600 Subject: [PATCH 69/70] refactor: reorder imports --- chk/infrastructure/file_loader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chk/infrastructure/file_loader.py b/chk/infrastructure/file_loader.py index 139c235f..7c7ccb38 100644 --- a/chk/infrastructure/file_loader.py +++ b/chk/infrastructure/file_loader.py @@ -3,11 +3,12 @@ """ from __future__ import annotations + import hashlib -from typing import NamedTuple +import json from pathlib import Path +from typing import NamedTuple -import json import yaml from chk.infrastructure.typing_extras import JsonDecodingError @@ -110,7 +111,6 @@ def filepath_base_as_path(self) -> Path: return Path(self.filepath).absolute().parent -# @TODO Need testing def generate_abs_path(base_: str, target_: str) -> str: """Generate absolute path in comparison to base path Args: From 8acf3a06a39634d6e98723d18cb6a67cc0cdc04f Mon Sep 17 00:00:00 2001 From: HSN Date: Fri, 4 Oct 2024 23:22:46 +0600 Subject: [PATCH 70/70] refactor: update paths to OS deps --- tests/modules/workflow/wf_entities_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/modules/workflow/wf_entities_test.py b/tests/modules/workflow/wf_entities_test.py index e0f1ccd9..99080add 100644 --- a/tests/modules/workflow/wf_entities_test.py +++ b/tests/modules/workflow/wf_entities_test.py @@ -36,7 +36,7 @@ def test_from_dict_pass(): ) assert task.uses == "fetch" - assert task.file == f"{fp}/coinstats-usd-validate.chk" + assert task.file == str(fp_p / "coinstats-usd-validate.chk") class TestChkwareValidateTask: @@ -52,7 +52,7 @@ def test_from_dict_pass(): ) assert task.uses == "validate" - assert task.file == f"{fp}/coinstats-usd-validate.chk" + assert task.file == str(fp_p / "coinstats-usd-validate.chk") assert isinstance(task.arguments, ChkwareValidateTask.ChkwareTaskDataArgument) task = ChkwareValidateTask(