Skip to content

Commit

Permalink
Prepare for the release candidate v1.0.0rc1
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh committed Sep 30, 2024
1 parent d9b0540 commit ce05e7f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 14 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -108,7 +110,7 @@ content:
</Config>
```

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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/json_validator/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/report_module_text/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MPL-2.0"
Expand Down
2 changes: 1 addition & 1 deletion qc_baselib/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
"""

Expand Down
2 changes: 1 addition & 1 deletion qc_baselib/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion qc_baselib/models/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
14 changes: 9 additions & 5 deletions qc_baselib/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
)
Expand All @@ -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)
"""

Expand Down Expand Up @@ -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,
Expand Down
19 changes: 18 additions & 1 deletion tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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")

0 comments on commit ce05e7f

Please sign in to comment.