From a1b99fc09d5d43ab6be98fa0640f0a98af8e3ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bjerregaard=20Vrist?= Date: Mon, 10 May 2021 11:42:35 +0200 Subject: [PATCH 1/6] Update croniter stub to match latest versions --- stubs/croniter/METADATA.toml | 4 ++-- stubs/croniter/croniter.pyi | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/stubs/croniter/METADATA.toml b/stubs/croniter/METADATA.toml index 31f638bf33df..748cd715a551 100644 --- a/stubs/croniter/METADATA.toml +++ b/stubs/croniter/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.1" -python2 = true +version = "1.0" +python2 = false diff --git a/stubs/croniter/croniter.pyi b/stubs/croniter/croniter.pyi index fc9f2710dcf1..40efb9aff226 100644 --- a/stubs/croniter/croniter.pyi +++ b/stubs/croniter/croniter.pyi @@ -23,7 +23,14 @@ class croniter(Iterator[Any]): dst_start_time: float nth_weekday_of_month: Dict[str, Any] def __init__( - self, expr_format: Text, start_time: float | datetime.datetime | None = ..., ret_type: _RetType | None = ... + self, + expr_format: Text, + start_time: float | datetime.datetime | None = ..., + ret_type: _RetType | None = ..., + day_or: bool = ..., + max_years_between_matches: Optional[int] = ..., + is_prev: bool = ..., + hash_id: Optional[Union[bytes, str]] = ..., ) -> None: ... # Most return value depend on ret_type, which can be passed in both as a method argument and as # a constructor argument. From 4c32524f4909c6daec668fd81248426595fc8638 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 8 Aug 2021 17:25:11 +0300 Subject: [PATCH 2/6] new union syntax, add comment --- stubs/croniter/croniter.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/croniter/croniter.pyi b/stubs/croniter/croniter.pyi index 40efb9aff226..d9eb2ea8dcbf 100644 --- a/stubs/croniter/croniter.pyi +++ b/stubs/croniter/croniter.pyi @@ -28,9 +28,9 @@ class croniter(Iterator[Any]): start_time: float | datetime.datetime | None = ..., ret_type: _RetType | None = ..., day_or: bool = ..., - max_years_between_matches: Optional[int] = ..., + max_years_between_matches: int | None = ..., is_prev: bool = ..., - hash_id: Optional[Union[bytes, str]] = ..., + hash_id: str | bytes = ..., # unicode not accepted on python 2 ) -> None: ... # Most return value depend on ret_type, which can be passed in both as a method argument and as # a constructor argument. From 0808312e475a45b1e0f59292612818da3cd0349a Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 8 Aug 2021 17:26:23 +0300 Subject: [PATCH 3/6] do not drop python 2 support, apparently re-added in 1.0.15 --- stubs/croniter/METADATA.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/croniter/METADATA.toml b/stubs/croniter/METADATA.toml index 748cd715a551..346c93fc5729 100644 --- a/stubs/croniter/METADATA.toml +++ b/stubs/croniter/METADATA.toml @@ -1,2 +1 @@ version = "1.0" -python2 = false From 8597cbb5fdc25cfcd1ce0bbdb1e9589d4f0c21c2 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 8 Aug 2021 17:27:42 +0300 Subject: [PATCH 4/6] fixening --- stubs/croniter/METADATA.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/croniter/METADATA.toml b/stubs/croniter/METADATA.toml index 346c93fc5729..f339dc7fdf26 100644 --- a/stubs/croniter/METADATA.toml +++ b/stubs/croniter/METADATA.toml @@ -1 +1,2 @@ version = "1.0" +python2 = true From c09a305675561a87512f1c637fa48f3e9a443362 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 8 Aug 2021 18:04:27 +0300 Subject: [PATCH 5/6] Update stubs/croniter/croniter.pyi Co-authored-by: Sebastian Rittau --- stubs/croniter/croniter.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/croniter/croniter.pyi b/stubs/croniter/croniter.pyi index d9eb2ea8dcbf..3d54a0dd3db2 100644 --- a/stubs/croniter/croniter.pyi +++ b/stubs/croniter/croniter.pyi @@ -30,7 +30,7 @@ class croniter(Iterator[Any]): day_or: bool = ..., max_years_between_matches: int | None = ..., is_prev: bool = ..., - hash_id: str | bytes = ..., # unicode not accepted on python 2 + hash_id: str | bytes | None = ..., # unicode not accepted on python 2 ) -> None: ... # Most return value depend on ret_type, which can be passed in both as a method argument and as # a constructor argument. From 66b6d82cbf9d5f9e1ace8303abd0055612fe622c Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 8 Aug 2021 18:18:23 +0300 Subject: [PATCH 6/6] delete old whitelist entry --- stubs/croniter/@tests/stubtest_allowlist.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/croniter/@tests/stubtest_allowlist.txt b/stubs/croniter/@tests/stubtest_allowlist.txt index 4a250b1eb018..98ef85596774 100644 --- a/stubs/croniter/@tests/stubtest_allowlist.txt +++ b/stubs/croniter/@tests/stubtest_allowlist.txt @@ -1,5 +1,4 @@ croniter.CroniterError -croniter.croniter.__init__ croniter.croniter.__next__ croniter.croniter.expand croniter.croniter.get_next