Skip to content

Commit 6fb14c9

Browse files
authored
[lunardate] Update to 0.3.* (#16032)
1 parent e7b8700 commit 6fb14c9

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

stubs/lunardate/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "0.2.*"
1+
version = "0.3.*"
22
upstream-repository = "https://github.com/lidaobing/python-lunardate"

stubs/lunardate/lunardate.pyi

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
2-
from _typeshed import ConvertibleToInt
32
from typing import Final, SupportsIndex, overload
3+
from typing_extensions import deprecated
44

55
__version__: Final[str]
66
__all__ = ["LunarDate"]
@@ -9,13 +9,24 @@ class LunarDate:
99
year: int
1010
month: int
1111
day: int
12-
isLeapMonth: bool
13-
def __init__(self, year: int, month: int, day: int, isLeapMonth: bool | None = False) -> None: ...
12+
is_leap_month: bool
13+
def __init__(self, year: int, month: int, day: int, is_leap_month: bool | None = False) -> None: ...
14+
@property
15+
@deprecated("The `isLeapMonth` is deprecated since v0.3.0. Use `is_leap_month` instead.")
16+
def isLeapMonth(self) -> bool: ...
1417
@staticmethod
18+
@deprecated("The `leapMonthForYear` is deprecated since v0.3.0. Use `leap_month_for_year` instead.")
1519
def leapMonthForYear(year: int) -> int | None: ...
1620
@staticmethod
21+
def leap_month_for_year(year: int) -> int | None: ...
22+
@staticmethod
23+
@deprecated("The `fromSolarDate` is deprecated since v0.3.0. Use `from_solar_date` instead.")
1724
def fromSolarDate(year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> LunarDate: ...
25+
@staticmethod
26+
def from_solar_date(year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> LunarDate: ...
27+
@deprecated("The `toSolarDate` is deprecated since v0.3.0. Use `to_solar_date` instead.")
1828
def toSolarDate(self) -> datetime.date: ...
29+
def to_solar_date(self) -> datetime.date: ...
1930

2031
@overload
2132
def __sub__(self, other: LunarDate | datetime.date) -> datetime.timedelta: ...
@@ -33,10 +44,10 @@ class LunarDate:
3344
@classmethod
3445
def today(cls) -> LunarDate: ...
3546

36-
yearInfos: Final[list[int]]
47+
YEAR_INFOS: Final[list[int]]
3748

38-
def yearInfo2yearDay(yearInfo: ConvertibleToInt) -> int: ...
49+
def year_info_to_year_day(year_info: int) -> int: ...
3950

40-
yearDays: Final[list[int]]
51+
YEAR_DAYS: Final[list[int]]
4152

42-
def day2LunarDate(offset: ConvertibleToInt) -> None: ...
53+
def day_to_lunar_date(offset: int) -> None: ...

0 commit comments

Comments
 (0)