From 0eb7083f0e1074a4cd571b366bc3373c1547d25f Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 23 Dec 2017 06:38:55 -0800 Subject: [PATCH] move dateutil into 2and3 (#1743) These stubs are identical since #1735. --- .../{2 => 2and3}/dateutil/__init__.pyi | 0 third_party/{2 => 2and3}/dateutil/parser.pyi | 0 .../{2 => 2and3}/dateutil/relativedelta.pyi | 0 .../{2 => 2and3}/dateutil/tz/__init__.pyi | 0 .../{2 => 2and3}/dateutil/tz/_common.pyi | 0 third_party/{2 => 2and3}/dateutil/tz/tz.pyi | 0 third_party/3/dateutil/__init__.pyi | 0 third_party/3/dateutil/parser.pyi | 45 ---------- third_party/3/dateutil/relativedelta.pyi | 83 ------------------- third_party/3/dateutil/tz/__init__.pyi | 12 --- third_party/3/dateutil/tz/_common.pyi | 24 ------ third_party/3/dateutil/tz/tz.pyi | 83 ------------------- 12 files changed, 247 deletions(-) rename third_party/{2 => 2and3}/dateutil/__init__.pyi (100%) rename third_party/{2 => 2and3}/dateutil/parser.pyi (100%) rename third_party/{2 => 2and3}/dateutil/relativedelta.pyi (100%) rename third_party/{2 => 2and3}/dateutil/tz/__init__.pyi (100%) rename third_party/{2 => 2and3}/dateutil/tz/_common.pyi (100%) rename third_party/{2 => 2and3}/dateutil/tz/tz.pyi (100%) delete mode 100644 third_party/3/dateutil/__init__.pyi delete mode 100644 third_party/3/dateutil/parser.pyi delete mode 100644 third_party/3/dateutil/relativedelta.pyi delete mode 100644 third_party/3/dateutil/tz/__init__.pyi delete mode 100644 third_party/3/dateutil/tz/_common.pyi delete mode 100644 third_party/3/dateutil/tz/tz.pyi diff --git a/third_party/2/dateutil/__init__.pyi b/third_party/2and3/dateutil/__init__.pyi similarity index 100% rename from third_party/2/dateutil/__init__.pyi rename to third_party/2and3/dateutil/__init__.pyi diff --git a/third_party/2/dateutil/parser.pyi b/third_party/2and3/dateutil/parser.pyi similarity index 100% rename from third_party/2/dateutil/parser.pyi rename to third_party/2and3/dateutil/parser.pyi diff --git a/third_party/2/dateutil/relativedelta.pyi b/third_party/2and3/dateutil/relativedelta.pyi similarity index 100% rename from third_party/2/dateutil/relativedelta.pyi rename to third_party/2and3/dateutil/relativedelta.pyi diff --git a/third_party/2/dateutil/tz/__init__.pyi b/third_party/2and3/dateutil/tz/__init__.pyi similarity index 100% rename from third_party/2/dateutil/tz/__init__.pyi rename to third_party/2and3/dateutil/tz/__init__.pyi diff --git a/third_party/2/dateutil/tz/_common.pyi b/third_party/2and3/dateutil/tz/_common.pyi similarity index 100% rename from third_party/2/dateutil/tz/_common.pyi rename to third_party/2and3/dateutil/tz/_common.pyi diff --git a/third_party/2/dateutil/tz/tz.pyi b/third_party/2and3/dateutil/tz/tz.pyi similarity index 100% rename from third_party/2/dateutil/tz/tz.pyi rename to third_party/2and3/dateutil/tz/tz.pyi diff --git a/third_party/3/dateutil/__init__.pyi b/third_party/3/dateutil/__init__.pyi deleted file mode 100644 index e69de29bb..000000000 diff --git a/third_party/3/dateutil/parser.pyi b/third_party/3/dateutil/parser.pyi deleted file mode 100644 index f7b90b0e3..000000000 --- a/third_party/3/dateutil/parser.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text -from datetime import datetime, tzinfo - -_FileOrStr = Union[bytes, Text, IO[str], IO[Any]] - -__all__ = ... # type: List[str] - -class parserinfo(object): - JUMP = ... # type: List[str] - WEEKDAYS = ... # type: List[Tuple[str, str]] - MONTHS = ... # type: List[Tuple[str, str]] - HMS = ... # type: List[Tuple[str, str, str]] - AMPM = ... # type: List[Tuple[str, str]] - UTCZONE = ... # type: List[str] - PERTAIN = ... # type: List[str] - TZOFFSET = ... # type: Dict[str, int] - - def __init__(self, dayfirst: bool=..., yearfirst: bool=...) -> None: ... - def jump(self, name: Text) -> bool: ... - def weekday(self, name: Text) -> Optional[int]: ... - def month(self, name: Text) -> Optional[int]: ... - def hms(self, name: Text) -> Optional[int]: ... - def ampm(self, name: Text) -> Optional[int]: ... - def pertain(self, name: Text) -> bool: ... - def utczone(self, name: Text) -> bool: ... - def tzoffset(self, name: Text) -> Optional[int]: ... - def convertyear(self, year: int) -> int: ... - def validate(self, res: datetime) -> bool: ... - -class parser(object): - def __init__(self, info: Optional[parserinfo] = ...) -> None: ... - def parse(self, timestr: _FileOrStr, - default: Optional[datetime] = ..., - ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ..., - **kwargs: Any) -> datetime: ... - -DEFAULTPARSER = ... # type: parser -def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ... -class _tzparser: ... - -DEFAULTTZPARSER = ... # type: _tzparser - -class InvalidDatetimeError(ValueError): ... -class InvalidDateError(InvalidDatetimeError): ... -class InvalidTimeError(InvalidDatetimeError): ... diff --git a/third_party/3/dateutil/relativedelta.pyi b/third_party/3/dateutil/relativedelta.pyi deleted file mode 100644 index 71b3aeeff..000000000 --- a/third_party/3/dateutil/relativedelta.pyi +++ /dev/null @@ -1,83 +0,0 @@ -from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union -from datetime import date, datetime, timedelta - -__all__ = ... # type: List[str] - -_SelfT = TypeVar('_SelfT', bound=relativedelta) -_DateT = TypeVar('_DateT', date, datetime) - - -class weekday(object): - def __init__(self, weekday: int, n: Optional[int]=...) -> None: ... - - def __call__(self, n: int) -> 'weekday': ... - - def __eq__(self, other) -> bool: ... - - def __repr__(self) -> str: ... - - weekday = ... # type: int - n = ... # type: int - -MO = ... # type: weekday -TU = ... # type: weekday -WE = ... # type: weekday -TH = ... # type: weekday -FR = ... # type: weekday -SA = ... # type: weekday -SU = ... # type: weekday - - -class relativedelta(object): - def __init__(self, - dt1: Optional[date]=..., - dt2: Optional[date]=..., - years: Optional[int]=..., months: Optional[int]=..., - days: Optional[int]=..., leapdays: Optional[int]=..., - weeks: Optional[int]=..., - hours: Optional[int]=..., minutes: Optional[int]=..., - seconds: Optional[int]=..., microseconds: Optional[int]=..., - year: Optional[int]=..., month: Optional[int]=..., - day: Optional[int]=..., - weekday: Optional[Union[int, weekday]]=..., - yearday: Optional[int]=..., - nlyearday: Optional[int]=..., - hour: Optional[int]=..., minute: Optional[int]=..., - second: Optional[int]=..., - microsecond: Optional[int]=...) -> None: ... - @property - def weeks(self) -> int: ... - @weeks.setter - def weeks(self, value: int) -> None: ... - def normalized(self: _SelfT) -> _SelfT: ... - # TODO: use Union when mypy will handle it properly in overloaded operator - # methods (#2129, #1442, #1264 in mypy) - @overload - def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ... - @overload - def __add__(self: _SelfT, other: timedelta) -> _SelfT: ... - @overload - def __add__(self, other: _DateT) -> _DateT: ... - @overload - def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ... - @overload - def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ... - @overload - def __radd__(self, other: _DateT) -> _DateT: ... - @overload - def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ... - @overload - def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ... - @overload - def __rsub__(self, other: _DateT) -> _DateT: ... - def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ... - def __neg__(self: _SelfT) -> _SelfT: ... - def __bool__(self) -> bool: ... - def __nonzero__(self) -> bool: ... - def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... - def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... - def __eq__(self, other) -> bool: ... - def __ne__(self, other: object) -> bool: ... - def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... - def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... - def __repr__(self) -> str: ... diff --git a/third_party/3/dateutil/tz/__init__.pyi b/third_party/3/dateutil/tz/__init__.pyi deleted file mode 100644 index 68cfb9e2b..000000000 --- a/third_party/3/dateutil/tz/__init__.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from .tz import ( - tzutc as tzutc, - tzoffset as tzoffset, - tzlocal as tzlocal, - tzfile as tzfile, - tzrange as tzrange, - tzstr as tzstr, - tzical as tzical, - gettz as gettz, - datetime_exists as datetime_exists, - datetime_ambiguous as datetime_ambiguous, -) diff --git a/third_party/3/dateutil/tz/_common.pyi b/third_party/3/dateutil/tz/_common.pyi deleted file mode 100644 index 383218d60..000000000 --- a/third_party/3/dateutil/tz/_common.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Any, Optional -from datetime import datetime, tzinfo, timedelta - -def tzname_in_python2(namefunc): ... -def enfold(dt: datetime, fold: int = ...): ... - -class _DatetimeWithFold(datetime): - @property - def fold(self): ... - -class _tzinfo(tzinfo): - def is_ambiguous(self, dt: datetime) -> bool: ... - def fromutc(self, dt: datetime) -> datetime: ... - -class tzrangebase(_tzinfo): - def __init__(self) -> None: ... - def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... - def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... - def tzname(self, dt: Optional[datetime]) -> str: ... - def fromutc(self, dt: datetime) -> datetime: ... - def is_ambiguous(self, dt: datetime) -> bool: ... - __hash__ = ... # type: Any - def __ne__(self, other): ... - __reduce__ = ... # type: Any diff --git a/third_party/3/dateutil/tz/tz.pyi b/third_party/3/dateutil/tz/tz.pyi deleted file mode 100644 index 5fbc932bb..000000000 --- a/third_party/3/dateutil/tz/tz.pyi +++ /dev/null @@ -1,83 +0,0 @@ -from typing import Any, Optional, Union, IO, Text, Tuple, List -import datetime -from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo -from ._common import tzrangebase as tzrangebase, enfold as enfold -from ..relativedelta import relativedelta - -_FileObj = Union[str, Text, IO[str], IO[Text]] - -ZERO = ... # type: datetime.timedelta -EPOCH = ... # type: datetime.datetime -EPOCHORDINAL = ... # type: int - -class tzutc(datetime.tzinfo): - def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def tzname(self, dt: Optional[datetime.datetime]) -> str: ... - def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... - def __eq__(self, other): ... - __hash__ = ... # type: Any - def __ne__(self, other): ... - __reduce__ = ... # type: Any - -class tzoffset(datetime.tzinfo): - def __init__(self, name, offset) -> None: ... - def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... - def tzname(self, dt: Optional[datetime.datetime]) -> str: ... - def __eq__(self, other): ... - __hash__ = ... # type: Any - def __ne__(self, other): ... - __reduce__ = ... # type: Any - -class tzlocal(_tzinfo): - def __init__(self) -> None: ... - def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def tzname(self, dt: Optional[datetime.datetime]) -> str: ... - def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... - def __eq__(self, other): ... - __hash__ = ... # type: Any - def __ne__(self, other): ... - __reduce__ = ... # type: Any - -class _ttinfo: - def __init__(self) -> None: ... - def __eq__(self, other): ... - __hash__ = ... # type: Any - def __ne__(self, other): ... - -class tzfile(_tzinfo): - def __init__(self, fileobj: _FileObj, filename: Optional[Text] = ...) -> None: ... - def is_ambiguous(self, dt: Optional[datetime.datetime], idx: Optional[int] = ...) -> bool: ... - def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... - def tzname(self, dt: Optional[datetime.datetime]) -> str: ... - def __eq__(self, other): ... - __hash__ = ... # type: Any - def __ne__(self, other): ... - def __reduce__(self): ... - def __reduce_ex__(self, protocol): ... - -class tzrange(tzrangebase): - hasdst = ... # type: bool - def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ... - def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ... - def __eq__(self, other): ... - -class tzstr(tzrange): - hasdst = ... # type: bool - def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ... - -class tzical: - def __init__(self, fileobj: _FileObj) -> None: ... - def keys(self): ... - def get(self, tzid: Optional[Any] = ...): ... - -TZFILES = ... # type: List[str] -TZPATHS = ... # type: List[str] - -def gettz(name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ... -def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... -def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ...