33from __future__ import annotations
44
55from dataclasses import dataclass
6+ from dataclasses import field
67from typing import TYPE_CHECKING
78from typing import Any
89from typing import NamedTuple
910
1011import click
11- from attrs import define
12- from attrs import field
1312from rich .box import ROUNDED
1413from rich .errors import LiveError
1514from rich .live import Live
@@ -85,7 +84,7 @@ def pytask_execute(session: Session) -> Generator[None, None, None]:
8584 return (yield )
8685
8786
88- @define (eq = False )
87+ @dataclass (eq = False )
8988class LiveManager :
9089 """A class for live displays during a session.
9190
@@ -106,7 +105,9 @@ class LiveManager:
106105 """
107106
108107 _live : Live = field (
109- factory = lambda : Live (renderable = None , console = console , auto_refresh = False )
108+ default_factory = lambda : Live (
109+ renderable = None , console = console , auto_refresh = False
110+ )
110111 )
111112
112113 def start (self ) -> None :
@@ -157,7 +158,7 @@ class _ReportEntry(NamedTuple):
157158 task : PTask
158159
159160
160- @define (eq = False , kw_only = True )
161+ @dataclass (eq = False , kw_only = True )
161162class LiveExecution :
162163 """A class for managing the table displaying task progress during the execution."""
163164
@@ -168,8 +169,8 @@ class LiveExecution:
168169 initial_status : TaskExecutionStatus = TaskExecutionStatus .RUNNING
169170 sort_final_table : bool = False
170171 n_tasks : int | str = "x"
171- _reports : list [_ReportEntry ] = field (factory = list )
172- _running_tasks : dict [str , _TaskEntry ] = field (factory = dict )
172+ _reports : list [_ReportEntry ] = field (default_factory = list )
173+ _running_tasks : dict [str , _TaskEntry ] = field (default_factory = dict )
173174
174175 @hookimpl (wrapper = True )
175176 def pytask_execute_build (self ) -> Generator [None , None , None ]:
@@ -306,7 +307,7 @@ def update_report(self, new_report: ExecutionReport) -> None:
306307 self ._update_table ()
307308
308309
309- @define (eq = False , kw_only = True )
310+ @dataclass (eq = False , kw_only = True )
310311class LiveCollection :
311312 """A class for managing the live status during the collection."""
312313
0 commit comments