Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete deprecated "subject" argument of .like() and .repost() methods #325

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ Submodules
.. toctree::
:maxdepth: 4

atproto_client.client.methods_mixin.backward_compatibility
atproto_client.client.methods_mixin.session
atproto_client.client.methods_mixin.time
13 changes: 4 additions & 9 deletions packages/atproto_client/client/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from atproto_client import models
from atproto_client.client.async_raw import AsyncClientRaw
from atproto_client.client.methods_mixin import SessionMethodsMixin, TimeMethodsMixin
from atproto_client.client.methods_mixin.backward_compatibility import _BackwardCompatibility
from atproto_client.client.methods_mixin.session import AsyncSessionDispatchMixin
from atproto_client.client.session import Session, SessionEvent, SessionResponse
from atproto_client.exceptions import LoginRequiredError
Expand All @@ -25,9 +24,7 @@
from atproto_client.request import Response


class AsyncClient(
_BackwardCompatibility, AsyncSessionDispatchMixin, SessionMethodsMixin, TimeMethodsMixin, AsyncClientRaw
):
class AsyncClient(AsyncSessionDispatchMixin, SessionMethodsMixin, TimeMethodsMixin, AsyncClientRaw):
"""High-level client for XRPC of ATProto."""

def __init__(self, base_url: t.Optional[str] = None, *args: t.Any, **kwargs: t.Any) -> None:
Expand Down Expand Up @@ -431,16 +428,14 @@ async def get_author_feed(

async def like(
self,
uri: t.Optional[str] = None,
cid: t.Optional[str] = None,
subject: t.Optional['models.ComAtprotoRepoStrongRef.Main'] = None,
uri: str,
cid: str,
) -> 'models.AppBskyFeedLike.CreateRecordResponse':
"""Like the record.

Args:
cid: The CID of the record.
uri: The URI of the record.
subject: DEPRECATED.

Note:
Record could be post, custom feed, etc.
Expand All @@ -451,7 +446,7 @@ async def like(
Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""
subject_obj = self._strong_ref_arg_backward_compatibility(uri, cid, subject)
subject_obj = models.ComAtprotoRepoStrongRef.Main(cid=cid, uri=uri)

repo = self.me and self.me.did
if not repo:
Expand Down
11 changes: 4 additions & 7 deletions packages/atproto_client/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from atproto_client import models
from atproto_client.client.methods_mixin import SessionMethodsMixin, TimeMethodsMixin
from atproto_client.client.methods_mixin.backward_compatibility import _BackwardCompatibility
from atproto_client.client.methods_mixin.session import SessionDispatchMixin
from atproto_client.client.raw import ClientRaw
from atproto_client.client.session import Session, SessionEvent, SessionResponse
Expand All @@ -18,7 +17,7 @@
from atproto_client.request import Response


class Client(_BackwardCompatibility, SessionDispatchMixin, SessionMethodsMixin, TimeMethodsMixin, ClientRaw):
class Client(SessionDispatchMixin, SessionMethodsMixin, TimeMethodsMixin, ClientRaw):
"""High-level client for XRPC of ATProto."""

def __init__(self, base_url: t.Optional[str] = None, *args: t.Any, **kwargs: t.Any) -> None:
Expand Down Expand Up @@ -422,16 +421,14 @@ def get_author_feed(

def like(
self,
uri: t.Optional[str] = None,
cid: t.Optional[str] = None,
subject: t.Optional['models.ComAtprotoRepoStrongRef.Main'] = None,
uri: str,
cid: str,
) -> 'models.AppBskyFeedLike.CreateRecordResponse':
"""Like the record.

Args:
cid: The CID of the record.
uri: The URI of the record.
subject: DEPRECATED.

Note:
Record could be post, custom feed, etc.
Expand All @@ -442,7 +439,7 @@ def like(
Raises:
:class:`atproto.exceptions.AtProtocolError`: Base exception.
"""
subject_obj = self._strong_ref_arg_backward_compatibility(uri, cid, subject)
subject_obj = models.ComAtprotoRepoStrongRef.Main(cid=cid, uri=uri)

repo = self.me and self.me.did
if not repo:
Expand Down

This file was deleted.

34 changes: 0 additions & 34 deletions tests/test_atproto_client/client/test_async_client.py

This file was deleted.

34 changes: 0 additions & 34 deletions tests/test_atproto_client/client/test_client.py

This file was deleted.

Loading