1515
1616 from _pytask .node_protocols import PTask
1717
18- CURRENT_RUNTIME_VERSION = "1"
19-
2018
2119class _RuntimeEntry (msgspec .Struct ):
2220 id : str
@@ -25,12 +23,10 @@ class _RuntimeEntry(msgspec.Struct):
2523
2624
2725class _RuntimeFile (msgspec .Struct , forbid_unknown_fields = False ):
28- runtime_version : str = msgspec .field (name = "runtime-version" )
2926 task : list [_RuntimeEntry ] = msgspec .field (default_factory = list )
3027
3128
32- class _RuntimeJournalEntry (msgspec .Struct ):
33- runtime_version : str = msgspec .field (name = "runtime-version" )
29+ class _RuntimeJournalEntry (msgspec .Struct , forbid_unknown_fields = False ):
3430 id : str
3531 date : float
3632 duration : float
@@ -56,10 +52,6 @@ def _read_runtimes(path: Path) -> _RuntimeFile | None:
5652 except msgspec .DecodeError :
5753 path .unlink ()
5854 return None
59-
60- if data .runtime_version != CURRENT_RUNTIME_VERSION :
61- path .unlink ()
62- return None
6355 return data
6456
6557
@@ -73,12 +65,7 @@ def _write_runtimes(path: Path, runtimes: _RuntimeFile) -> None:
7365def _read_journal (
7466 journal : JsonlJournal [_RuntimeJournalEntry ],
7567) -> list [_RuntimeJournalEntry ]:
76- entries = journal .read ()
77- for entry in entries :
78- if entry .runtime_version != CURRENT_RUNTIME_VERSION :
79- journal .delete ()
80- return []
81- return entries
68+ return journal .read ()
8269
8370
8471def _apply_journal (
@@ -92,7 +79,6 @@ def _apply_journal(
9279 id = entry .id , date = entry .date , duration = entry .duration
9380 )
9481 return _RuntimeFile (
95- runtime_version = CURRENT_RUNTIME_VERSION ,
9682 task = list (index .values ()),
9783 )
9884
@@ -116,7 +102,6 @@ def from_root(cls, root: Path) -> RuntimeState:
116102 journal_entries = _read_journal (journal )
117103 if existing is None :
118104 runtimes = _RuntimeFile (
119- runtime_version = CURRENT_RUNTIME_VERSION ,
120105 task = [],
121106 )
122107 runtimes = _apply_journal (runtimes , journal_entries )
@@ -137,12 +122,10 @@ def update_task(self, task: PTask, start: float, end: float) -> None:
137122 entry = _RuntimeEntry (id = task_id , date = start , duration = end - start )
138123 self ._index [entry .id ] = entry
139124 self .runtimes = _RuntimeFile (
140- runtime_version = CURRENT_RUNTIME_VERSION ,
141125 task = list (self ._index .values ()),
142126 )
143127 self ._rebuild_index ()
144128 journal_entry = _RuntimeJournalEntry (
145- runtime_version = CURRENT_RUNTIME_VERSION ,
146129 id = entry .id ,
147130 date = entry .date ,
148131 duration = entry .duration ,
0 commit comments