Skip to content

Commit

Permalink
Add version to Config
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 23, 2024
1 parent 3dead5a commit b4daa0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Next version

### ✨ Improved

* Add `version` to `Config`.

### 🔧 Fixed

* Fix JSON log not being saved to the database in some cases.
Expand Down
2 changes: 2 additions & 0 deletions src/lvmcryo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from typer import Argument, Option
from typer.core import TyperGroup

from lvmcryo import __version__
from lvmcryo.config import Actions, Config, InteractiveMode, NotificationLevel
from lvmcryo.runner import post_fill_tasks
from lvmcryo.tools import add_json_handler
Expand Down Expand Up @@ -438,6 +439,7 @@ async def ln2(
write_data=write_data,
data_path=data_path,
data_extra_time=data_extra_time,
version=__version__,
)
except ValueError as err:
err_console.print(f"[red]Error parsing configuration:[/] {err}")
Expand Down
2 changes: 2 additions & 0 deletions src/lvmcryo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class Config(BaseModel):
data_path: pathlib.Path | None = None
data_extra_time: float = 0.0

version: str | None = None

valve_info: Annotated[dict[str, ValveConfig], ExcludedField] = {}

config_file: Annotated[pathlib.Path | None, ExcludedField] = None
Expand Down

0 comments on commit b4daa0f

Please sign in to comment.