From f76aef7a87f6ef196219f67f39e23cca8f10bb7d Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:26:24 -0700 Subject: [PATCH 01/17] stubgen --- .../datetimerange/__version__.pyi | 3 + stubs/annoy/annoy/annoylib.pyi | 20 ++++++ .../click-spinner/click_spinner/_version.pyi | 3 + stubs/editdistance/editdistance/bycython.pyi | 3 + stubs/emoji/emoji/unicode_codes/data_dict.pyi | 5 ++ stubs/jmespath/jmespath/compat.pyi | 10 +++ stubs/pytz/pytz/lazy.pyi | 16 +++++ stubs/pytz/pytz/reference.pyi | 30 ++++++++ stubs/pytz/pytz/tzfile.pyi | 3 + stubs/retry/retry/compat.pyi | 1 + stubs/retry/retry/tests/test_retry.pyi | 3 + stubs/stdlib-list/stdlib_list/_version.pyi | 3 + stubs/stdlib-list/stdlib_list/fetch.pyi | 19 +++++ stubs/tzlocal/tzlocal/unix.pyi | 5 ++ stubs/tzlocal/tzlocal/utils.pyi | 9 +++ stubs/tzlocal/tzlocal/win32.pyi | 7 ++ stubs/tzlocal/tzlocal/windows_tz.pyi | 5 ++ stubs/xxhash/xxhash/_xxhash.pyi | 72 +++++++++++++++++++ stubs/xxhash/xxhash/version.pyi | 4 ++ 19 files changed, 221 insertions(+) create mode 100644 stubs/DateTimeRange/datetimerange/__version__.pyi create mode 100644 stubs/annoy/annoy/annoylib.pyi create mode 100644 stubs/click-spinner/click_spinner/_version.pyi create mode 100644 stubs/editdistance/editdistance/bycython.pyi create mode 100644 stubs/emoji/emoji/unicode_codes/data_dict.pyi create mode 100644 stubs/jmespath/jmespath/compat.pyi create mode 100644 stubs/pytz/pytz/lazy.pyi create mode 100644 stubs/pytz/pytz/reference.pyi create mode 100644 stubs/pytz/pytz/tzfile.pyi create mode 100644 stubs/retry/retry/compat.pyi create mode 100644 stubs/retry/retry/tests/test_retry.pyi create mode 100644 stubs/stdlib-list/stdlib_list/_version.pyi create mode 100644 stubs/stdlib-list/stdlib_list/fetch.pyi create mode 100644 stubs/tzlocal/tzlocal/unix.pyi create mode 100644 stubs/tzlocal/tzlocal/utils.pyi create mode 100644 stubs/tzlocal/tzlocal/win32.pyi create mode 100644 stubs/tzlocal/tzlocal/windows_tz.pyi create mode 100644 stubs/xxhash/xxhash/_xxhash.pyi create mode 100644 stubs/xxhash/xxhash/version.pyi diff --git a/stubs/DateTimeRange/datetimerange/__version__.pyi b/stubs/DateTimeRange/datetimerange/__version__.pyi new file mode 100644 index 000000000000..5f47a566505a --- /dev/null +++ b/stubs/DateTimeRange/datetimerange/__version__.pyi @@ -0,0 +1,3 @@ +from _typeshed import Incomplete + +__maintainer__: Incomplete diff --git a/stubs/annoy/annoy/annoylib.pyi b/stubs/annoy/annoy/annoylib.pyi new file mode 100644 index 000000000000..6df9297d87b0 --- /dev/null +++ b/stubs/annoy/annoy/annoylib.pyi @@ -0,0 +1,20 @@ +from typing import Any + +class Annoy: + f: Any + def __init__(self, *args, **kwargs) -> None: ... + def add_item(self, *args, **kwargs) -> Any: ... + def build(self, *args, **kwargs) -> Any: ... + def get_distance(self, *args, **kwargs) -> Any: ... + def get_item_vector(self, *args, **kwargs) -> Any: ... + def get_n_items(self, *args, **kwargs) -> Any: ... + def get_n_trees(self, *args, **kwargs) -> Any: ... + def get_nns_by_item(self, *args, **kwargs) -> Any: ... + def get_nns_by_vector(self, *args, **kwargs) -> Any: ... + def load(self, *args, **kwargs) -> Any: ... + def on_disk_build(self, *args, **kwargs) -> Any: ... + def save(self, *args, **kwargs) -> Any: ... + def set_seed(self, *args, **kwargs) -> Any: ... + def unbuild(self, *args, **kwargs) -> Any: ... + def unload(self, *args, **kwargs) -> Any: ... + def verbose(self, *args, **kwargs) -> Any: ... diff --git a/stubs/click-spinner/click_spinner/_version.pyi b/stubs/click-spinner/click_spinner/_version.pyi new file mode 100644 index 000000000000..85ddc0d3f0a4 --- /dev/null +++ b/stubs/click-spinner/click_spinner/_version.pyi @@ -0,0 +1,3 @@ +version_json: str + +def get_versions(): ... diff --git a/stubs/editdistance/editdistance/bycython.pyi b/stubs/editdistance/editdistance/bycython.pyi new file mode 100644 index 000000000000..0468d7436ba7 --- /dev/null +++ b/stubs/editdistance/editdistance/bycython.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def eval(*args, **kwargs) -> Any: ... diff --git a/stubs/emoji/emoji/unicode_codes/data_dict.pyi b/stubs/emoji/emoji/unicode_codes/data_dict.pyi new file mode 100644 index 000000000000..1abbab7b0993 --- /dev/null +++ b/stubs/emoji/emoji/unicode_codes/data_dict.pyi @@ -0,0 +1,5 @@ +from _typeshed import Incomplete + +STATUS: Incomplete +LANGUAGES: Incomplete +EMOJI_DATA: Incomplete diff --git a/stubs/jmespath/jmespath/compat.pyi b/stubs/jmespath/jmespath/compat.pyi new file mode 100644 index 000000000000..fdafd1524402 --- /dev/null +++ b/stubs/jmespath/jmespath/compat.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete +from collections.abc import Generator +from itertools import zip_longest as zip_longest + +text_type = str +string_type = str + +def with_str_method(cls): ... +def with_repr_method(cls): ... +def get_methods(cls) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/pytz/pytz/lazy.pyi b/stubs/pytz/pytz/lazy.pyi new file mode 100644 index 000000000000..7dee2d54bab8 --- /dev/null +++ b/stubs/pytz/pytz/lazy.pyi @@ -0,0 +1,16 @@ +from _typeshed import Incomplete +from collections import Mapping as DictMixin + +class LazyDict(DictMixin): + data: Incomplete + def __getitem__(self, key): ... + def __contains__(self, key): ... + def __iter__(self): ... + def __len__(self): ... + def keys(self): ... + +class LazyList(list): + def __new__(cls, fill_iter: Incomplete | None = ...): ... + +class LazySet(set): + def __new__(cls, fill_iter: Incomplete | None = ...): ... diff --git a/stubs/pytz/pytz/reference.pyi b/stubs/pytz/pytz/reference.pyi new file mode 100644 index 000000000000..f1c4e64a1768 --- /dev/null +++ b/stubs/pytz/pytz/reference.pyi @@ -0,0 +1,30 @@ +from _typeshed import Incomplete +from datetime import tzinfo +from pytz import UTC as UTC + +class FixedOffset(tzinfo): + def __init__(self, offset, name) -> None: ... + def utcoffset(self, dt): ... + def tzname(self, dt): ... + def dst(self, dt): ... +DSTOFFSET = STDOFFSET + +class LocalTimezone(tzinfo): + def utcoffset(self, dt): ... + def dst(self, dt): ... + def tzname(self, dt): ... + +class USTimeZone(tzinfo): + stdoffset: Incomplete + reprname: Incomplete + stdname: Incomplete + dstname: Incomplete + def __init__(self, hours, reprname, stdname, dstname) -> None: ... + def tzname(self, dt): ... + def utcoffset(self, dt): ... + def dst(self, dt): ... + +Eastern: Incomplete +Central: Incomplete +Mountain: Incomplete +Pacific: Incomplete diff --git a/stubs/pytz/pytz/tzfile.pyi b/stubs/pytz/pytz/tzfile.pyi new file mode 100644 index 000000000000..55187a84a1e5 --- /dev/null +++ b/stubs/pytz/pytz/tzfile.pyi @@ -0,0 +1,3 @@ +from pytz.tzinfo import DstTzInfo as DstTzInfo, StaticTzInfo as StaticTzInfo, memorized_datetime as memorized_datetime, memorized_timedelta as memorized_timedelta, memorized_ttinfo as memorized_ttinfo + +def build_tzinfo(zone, fp): ... diff --git a/stubs/retry/retry/compat.pyi b/stubs/retry/retry/compat.pyi new file mode 100644 index 000000000000..6b155eb0cb13 --- /dev/null +++ b/stubs/retry/retry/compat.pyi @@ -0,0 +1 @@ +from decorator import decorator as decorator diff --git a/stubs/retry/retry/tests/test_retry.pyi b/stubs/retry/retry/tests/test_retry.pyi new file mode 100644 index 000000000000..0f6820f054ea --- /dev/null +++ b/stubs/retry/retry/tests/test_retry.pyi @@ -0,0 +1,3 @@ +from _typeshed import Incomplete + +def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/stdlib-list/stdlib_list/_version.pyi b/stubs/stdlib-list/stdlib_list/_version.pyi new file mode 100644 index 000000000000..85ddc0d3f0a4 --- /dev/null +++ b/stubs/stdlib-list/stdlib_list/_version.pyi @@ -0,0 +1,3 @@ +version_json: str + +def get_versions(): ... diff --git a/stubs/stdlib-list/stdlib_list/fetch.pyi b/stubs/stdlib-list/stdlib_list/fetch.pyi new file mode 100644 index 000000000000..957ba0df3815 --- /dev/null +++ b/stubs/stdlib-list/stdlib_list/fetch.pyi @@ -0,0 +1,19 @@ +from . import base_dir as base_dir, get_canonical_version as get_canonical_version, list_dir as list_dir, short_versions as short_versions +from _typeshed import Incomplete + +class DummyConfig: + intersphinx_mapping: Incomplete + intersphinx_cache_limit: Incomplete + intersphinx_timeout: Incomplete + user_agent: str + tls_verify: bool + def __init__(self, intersphinx_mapping: Incomplete | None = ..., intersphinx_cache_limit: int = ..., intersphinx_timeout: Incomplete | None = ...) -> None: ... + +class DummyApp: + srcdir: Incomplete + warn: Incomplete + config: Incomplete + def __init__(self) -> None: ... + def info(self, msg) -> None: ... + +def fetch_list(version: Incomplete | None = ...) -> None: ... diff --git a/stubs/tzlocal/tzlocal/unix.pyi b/stubs/tzlocal/tzlocal/unix.pyi new file mode 100644 index 000000000000..609bbc5159e1 --- /dev/null +++ b/stubs/tzlocal/tzlocal/unix.pyi @@ -0,0 +1,5 @@ +from tzlocal import utils as utils + +def get_localzone_name(): ... +def get_localzone(): ... +def reload_localzone(): ... diff --git a/stubs/tzlocal/tzlocal/utils.pyi b/stubs/tzlocal/tzlocal/utils.pyi new file mode 100644 index 000000000000..31b6d8488f79 --- /dev/null +++ b/stubs/tzlocal/tzlocal/utils.pyi @@ -0,0 +1,9 @@ +import pytz_deprecation_shim as pds +from backports import zoneinfo +from tzlocal import windows_tz as windows_tz + +class ZoneInfoNotFoundError(pds.UnknownTimeZoneError, zoneinfo.ZoneInfoNotFoundError): ... + +def get_system_offset(): ... +def get_tz_offset(tz): ... +def assert_tz_offset(tz) -> None: ... diff --git a/stubs/tzlocal/tzlocal/win32.pyi b/stubs/tzlocal/tzlocal/win32.pyi new file mode 100644 index 000000000000..90f33fa65c33 --- /dev/null +++ b/stubs/tzlocal/tzlocal/win32.pyi @@ -0,0 +1,7 @@ +from tzlocal import utils as utils +from tzlocal.windows_tz import win_tz as win_tz + +def valuestodict(key): ... +def get_localzone_name(): ... +def get_localzone(): ... +def reload_localzone(): ... diff --git a/stubs/tzlocal/tzlocal/windows_tz.pyi b/stubs/tzlocal/tzlocal/windows_tz.pyi new file mode 100644 index 000000000000..abefdd749ae0 --- /dev/null +++ b/stubs/tzlocal/tzlocal/windows_tz.pyi @@ -0,0 +1,5 @@ +from _typeshed import Incomplete + +win_tz: Incomplete +tz_names = win_tz +tz_win: Incomplete diff --git a/stubs/xxhash/xxhash/_xxhash.pyi b/stubs/xxhash/xxhash/_xxhash.pyi new file mode 100644 index 000000000000..9a19167d30cf --- /dev/null +++ b/stubs/xxhash/xxhash/_xxhash.pyi @@ -0,0 +1,72 @@ +from typing import Any + +XXHASH_VERSION: str + +class xxh32: + block_size: Any + digest_size: Any + digestsize: Any + name: Any + seed: Any + def __init__(self, *args, **kwargs) -> None: ... + def copy(self) -> xxh32object: ... + def digest(self) -> string: ... + def hexdigest(self) -> string: ... + def intdigest(self) -> int: ... + def reset(self) -> Any: ... + def update(self, input) -> Any: ... + +class xxh3_128: + block_size: Any + digest_size: Any + digestsize: Any + name: Any + seed: Any + def __init__(self, *args, **kwargs) -> None: ... + def copy(self) -> xxh3_128object: ... + def digest(self) -> string: ... + def hexdigest(self) -> string: ... + def intdigest(self) -> int: ... + def reset(self) -> Any: ... + def update(self, input) -> Any: ... + +class xxh3_64: + block_size: Any + digest_size: Any + digestsize: Any + name: Any + seed: Any + def __init__(self, *args, **kwargs) -> None: ... + def copy(self) -> xxh64object: ... + def digest(self) -> string: ... + def hexdigest(self) -> string: ... + def intdigest(self) -> int: ... + def reset(self) -> Any: ... + def update(self, input) -> Any: ... + +class xxh64: + block_size: Any + digest_size: Any + digestsize: Any + name: Any + seed: Any + def __init__(self, *args, **kwargs) -> None: ... + def copy(self) -> xxh64object: ... + def digest(self) -> string: ... + def hexdigest(self) -> string: ... + def intdigest(self) -> int: ... + def reset(self) -> Any: ... + def update(self, input) -> Any: ... + +def xxh32_digest(*args, **kwargs) -> Any: ... +def xxh32_hexdigest(*args, **kwargs) -> Any: ... +def xxh32_intdigest(*args, **kwargs) -> Any: ... +def xxh3_128_digest(*args, **kwargs) -> Any: ... +def xxh3_128_hexdigest(*args, **kwargs) -> Any: ... +def xxh3_128_intdigest(*args, **kwargs) -> Any: ... +def xxh3_64_digest(*args, **kwargs) -> Any: ... +def xxh3_64_hexdigest(*args, **kwargs) -> Any: ... +def xxh3_64_intdigest(*args, **kwargs) -> Any: ... +def xxh64_digest(*args, **kwargs) -> Any: ... +def xxh64_hexdigest(*args, **kwargs) -> Any: ... +def xxh64_intdigest(*args, **kwargs) -> Any: ... diff --git a/stubs/xxhash/xxhash/version.pyi b/stubs/xxhash/xxhash/version.pyi new file mode 100644 index 000000000000..b18bf8c3c23b --- /dev/null +++ b/stubs/xxhash/xxhash/version.pyi @@ -0,0 +1,4 @@ +from _typeshed import Incomplete + +VERSION: str +VERSION_TUPLE: Incomplete From 7b1d9305ee53d927bab1616fba33597c24ab19a9 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:30:49 -0700 Subject: [PATCH 02/17] remove some re-exports (via --export-less) --- stubs/pytz/pytz/tzfile.pyi | 2 -- stubs/stdlib-list/stdlib_list/fetch.pyi | 1 - stubs/tzlocal/tzlocal/unix.pyi | 2 -- stubs/tzlocal/tzlocal/utils.pyi | 1 - stubs/tzlocal/tzlocal/win32.pyi | 3 --- 5 files changed, 9 deletions(-) diff --git a/stubs/pytz/pytz/tzfile.pyi b/stubs/pytz/pytz/tzfile.pyi index 55187a84a1e5..5539e590e850 100644 --- a/stubs/pytz/pytz/tzfile.pyi +++ b/stubs/pytz/pytz/tzfile.pyi @@ -1,3 +1 @@ -from pytz.tzinfo import DstTzInfo as DstTzInfo, StaticTzInfo as StaticTzInfo, memorized_datetime as memorized_datetime, memorized_timedelta as memorized_timedelta, memorized_ttinfo as memorized_ttinfo - def build_tzinfo(zone, fp): ... diff --git a/stubs/stdlib-list/stdlib_list/fetch.pyi b/stubs/stdlib-list/stdlib_list/fetch.pyi index 957ba0df3815..e32644e28ccd 100644 --- a/stubs/stdlib-list/stdlib_list/fetch.pyi +++ b/stubs/stdlib-list/stdlib_list/fetch.pyi @@ -1,4 +1,3 @@ -from . import base_dir as base_dir, get_canonical_version as get_canonical_version, list_dir as list_dir, short_versions as short_versions from _typeshed import Incomplete class DummyConfig: diff --git a/stubs/tzlocal/tzlocal/unix.pyi b/stubs/tzlocal/tzlocal/unix.pyi index 609bbc5159e1..7120bb9d5e45 100644 --- a/stubs/tzlocal/tzlocal/unix.pyi +++ b/stubs/tzlocal/tzlocal/unix.pyi @@ -1,5 +1,3 @@ -from tzlocal import utils as utils - def get_localzone_name(): ... def get_localzone(): ... def reload_localzone(): ... diff --git a/stubs/tzlocal/tzlocal/utils.pyi b/stubs/tzlocal/tzlocal/utils.pyi index 31b6d8488f79..e47080fe1522 100644 --- a/stubs/tzlocal/tzlocal/utils.pyi +++ b/stubs/tzlocal/tzlocal/utils.pyi @@ -1,6 +1,5 @@ import pytz_deprecation_shim as pds from backports import zoneinfo -from tzlocal import windows_tz as windows_tz class ZoneInfoNotFoundError(pds.UnknownTimeZoneError, zoneinfo.ZoneInfoNotFoundError): ... diff --git a/stubs/tzlocal/tzlocal/win32.pyi b/stubs/tzlocal/tzlocal/win32.pyi index 90f33fa65c33..5b7297aa4e07 100644 --- a/stubs/tzlocal/tzlocal/win32.pyi +++ b/stubs/tzlocal/tzlocal/win32.pyi @@ -1,6 +1,3 @@ -from tzlocal import utils as utils -from tzlocal.windows_tz import win_tz as win_tz - def valuestodict(key): ... def get_localzone_name(): ... def get_localzone(): ... From c9a845d0d8dcb960a23014c1b7abe253808397e4 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:33:08 -0700 Subject: [PATCH 03/17] remove some stuff i don't care about --- stubs/retry/retry/compat.pyi | 1 - stubs/retry/retry/tests/test_retry.pyi | 3 -- stubs/xxhash/xxhash/_xxhash.pyi | 72 -------------------------- 3 files changed, 76 deletions(-) delete mode 100644 stubs/retry/retry/compat.pyi delete mode 100644 stubs/retry/retry/tests/test_retry.pyi delete mode 100644 stubs/xxhash/xxhash/_xxhash.pyi diff --git a/stubs/retry/retry/compat.pyi b/stubs/retry/retry/compat.pyi deleted file mode 100644 index 6b155eb0cb13..000000000000 --- a/stubs/retry/retry/compat.pyi +++ /dev/null @@ -1 +0,0 @@ -from decorator import decorator as decorator diff --git a/stubs/retry/retry/tests/test_retry.pyi b/stubs/retry/retry/tests/test_retry.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/retry/retry/tests/test_retry.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/xxhash/xxhash/_xxhash.pyi b/stubs/xxhash/xxhash/_xxhash.pyi deleted file mode 100644 index 9a19167d30cf..000000000000 --- a/stubs/xxhash/xxhash/_xxhash.pyi +++ /dev/null @@ -1,72 +0,0 @@ -from typing import Any - -XXHASH_VERSION: str - -class xxh32: - block_size: Any - digest_size: Any - digestsize: Any - name: Any - seed: Any - def __init__(self, *args, **kwargs) -> None: ... - def copy(self) -> xxh32object: ... - def digest(self) -> string: ... - def hexdigest(self) -> string: ... - def intdigest(self) -> int: ... - def reset(self) -> Any: ... - def update(self, input) -> Any: ... - -class xxh3_128: - block_size: Any - digest_size: Any - digestsize: Any - name: Any - seed: Any - def __init__(self, *args, **kwargs) -> None: ... - def copy(self) -> xxh3_128object: ... - def digest(self) -> string: ... - def hexdigest(self) -> string: ... - def intdigest(self) -> int: ... - def reset(self) -> Any: ... - def update(self, input) -> Any: ... - -class xxh3_64: - block_size: Any - digest_size: Any - digestsize: Any - name: Any - seed: Any - def __init__(self, *args, **kwargs) -> None: ... - def copy(self) -> xxh64object: ... - def digest(self) -> string: ... - def hexdigest(self) -> string: ... - def intdigest(self) -> int: ... - def reset(self) -> Any: ... - def update(self, input) -> Any: ... - -class xxh64: - block_size: Any - digest_size: Any - digestsize: Any - name: Any - seed: Any - def __init__(self, *args, **kwargs) -> None: ... - def copy(self) -> xxh64object: ... - def digest(self) -> string: ... - def hexdigest(self) -> string: ... - def intdigest(self) -> int: ... - def reset(self) -> Any: ... - def update(self, input) -> Any: ... - -def xxh32_digest(*args, **kwargs) -> Any: ... -def xxh32_hexdigest(*args, **kwargs) -> Any: ... -def xxh32_intdigest(*args, **kwargs) -> Any: ... -def xxh3_128_digest(*args, **kwargs) -> Any: ... -def xxh3_128_hexdigest(*args, **kwargs) -> Any: ... -def xxh3_128_intdigest(*args, **kwargs) -> Any: ... -def xxh3_64_digest(*args, **kwargs) -> Any: ... -def xxh3_64_hexdigest(*args, **kwargs) -> Any: ... -def xxh3_64_intdigest(*args, **kwargs) -> Any: ... -def xxh64_digest(*args, **kwargs) -> Any: ... -def xxh64_hexdigest(*args, **kwargs) -> Any: ... -def xxh64_intdigest(*args, **kwargs) -> Any: ... From 797129a439c5c2dcceba9a4d6bf454d568583390 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:43:30 -0700 Subject: [PATCH 04/17] formatting --- stubs/pytz/pytz/reference.pyi | 2 ++ stubs/stdlib-list/stdlib_list/fetch.pyi | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/stubs/pytz/pytz/reference.pyi b/stubs/pytz/pytz/reference.pyi index f1c4e64a1768..c224f10839f6 100644 --- a/stubs/pytz/pytz/reference.pyi +++ b/stubs/pytz/pytz/reference.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete from datetime import tzinfo + from pytz import UTC as UTC class FixedOffset(tzinfo): @@ -7,6 +8,7 @@ class FixedOffset(tzinfo): def utcoffset(self, dt): ... def tzname(self, dt): ... def dst(self, dt): ... + DSTOFFSET = STDOFFSET class LocalTimezone(tzinfo): diff --git a/stubs/stdlib-list/stdlib_list/fetch.pyi b/stubs/stdlib-list/stdlib_list/fetch.pyi index e32644e28ccd..7b2759716cdb 100644 --- a/stubs/stdlib-list/stdlib_list/fetch.pyi +++ b/stubs/stdlib-list/stdlib_list/fetch.pyi @@ -6,7 +6,12 @@ class DummyConfig: intersphinx_timeout: Incomplete user_agent: str tls_verify: bool - def __init__(self, intersphinx_mapping: Incomplete | None = ..., intersphinx_cache_limit: int = ..., intersphinx_timeout: Incomplete | None = ...) -> None: ... + def __init__( + self, + intersphinx_mapping: Incomplete | None = ..., + intersphinx_cache_limit: int = ..., + intersphinx_timeout: Incomplete | None = ..., + ) -> None: ... class DummyApp: srcdir: Incomplete From 873c5594a84cea9cc5f1a495dc0b71a6127ff1e0 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:43:36 -0700 Subject: [PATCH 05/17] fix tzlocal stuff --- stubs/tzlocal/tzlocal/utils.pyi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stubs/tzlocal/tzlocal/utils.pyi b/stubs/tzlocal/tzlocal/utils.pyi index e47080fe1522..bffd596cd8bf 100644 --- a/stubs/tzlocal/tzlocal/utils.pyi +++ b/stubs/tzlocal/tzlocal/utils.pyi @@ -1,7 +1,12 @@ -import pytz_deprecation_shim as pds -from backports import zoneinfo +import pytz -class ZoneInfoNotFoundError(pds.UnknownTimeZoneError, zoneinfo.ZoneInfoNotFoundError): ... +if sys.version_info >= (3, 9): + import zoneinfo + + class ZoneInfoNotFoundError(pytz.UnknownTimeZoneError, zoneinfo.ZoneInfoNotFoundError): ... + +else: + class ZoneInfoNotFoundError(pytz.UnknownTimeZoneError): ... def get_system_offset(): ... def get_tz_offset(tz): ... From fe480ffe67eb005dd482242687781bdf336081b9 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:44:51 -0700 Subject: [PATCH 06/17] fix pytz reference --- stubs/pytz/pytz/reference.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stubs/pytz/pytz/reference.pyi b/stubs/pytz/pytz/reference.pyi index c224f10839f6..34ad7644d2d4 100644 --- a/stubs/pytz/pytz/reference.pyi +++ b/stubs/pytz/pytz/reference.pyi @@ -1,3 +1,4 @@ +import datetime from _typeshed import Incomplete from datetime import tzinfo @@ -9,7 +10,8 @@ class FixedOffset(tzinfo): def tzname(self, dt): ... def dst(self, dt): ... -DSTOFFSET = STDOFFSET +STDOFFSET: datetime.timedelta +DSTOFFSET: datetime.timedelta class LocalTimezone(tzinfo): def utcoffset(self, dt): ... From 8d1ea8d26886e39d35c8103a6eedcf6e9ef42b4e Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 12:54:19 -0700 Subject: [PATCH 07/17] fixup --- stubs/pytz/pytz/lazy.pyi | 2 +- stubs/tzlocal/tzlocal/utils.pyi | 2 ++ stubs/tzlocal/tzlocal/windows_tz.pyi | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/pytz/pytz/lazy.pyi b/stubs/pytz/pytz/lazy.pyi index 7dee2d54bab8..7f58b995cae9 100644 --- a/stubs/pytz/pytz/lazy.pyi +++ b/stubs/pytz/pytz/lazy.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections import Mapping as DictMixin +from collections.abc import Mapping as DictMixin class LazyDict(DictMixin): data: Incomplete diff --git a/stubs/tzlocal/tzlocal/utils.pyi b/stubs/tzlocal/tzlocal/utils.pyi index bffd596cd8bf..37e42d31c487 100644 --- a/stubs/tzlocal/tzlocal/utils.pyi +++ b/stubs/tzlocal/tzlocal/utils.pyi @@ -1,3 +1,5 @@ +import sys + import pytz if sys.version_info >= (3, 9): diff --git a/stubs/tzlocal/tzlocal/windows_tz.pyi b/stubs/tzlocal/tzlocal/windows_tz.pyi index abefdd749ae0..448a3f6fe243 100644 --- a/stubs/tzlocal/tzlocal/windows_tz.pyi +++ b/stubs/tzlocal/tzlocal/windows_tz.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete win_tz: Incomplete -tz_names = win_tz +tz_names: Incomplete tz_win: Incomplete From a153d4f22cc344d5be60da2550d96880a3b04984 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:02:53 -0700 Subject: [PATCH 08/17] delete problematic stubs --- stubs/stdlib-list/stdlib_list/fetch.pyi | 23 ----------------------- stubs/tzlocal/tzlocal/unix.pyi | 3 --- stubs/tzlocal/tzlocal/win32.pyi | 4 ---- 3 files changed, 30 deletions(-) delete mode 100644 stubs/stdlib-list/stdlib_list/fetch.pyi delete mode 100644 stubs/tzlocal/tzlocal/unix.pyi delete mode 100644 stubs/tzlocal/tzlocal/win32.pyi diff --git a/stubs/stdlib-list/stdlib_list/fetch.pyi b/stubs/stdlib-list/stdlib_list/fetch.pyi deleted file mode 100644 index 7b2759716cdb..000000000000 --- a/stubs/stdlib-list/stdlib_list/fetch.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from _typeshed import Incomplete - -class DummyConfig: - intersphinx_mapping: Incomplete - intersphinx_cache_limit: Incomplete - intersphinx_timeout: Incomplete - user_agent: str - tls_verify: bool - def __init__( - self, - intersphinx_mapping: Incomplete | None = ..., - intersphinx_cache_limit: int = ..., - intersphinx_timeout: Incomplete | None = ..., - ) -> None: ... - -class DummyApp: - srcdir: Incomplete - warn: Incomplete - config: Incomplete - def __init__(self) -> None: ... - def info(self, msg) -> None: ... - -def fetch_list(version: Incomplete | None = ...) -> None: ... diff --git a/stubs/tzlocal/tzlocal/unix.pyi b/stubs/tzlocal/tzlocal/unix.pyi deleted file mode 100644 index 7120bb9d5e45..000000000000 --- a/stubs/tzlocal/tzlocal/unix.pyi +++ /dev/null @@ -1,3 +0,0 @@ -def get_localzone_name(): ... -def get_localzone(): ... -def reload_localzone(): ... diff --git a/stubs/tzlocal/tzlocal/win32.pyi b/stubs/tzlocal/tzlocal/win32.pyi deleted file mode 100644 index 5b7297aa4e07..000000000000 --- a/stubs/tzlocal/tzlocal/win32.pyi +++ /dev/null @@ -1,4 +0,0 @@ -def valuestodict(key): ... -def get_localzone_name(): ... -def get_localzone(): ... -def reload_localzone(): ... From 0a4ae981bdb9a1c690c804609a0db90fbfa492d3 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:02:58 -0700 Subject: [PATCH 09/17] oops, wrong emoji version --- stubs/emoji/emoji/unicode_codes/data_dict.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/emoji/emoji/unicode_codes/data_dict.pyi b/stubs/emoji/emoji/unicode_codes/data_dict.pyi index 1abbab7b0993..46c28062717f 100644 --- a/stubs/emoji/emoji/unicode_codes/data_dict.pyi +++ b/stubs/emoji/emoji/unicode_codes/data_dict.pyi @@ -1,5 +1,4 @@ from _typeshed import Incomplete STATUS: Incomplete -LANGUAGES: Incomplete EMOJI_DATA: Incomplete From 46bd0983883defd0518875e19bd6cd704825a4ef Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:05:15 -0700 Subject: [PATCH 10/17] fix some more problems --- stubs/DateTimeRange/datetimerange/__version__.pyi | 2 ++ stubs/editdistance/editdistance/bycython.pyi | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stubs/DateTimeRange/datetimerange/__version__.pyi b/stubs/DateTimeRange/datetimerange/__version__.pyi index 5f47a566505a..18e785877ffd 100644 --- a/stubs/DateTimeRange/datetimerange/__version__.pyi +++ b/stubs/DateTimeRange/datetimerange/__version__.pyi @@ -1,3 +1,5 @@ from _typeshed import Incomplete __maintainer__: Incomplete +__email__: str +__license__: str diff --git a/stubs/editdistance/editdistance/bycython.pyi b/stubs/editdistance/editdistance/bycython.pyi index 0468d7436ba7..a1472e3a24f1 100644 --- a/stubs/editdistance/editdistance/bycython.pyi +++ b/stubs/editdistance/editdistance/bycython.pyi @@ -1,3 +1,4 @@ -from typing import Any +from _typeshed import Incomplete -def eval(*args, **kwargs) -> Any: ... +def eval(*args, **kwargs) -> Incomplete: ... +__test__: dict[Incomplete, Incomplete] From 2d0f9c960d5d38f9eb3eaf40268cf811a7a36cd7 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:12:46 -0700 Subject: [PATCH 11/17] fix some more ci --- pyrightconfig.stricter.json | 5 +++++ stubs/click-spinner/click_spinner/_version.pyi | 4 +++- stubs/stdlib-list/stdlib_list/_version.pyi | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 1dcb9086cd14..f9b1cf0df16f 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -25,6 +25,7 @@ "stdlib/xml/sax", "stubs/aiofiles/aiofiles/tempfile/temptypes.pyi", "stubs/aiofiles/aiofiles/threadpool/utils.pyi", + "stubs/annoy/annoy/annoylib.pyi", "stubs/aws-xray-sdk", "stubs/babel", "stubs/backports.ssl_match_hostname", @@ -56,6 +57,9 @@ "stubs/paramiko", "stubs/prettytable", "stubs/protobuf", + "stubs/pytz/pytz/lazy.pyi", + "stubs/pytz/pytz/reference.pyi", + "stubs/pytz/pytz/tzfile.pyi", "stubs/google-cloud-ndb", "stubs/passlib", "stubs/pep8-naming", @@ -78,6 +82,7 @@ "stubs/SQLAlchemy", "stubs/stripe", "stubs/tqdm", + "stubs/tzlocal/tzlocal/utils.pyi", "stubs/ttkthemes", "stubs/urllib3", "stubs/vobject" diff --git a/stubs/click-spinner/click_spinner/_version.pyi b/stubs/click-spinner/click_spinner/_version.pyi index 85ddc0d3f0a4..feb0b1653bab 100644 --- a/stubs/click-spinner/click_spinner/_version.pyi +++ b/stubs/click-spinner/click_spinner/_version.pyi @@ -1,3 +1,5 @@ +from typing import Any + version_json: str -def get_versions(): ... +def get_versions() -> dict[str, Any]: ... diff --git a/stubs/stdlib-list/stdlib_list/_version.pyi b/stubs/stdlib-list/stdlib_list/_version.pyi index 85ddc0d3f0a4..feb0b1653bab 100644 --- a/stubs/stdlib-list/stdlib_list/_version.pyi +++ b/stubs/stdlib-list/stdlib_list/_version.pyi @@ -1,3 +1,5 @@ +from typing import Any + version_json: str -def get_versions(): ... +def get_versions() -> dict[str, Any]: ... From 28ed1e4066d38098f6289143ebddccff639adf0e Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:13:06 -0700 Subject: [PATCH 12/17] reformat --- stubs/editdistance/editdistance/bycython.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/editdistance/editdistance/bycython.pyi b/stubs/editdistance/editdistance/bycython.pyi index a1472e3a24f1..24fc9933d789 100644 --- a/stubs/editdistance/editdistance/bycython.pyi +++ b/stubs/editdistance/editdistance/bycython.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete def eval(*args, **kwargs) -> Incomplete: ... + __test__: dict[Incomplete, Incomplete] From e67b0b03426fcf528a5f2e821fe077cd3307184a Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:16:59 -0700 Subject: [PATCH 13/17] hush now pyright --- pyrightconfig.stricter.json | 1 + 1 file changed, 1 insertion(+) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index f9b1cf0df16f..cfc6dc59457d 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -39,6 +39,7 @@ "stubs/dateparser", "stubs/dj-database-url", "stubs/docutils", + "stubs/editdistance/editdistance/bycython.pyi", "stubs/Flask-SQLAlchemy", "stubs/fpdf2", "stubs/html5lib", From ea95d296e6f2f09cfa387ce6ab0e3f8e918e4ccf Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 17 Jul 2022 13:21:03 -0700 Subject: [PATCH 14/17] more pyright --- stubs/pytz/pytz/lazy.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/pytz/pytz/lazy.pyi b/stubs/pytz/pytz/lazy.pyi index 7f58b995cae9..77ba8b6b5a19 100644 --- a/stubs/pytz/pytz/lazy.pyi +++ b/stubs/pytz/pytz/lazy.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Mapping as DictMixin -class LazyDict(DictMixin): +class LazyDict(DictMixin[Incomplete, Incomplete]): data: Incomplete def __getitem__(self, key): ... def __contains__(self, key): ... @@ -9,8 +9,8 @@ class LazyDict(DictMixin): def __len__(self): ... def keys(self): ... -class LazyList(list): +class LazyList(list[Incomplete]): def __new__(cls, fill_iter: Incomplete | None = ...): ... -class LazySet(set): +class LazySet(set[Incomplete]): def __new__(cls, fill_iter: Incomplete | None = ...): ... From dc8cf7185133f07bccc8f8522b745b449b94c5af Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Mon, 18 Jul 2022 19:26:52 -0700 Subject: [PATCH 15/17] Apply suggestions from code review Co-authored-by: Alex Waygood --- stubs/DateTimeRange/datetimerange/__version__.pyi | 2 +- stubs/pytz/pytz/reference.pyi | 8 ++++---- stubs/tzlocal/tzlocal/windows_tz.pyi | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/stubs/DateTimeRange/datetimerange/__version__.pyi b/stubs/DateTimeRange/datetimerange/__version__.pyi index 18e785877ffd..fe363a6023ae 100644 --- a/stubs/DateTimeRange/datetimerange/__version__.pyi +++ b/stubs/DateTimeRange/datetimerange/__version__.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -__maintainer__: Incomplete +__maintainer__: str __email__: str __license__: str diff --git a/stubs/pytz/pytz/reference.pyi b/stubs/pytz/pytz/reference.pyi index 34ad7644d2d4..b3a5d4db0575 100644 --- a/stubs/pytz/pytz/reference.pyi +++ b/stubs/pytz/pytz/reference.pyi @@ -28,7 +28,7 @@ class USTimeZone(tzinfo): def utcoffset(self, dt): ... def dst(self, dt): ... -Eastern: Incomplete -Central: Incomplete -Mountain: Incomplete -Pacific: Incomplete +Eastern: USTimeZone +Central: USTimeZone +Mountain: USTimeZone +Pacific: USTimeZone diff --git a/stubs/tzlocal/tzlocal/windows_tz.pyi b/stubs/tzlocal/tzlocal/windows_tz.pyi index 448a3f6fe243..9ff7d81d7c3d 100644 --- a/stubs/tzlocal/tzlocal/windows_tz.pyi +++ b/stubs/tzlocal/tzlocal/windows_tz.pyi @@ -1,5 +1,3 @@ -from _typeshed import Incomplete - -win_tz: Incomplete -tz_names: Incomplete -tz_win: Incomplete +win_tz: dict[str, str] +tz_names: dict[str, str] +tz_win: dict[str, str] From a681c055dbee9e27a7cdea6d1191b9cfe1320684 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Mon, 18 Jul 2022 19:27:53 -0700 Subject: [PATCH 16/17] unannotate --- stubs/annoy/annoy/annoylib.pyi | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/stubs/annoy/annoy/annoylib.pyi b/stubs/annoy/annoy/annoylib.pyi index 6df9297d87b0..41d2fe2ae336 100644 --- a/stubs/annoy/annoy/annoylib.pyi +++ b/stubs/annoy/annoy/annoylib.pyi @@ -1,20 +1,20 @@ -from typing import Any +from _typeshed import Incomplete class Annoy: - f: Any + f: Incomplete def __init__(self, *args, **kwargs) -> None: ... - def add_item(self, *args, **kwargs) -> Any: ... - def build(self, *args, **kwargs) -> Any: ... - def get_distance(self, *args, **kwargs) -> Any: ... - def get_item_vector(self, *args, **kwargs) -> Any: ... - def get_n_items(self, *args, **kwargs) -> Any: ... - def get_n_trees(self, *args, **kwargs) -> Any: ... - def get_nns_by_item(self, *args, **kwargs) -> Any: ... - def get_nns_by_vector(self, *args, **kwargs) -> Any: ... - def load(self, *args, **kwargs) -> Any: ... - def on_disk_build(self, *args, **kwargs) -> Any: ... - def save(self, *args, **kwargs) -> Any: ... - def set_seed(self, *args, **kwargs) -> Any: ... - def unbuild(self, *args, **kwargs) -> Any: ... - def unload(self, *args, **kwargs) -> Any: ... - def verbose(self, *args, **kwargs) -> Any: ... + def add_item(self, *args, **kwargs): ... + def build(self, *args, **kwargs): ... + def get_distance(self, *args, **kwargs): ... + def get_item_vector(self, *args, **kwargs): ... + def get_n_items(self, *args, **kwargs): ... + def get_n_trees(self, *args, **kwargs): ... + def get_nns_by_item(self, *args, **kwargs): ... + def get_nns_by_vector(self, *args, **kwargs): ... + def load(self, *args, **kwargs): ... + def on_disk_build(self, *args, **kwargs): ... + def save(self, *args, **kwargs): ... + def set_seed(self, *args, **kwargs): ... + def unbuild(self, *args, **kwargs): ... + def unload(self, *args, **kwargs): ... + def verbose(self, *args, **kwargs): ... From beb4e66439ecefb38fa3689561169a792be873ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Jul 2022 02:28:08 +0000 Subject: [PATCH 17/17] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/DateTimeRange/datetimerange/__version__.pyi | 2 -- 1 file changed, 2 deletions(-) diff --git a/stubs/DateTimeRange/datetimerange/__version__.pyi b/stubs/DateTimeRange/datetimerange/__version__.pyi index fe363a6023ae..afe5f0868b25 100644 --- a/stubs/DateTimeRange/datetimerange/__version__.pyi +++ b/stubs/DateTimeRange/datetimerange/__version__.pyi @@ -1,5 +1,3 @@ -from _typeshed import Incomplete - __maintainer__: str __email__: str __license__: str