diff --git a/changelog/+bump-whenever.housekeeping.md b/changelog/+bump-whenever.housekeeping.md new file mode 100644 index 00000000..2c48c941 --- /dev/null +++ b/changelog/+bump-whenever.housekeeping.md @@ -0,0 +1 @@ +Bump `whenever` dependency to `>=0.10.0,<0.11.0` diff --git a/infrahub_sdk/timestamp.py b/infrahub_sdk/timestamp.py index fd69122e..21d59f9d 100644 --- a/infrahub_sdk/timestamp.py +++ b/infrahub_sdk/timestamp.py @@ -37,7 +37,7 @@ def __init__(self, value: str | ZonedDateTime | Timestamp | None = None) -> None elif isinstance(value, str): self._obj = self._parse_string(value) else: - self._obj = ZonedDateTime.now("UTC").round(unit="microsecond") + self._obj = ZonedDateTime.now("UTC").round("microsecond") @property def obj(self) -> ZonedDateTime: @@ -114,7 +114,7 @@ def to_timestamp(self) -> int: return self._obj.timestamp() def to_datetime(self) -> datetime: - return self._obj.py_datetime() + return self._obj.to_stdlib() def get_obj(self) -> ZonedDateTime: return self._obj diff --git a/pyproject.toml b/pyproject.toml index b0a00a19..00e3f33b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "httpx>=0.20", "ujson>=5", "dulwich>=0.24.7", - "whenever>=0.9.3,<0.10.0", + "whenever>=0.10.0,<0.11.0", "netutils>=1.0.0", "tomli>=1.1.0; python_version<'3.11'", ]