diff --git a/README.md b/README.md index 45fef95..f5090c2 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ interacting with the configuration files and the results files from the ASAM Quality Checker Framework. With it, users can create their own Checker Bundles or Report Modules in Python. +**Disclaimer**: The current version is the release candidate `1.0.0rc1`. The first official release is expected to be in November. + The library features the main interfaces needed to implement a module: - Configuration: for reading and writing QC Framework [configuration files](https://github.com/asam-ev/qc-framework/blob/main/doc/manual/file_formats.md#configuration-file-xml). @@ -108,7 +110,7 @@ content: ``` -For more information regarding the configuration XSD schema you can check [here](https://github.com/asam-ev/qc-framework/blob/develop/doc/schema/config_format.xsd) +For more information regarding the configuration XSD schema you can check [here](https://github.com/asam-ev/qc-framework/blob/main/doc/schema/config_format.xsd) ### Reading checker bundle config from file @@ -242,7 +244,7 @@ content: ``` -For more information regarding the result XSD schema you can check [here](https://github.com/asam-ev/qc-framework/blob/develop/doc/schema/xqar_result_format.xsd) +For more information regarding the result XSD schema you can check [here](https://github.com/asam-ev/qc-framework/blob/main/doc/schema/xqar_result_format.xsd) ### Reading a result from checker bundle execution diff --git a/examples/json_validator/requirements.txt b/examples/json_validator/requirements.txt index 51d71e8..cd640ae 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@develop +asam-qc-baselib @ git+https://github.com/asam-ev/qc-baselib-py@main diff --git a/examples/report_module_text/requirements.txt b/examples/report_module_text/requirements.txt index 2078d68..60e6ecc 100644 --- a/examples/report_module_text/requirements.txt +++ b/examples/report_module_text/requirements.txt @@ -1,4 +1,4 @@ -qc_baselib @ git+https://github.com/asam-ev/qc-baselib-py@develop +asam-qc-baselib @ git+https://github.com/asam-ev/qc-baselib-py@main lxml==5.2.2 numpy==2.0.0 scipy==1.14.0 diff --git a/pyproject.toml b/pyproject.toml index af563b7..0d54ef8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "asam-qc-baselib" -version = "0.1.0" +version = "1.0.0rc1" description = "Python base library for ASAM Quality Checker Framework" authors = ["Patrick Abrahão "] license = "MPL-2.0" diff --git a/qc_baselib/__init__.py b/qc_baselib/__init__.py index 35caa3a..05ce5de 100644 --- a/qc_baselib/__init__.py +++ b/qc_baselib/__init__.py @@ -3,7 +3,7 @@ # Public License, v. 2.0. If a copy of the MPL was not distributed # with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -__version__ = "0.1.0" +__version__ = "1.0.0rc1" from .configuration import Configuration as Configuration diff --git a/qc_baselib/configuration.py b/qc_baselib/configuration.py index 0bb7b2b..20c3e53 100644 --- a/qc_baselib/configuration.py +++ b/qc_baselib/configuration.py @@ -39,7 +39,7 @@ class Configuration: ``` For more information regarding the configuration XSD schema you can check - [here](https://github.com/asam-ev/qc-framework/blob/develop/doc/schema/config_format.xsd). + [here](https://github.com/asam-ev/qc-framework/blob/main/doc/schema/config_format.xsd). """ diff --git a/qc_baselib/models/config.py b/qc_baselib/models/config.py index 0ef4397..bc60bfc 100644 --- a/qc_baselib/models/config.py +++ b/qc_baselib/models/config.py @@ -11,7 +11,7 @@ # Configuration models # Original XSD file: -# > https://github.com/asam-ev/qc-framework/blob/develop/doc/schema/config_format.xsd +# > https://github.com/asam-ev/qc-framework/blob/main/doc/schema/config_format.xsd class CheckerType(BaseXmlModel): diff --git a/qc_baselib/models/result.py b/qc_baselib/models/result.py index fd677fd..1dff5da 100644 --- a/qc_baselib/models/result.py +++ b/qc_baselib/models/result.py @@ -15,7 +15,7 @@ # Report models # Original XSD file: -# > https://github.com/asam-ev/qc-framework/blob/develop/doc/schema/xqar_report_format.xsd +# > https://github.com/asam-ev/qc-framework/blob/main/doc/schema/xqar_report_format.xsd class XMLLocationType(BaseXmlModel): diff --git a/qc_baselib/result.py b/qc_baselib/result.py index 2d8fe8f..6b0b33e 100644 --- a/qc_baselib/result.py +++ b/qc_baselib/result.py @@ -9,6 +9,7 @@ from dataclasses import dataclass from typing import Union, List, Set from lxml import etree +from datetime import datetime from qc_baselib import Configuration from .models import IssueSeverity, StatusType, result, common @@ -48,7 +49,6 @@ class Result: result.register_checker_bundle( name="TestBundle", - build_date="2024-05-31", description="Example checker bundle", version="0.0.1", ) @@ -65,11 +65,11 @@ class Result: result.load_from_file(RESULT_FILE_PATH) - version = result.get_version() + version = result.get_result_version() ``` For more information regarding the results report XSD schema you can check - [here](https://github.com/asam-ev/qc-framework/blob/develop/doc/schema/xqar_report_format.xsd) + [here](https://github.com/asam-ev/qc-framework/blob/main/doc/schema/xqar_report_format.xsd) """ @@ -321,14 +321,18 @@ def _get_issue( def register_checker_bundle( self, - build_date: str, description: str, name: str, version: str, + build_date: Union[None, str] = None, summary: str = "", ) -> None: bundle = result.CheckerBundleType( - build_date=build_date, + build_date=( + build_date + if build_date is not None + else datetime.today().strftime("%Y-%m-%d") + ), description=description, name=name, version=version, diff --git a/tests/test_result.py b/tests/test_result.py index 10e78d7..d885176 100644 --- a/tests/test_result.py +++ b/tests/test_result.py @@ -2,7 +2,8 @@ import pytest from lxml import etree from pydantic_core import ValidationError -from qc_baselib.models import config, result +from datetime import datetime +from qc_baselib.models import result from qc_baselib import Result, IssueSeverity, StatusType, Configuration @@ -1503,3 +1504,19 @@ def test_create_rule_id_validation() -> None: checker_id="TestChecker", rule_uid="test.com:qc:1.0.0:", ) + + +def test_build_date() -> None: + result = Result() + + result.register_checker_bundle( + name="TestBundle", + description="Example checker bundle", + version="0.0.1", + ) + + checker_bundle_result = result.get_checker_bundle_result("TestBundle") + + print(checker_bundle_result.build_date) + + assert checker_bundle_result.build_date == datetime.now().strftime("%Y-%m-%d")