diff --git a/README.md b/README.md index 6cbfecc..6040e40 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ API docs: https://cloud.yandex.com/en/docs/tracker/about-api ## Attention! * All `self` properties renamed to `url` cause it's incompatible with Python. * All `camelCase` properties renamed to `pythonic_case`. +* All datetime values converted to python's `datetime.datetime` objects. * Methods named by author, cause Yandex API has no clear method names. diff --git a/pyproject.toml b/pyproject.toml index 7ab72d8..1d40fc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ classifiers = [ dependencies = [ "aiohttp~=3.8.5", "certifi>=2023", - "msgspec~=0.18.1", + "msgspec~=0.18.2", ] [project.optional-dependencies] @@ -205,7 +205,7 @@ target-version = "py310" max-complexity = 10 [tool.ruff.flake8-type-checking] -runtime-evaluated-base-classes = ["msgspec.Struct"] +runtime-evaluated-base-classes = ["msgspec.Struct", "yatracker.types.base.Base"] [tool.ruff.per-file-ignores] "tests/*" = ["S101", "INP001"] diff --git a/yatracker/types/attachment.py b/yatracker/types/attachment.py index 5b2bd02..212886b 100644 --- a/yatracker/types/attachment.py +++ b/yatracker/types/attachment.py @@ -2,6 +2,9 @@ __all__ = ["Attachment"] + +from datetime import datetime + from .base import Base, field from .user import User @@ -15,7 +18,7 @@ class Attachment(Base, kw_only=True, frozen=True): content: str thumbnail: str | None = None created_by: User - created_at: str + created_at: datetime mimetype: str size: int metadata: Metadata | None = None diff --git a/yatracker/types/comment.py b/yatracker/types/comment.py index 59d587c..32411d5 100644 --- a/yatracker/types/comment.py +++ b/yatracker/types/comment.py @@ -2,6 +2,8 @@ __all__ = ["Comment"] +from datetime import datetime + from .base import Base, field from .user import User @@ -12,6 +14,6 @@ class Comment(Base, kw_only=True, frozen=True): text: str created_by: User updated_by: User | None = None - created_at: str - updated_at: str | None = None + created_at: datetime + updated_at: datetime | None = None version: int diff --git a/yatracker/types/full_issue.py b/yatracker/types/full_issue.py index c807c9a..8ec75d1 100644 --- a/yatracker/types/full_issue.py +++ b/yatracker/types/full_issue.py @@ -2,6 +2,9 @@ __all__ = ["FullIssue"] + +from datetime import datetime + from .base import Base, field from .comment import Comment from .issue import Issue @@ -32,13 +35,13 @@ class FullIssue(Base, kw_only=True, frozen=True): favorite: bool assignee: User | None = None - last_comment_update_at: str | None = None + last_comment_update_at: datetime | None = None aliases: list[str] | None = None updated_by: User | None = None - created_at: str + created_at: datetime created_by: User votes: int - updated_at: str | None = None + updated_at: datetime | None = None status: Status previous_status: Status | None = None direction: str | None = None