Skip to content

Commit

Permalink
Merge branch 'dev' for release 0.1.7
Browse files Browse the repository at this point in the history
Signed-off-by: mimir-d <[email protected]>
  • Loading branch information
mimir-d committed Aug 21, 2024
2 parents 68d996a + 8514f77 commit 171c611
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
pip install -r requirements.txt
- name: Lint with black
run: |
black . --check
black . --check --diff
- name: Check typing with mypy
run: |
mypy . --check-untyped-defs
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,24 @@ The specification does not impose any particular level of usage. To be compliant
A very simple starter example, which just outputs a diagnosis:
```py
import ocptv.output as tv
import random
def get_fan_speed():
return random.randrange(1500, 1700)
def main():
run = tv.TestRun(name="simple_diagnosis", version="1.0")
dut = tv.Dut(id="server0", name="server0.domain.net")
with run.scope(dut=dut):
step = run.add_step("check_fanspeed")
with step.scope():
if get_fan_speed() > 1600: # assuming external get_fan_speed() impl
step.add_diagnosis(DiagnosisType.PASS, verdict="fan_ok")
if get_fan_speed() >= 1600:
step.add_diagnosis(tv.DiagnosisType.PASS, verdict="fan_ok")
else:
step.add_diagnosis(DiagnosisType.FAIL, verdict="fan_low")
step.add_diagnosis(tv.DiagnosisType.FAIL, verdict="fan_low")
if __name__ == '__main__':
main()
```
Expected output (slightly reformatted for readability):
Expand Down Expand Up @@ -190,4 +197,4 @@ An email contact is also available at: [email protected]
<!--
due to https://github.com/pypa/readme_renderer/issues/163 we must use absolute links everywhere
-->
-->
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ocptv"
version = "0.1.6"
version = "0.1.7"
description = "OCP Test & Validation project api"
readme = "README.md"
authors = [{ name = "OCP Test & Validation", email = "[email protected]" }]
Expand Down Expand Up @@ -33,7 +33,7 @@ dev = ["black", "bumpver", "isort", "pip-tools", "pytest", "pytest-cov", "mypy"]
"Source" = "https://github.com/opencomputeproject/ocp-diag-python"

[tool.bumpver]
current_version = "0.1.6"
current_version = "0.1.7"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
Expand Down Expand Up @@ -61,6 +61,10 @@ profile = "black"

[tool.poetry]
name = "ocptv"
version = "0.1.6"
version = "0.1.7"
description = "OCP Test & Validation project api"
authors = ["OCP Test & Validation <[email protected]>"]

[tool.setuptools.package-data]
"*" = ["py.typed"]

3 changes: 2 additions & 1 deletion src/ocptv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
The OCP Test & Validation python api for the output of spec compliant JSON.
"""
__version__ = "0.1.6"

__version__ = "0.1.7"
__author__ = "OCP Test & Validation"
1 change: 1 addition & 0 deletions src/ocptv/output/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains output channel configuration for the OCPTV library.
"""

import threading
import typing as ty
from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions src/ocptv/output/emit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module covers the raw output semantics of the OCPTV library.
"""

import dataclasses as dc
import json
import threading
Expand Down
1 change: 1 addition & 0 deletions src/ocptv/output/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
says what the serializer should use for field name.
In general, ``metadata.spec_field`` should only be present for primitive types.
"""

import dataclasses as dc
import typing as ty
from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions src/ocptv/output/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module describes the high level test run and related objects.
"""

import sys
import threading
import typing as ty
Expand Down
1 change: 1 addition & 0 deletions src/ocptv/output/step.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module describes the test steps inside the test run.
"""

import threading
import typing as ty
from contextlib import contextmanager
Expand Down
1 change: 1 addition & 0 deletions src/ocptv/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Marker file for PEP 561. This package uses inline types.

0 comments on commit 171c611

Please sign in to comment.