44import datetime
55import logging
66from pathlib import Path
7- from typing import Any , Dict , List
7+ from typing import Any
88
99import yaml
1010
1616class RotationMembersFile :
1717 """Represents the contents of the rotation-members.yaml file."""
1818
19- members : List [str ]
19+ members : list [str ]
2020
2121 @classmethod
22- def from_yaml (cls , data : Dict [str , Any ]) -> "RotationMembersFile" :
22+ def from_yaml (cls , data : dict [str , Any ]) -> "RotationMembersFile" :
2323 """Create an instance from a YAML dictionary."""
2424 return cls (members = data .get ("members" , []))
2525
@@ -46,15 +46,15 @@ class Rotation:
4646 """Represents a single rotation entry."""
4747
4848 start_time : datetime .datetime
49- members : List [str ]
49+ members : list [str ]
5050
5151 @classmethod
52- def from_yaml (cls , data : Dict [str , Any ]) -> "Rotation" :
52+ def from_yaml (cls , data : dict [str , Any ]) -> "Rotation" :
5353 """Create an instance from a YAML dictionary."""
5454 start_time = datetime .datetime .fromisoformat (data ["start_time" ])
5555 return cls (start_time = start_time , members = data .get ("members" , []))
5656
57- def to_yaml (self ) -> Dict [str , Any ]:
57+ def to_yaml (self ) -> dict [str , Any ]:
5858 """Convert the instance to a YAML-compatible dictionary."""
5959 as_dict = dataclasses .asdict (self )
6060 as_dict ["start_time" ] = self .start_time .isoformat ()
@@ -75,10 +75,10 @@ def to_yaml(self) -> Dict[str, Any]:
7575class RotationFile :
7676 """Represents the contents of the rotation.yaml file."""
7777
78- rotations : List [Rotation ]
78+ rotations : list [Rotation ]
7979
8080 @classmethod
81- def from_yaml (cls , data : Dict [str , Any ]) -> "RotationFile" :
81+ def from_yaml (cls , data : dict [str , Any ]) -> "RotationFile" :
8282 """Create an instance from a YAML dictionary."""
8383 # Subtle: sort this, so `rotations` is always in order from
8484 # oldest -> newest.
0 commit comments