diff --git a/stubs/python-crontab/METADATA.toml b/stubs/python-crontab/METADATA.toml index 6a47d346981a..292eef4021f2 100644 --- a/stubs/python-crontab/METADATA.toml +++ b/stubs/python-crontab/METADATA.toml @@ -1,3 +1,3 @@ -version = "3.3.*" +version = "3.4.*" upstream-repository = "https://gitlab.com/doctormo/python-crontab" dependencies = ["types-croniter"] diff --git a/stubs/python-crontab/crontab.pyi b/stubs/python-crontab/crontab.pyi index 2bd4d755e389..5e22b4dea803 100644 --- a/stubs/python-crontab/crontab.pyi +++ b/stubs/python-crontab/crontab.pyi @@ -35,7 +35,7 @@ SPECREX: Final[re.Pattern[str]] DEVNULL: Final[str] WEEK_ENUM: Final[list[str]] MONTH_ENUM: Final[list[str | None]] -SPECIALS_CONVERSION: Final[bool] +SPECIALS_CONVERSION: bool | None SPECIALS: Final[dict[str, str]] SPECIAL_IGNORE: Final[list[str]] S_INFO: Final[list[dict[str, str | int | list[str] | list[str | None]]]] @@ -96,7 +96,8 @@ class CronTab: # Usually `kwargs` are just `now: datetime | None`, but technically this can # work for `CronItem` subclasses, which might define other kwargs. def run_pending(self, *, now: datetime | None = None, **kwargs: Any) -> Iterator[str]: ... - def run_scheduler(self, timeout: int = -1, cadence: int = 60, warp: bool = False) -> Iterator[str]: ... + def run_scheduler(self, timeout: int = -1, cadence: int | float = 60, warp: bool = False) -> Iterator[str]: ... + async def run_scheduler_async(self, timeout: int = -1, cadence: int | float = 60, warp: bool = False) -> Iterator[str]: ... def render(self, errors: bool = False) -> str: ... def new( self, @@ -279,15 +280,16 @@ class CronSlice: def parse(self, value: str | None) -> None: ... def render(self, resolve: bool = False) -> str: ... def __eq__(self, arg: object) -> bool: ... - def every(self, n_value: int, also: bool = False) -> _Part: ... + def every(self, n_value: int, also: bool = False, random: bool = False) -> _Part: ... # The only known kwarg, others are unused, # `*args`` are passed to `parse_value`, so they are `Any` def on(self, *n_value: Any, also: bool = False) -> list[_Part]: ... - def during(self, vfrom: int | str, vto: int | str, also: bool = False) -> _Part: ... + def during(self, vfrom: int | str, vto: int | str, also: bool = False, random: bool = False) -> _Part: ... + def random_during(self, vfrom: int | str, vto: int | str) -> _Part: ... @property def also(self) -> Also: ... def clear(self) -> None: ... - def get_range(self, *vrange: int | str | CronValue) -> list[int | CronRange]: ... + def get_range(self, *vrange: int | str | CronValue, random: bool = False) -> list[int | CronRange]: ... def __iter__(self) -> Iterator[int]: ... def __len__(self) -> int: ... def parse_value(self, val: str, sunday: int | None = None) -> int | CronValue: ... @@ -307,7 +309,8 @@ class CronRange: slice: str cron: CronTab | None seq: int - def __init__(self, vslice: str, *vrange: int | str | CronValue) -> None: ... + is_random_range: bool + def __init__(self, vslice: str, *vrange: int | str | CronValue, random: bool = False) -> None: ... # Are not set in `__init__`: vfrom: int | CronValue vto: int | CronValue