From 3d56d393946954f84249513c677bd3d474cf5ef1 Mon Sep 17 00:00:00 2001 From: hoangtungdinh <11166240+hoangtungdinh@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:43:36 +0200 Subject: [PATCH] Update documentation and example Signed-off-by: hoangtungdinh <11166240+hoangtungdinh@users.noreply.github.com> --- README.md | 16 +++++++++++++++- examples/json_validator/config/invalid.xml | 2 +- examples/json_validator/config/skipped.xml | 2 +- examples/json_validator/config/valid.xml | 2 +- examples/json_validator/json_validator.py | 11 ++++------- examples/json_validator/requirements.txt | 2 +- examples/report_module_text/requirements.txt | 2 +- 7 files changed, 24 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9af38bb..b130a52 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,27 @@ The library features the main interfaces needed to implement a module: ### Installation using pip +**From PyPi** + +```bash +pip install asam-qc-baselib +``` + +**From GitHub repository** + ```bash pip install asam-qc-baselib@git+https://github.com/asam-ev/qc-baselib-py@main ``` -**Note**: To install from different sources, you can replace `@main` with +To install from different sources, you can replace `@main` with your desired target. For example, `develop` branch as `@develop`. +**From a local repository** + +```bash +pip install /home/user/qc-baselib-py +``` + ### Installation from source for local development. Using [Poetry](https://python-poetry.org/): diff --git a/examples/json_validator/config/invalid.xml b/examples/json_validator/config/invalid.xml index 746eb98..a3b068c 100644 --- a/examples/json_validator/config/invalid.xml +++ b/examples/json_validator/config/invalid.xml @@ -1,7 +1,7 @@ - + diff --git a/examples/json_validator/config/skipped.xml b/examples/json_validator/config/skipped.xml index e65ee52..c8a9c5a 100644 --- a/examples/json_validator/config/skipped.xml +++ b/examples/json_validator/config/skipped.xml @@ -1,7 +1,7 @@ - + diff --git a/examples/json_validator/config/valid.xml b/examples/json_validator/config/valid.xml index 6b2251d..7f3a4ad 100644 --- a/examples/json_validator/config/valid.xml +++ b/examples/json_validator/config/valid.xml @@ -1,7 +1,7 @@ - + diff --git a/examples/json_validator/json_validator.py b/examples/json_validator/json_validator.py index f4c23d1..950a105 100644 --- a/examples/json_validator/json_validator.py +++ b/examples/json_validator/json_validator.py @@ -40,19 +40,17 @@ def main(): # Create result object result = Result() - json_file = config.get_config_param("JsonFile") - result_file = config.get_checker_bundle_param("jsonBundle", "resultFile") + json_file = config.get_config_param("InputFile") + result_file = config.get_checker_bundle_param(BUNDLE_NAME, "resultFile") - logging.info(f"JsonFile = {json_file}") + logging.info(f"InputFile = {json_file}") logging.info(f"resultFile = {result_file}") # Register checker bundle result.register_checker_bundle( name=BUNDLE_NAME, - build_date=datetime.today().strftime("%Y-%m-%d"), description="JSON checker bundle", version=BUNDLE_VERSION, - summary="", ) result.set_result_version(version=BUNDLE_VERSION) @@ -61,7 +59,6 @@ def main(): checker_bundle_name=BUNDLE_NAME, checker_id=CHECKER_ID, description="Json validation checker", - summary="", ) # Register addressed rule @@ -81,7 +78,7 @@ def main(): is_valid = is_valid_json(json_file) if not is_valid: - issue_id = result.register_issue( + result.register_issue( checker_bundle_name=BUNDLE_NAME, checker_id=CHECKER_ID, description="The input file is not a valid json file.", diff --git a/examples/json_validator/requirements.txt b/examples/json_validator/requirements.txt index cd640ae..68226cd 100644 --- a/examples/json_validator/requirements.txt +++ b/examples/json_validator/requirements.txt @@ -1 +1 @@ -asam-qc-baselib @ git+https://github.com/asam-ev/qc-baselib-py@main +asam-qc-baselib diff --git a/examples/report_module_text/requirements.txt b/examples/report_module_text/requirements.txt index 60e6ecc..4dfc985 100644 --- a/examples/report_module_text/requirements.txt +++ b/examples/report_module_text/requirements.txt @@ -1,4 +1,4 @@ -asam-qc-baselib @ git+https://github.com/asam-ev/qc-baselib-py@main +asam-qc-baselib lxml==5.2.2 numpy==2.0.0 scipy==1.14.0