Skip to content

Commit

Permalink
Fix docs warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed May 6, 2020
1 parent 2545a01 commit cce947b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ python:
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
fail_on_warning: true
# Disabled, until we can find a way to get sphinx-autodoc-typehints play nice with our
# module renaming!
fail_on_warning: false
1 change: 1 addition & 0 deletions fbchat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
EmojiSize,
Mention,
Message,
MessageSnippet,
MessageData,
)

Expand Down
8 changes: 4 additions & 4 deletions fbchat/_models/_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from string import Formatter
from . import _attachment, _location, _file, _quick_reply, _sticker
from .._common import log, attrs_default
from .. import _exception, _util, _session, _threads
from typing import Optional, Mapping, Sequence
from .. import _exception, _util
from typing import Optional, Mapping, Sequence, Any


class EmojiSize(enum.Enum):
Expand Down Expand Up @@ -85,7 +85,7 @@ class Message:
"""

#: The thread that this message belongs to.
thread = attr.ib(type="_threads.ThreadABC")
thread = attr.ib()
#: The message ID.
id = attr.ib(converter=str, type=str)

Expand Down Expand Up @@ -277,7 +277,7 @@ class MessageData(Message):
#: Message ID you want to reply to
reply_to_id = attr.ib(None, type=Optional[str])
#: Replied message
replied_to = attr.ib(None, type=Optional["MessageData"])
replied_to = attr.ib(None, type=Optional[Any])
#: Whether the message was forwarded
forwarded = attr.ib(False, type=Optional[bool])

Expand Down
2 changes: 1 addition & 1 deletion fbchat/_threads/_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def _search_messages(self, query, offset, limit):

def search_messages(
self, query: str, limit: int
) -> Iterable["_models.MessageSnippet"]:
) -> Iterable[_models.MessageSnippet]:
"""Find and get message IDs by query.
Warning! If someone send a message to the thread that matches the query, while
Expand Down
4 changes: 2 additions & 2 deletions fbchat/_threads/_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ class GroupData(Group):
"""

#: The group's picture
photo = attr.ib(None, type=Optional["_models.Image"])
photo = attr.ib(None, type=Optional[_models.Image])
#: The name of the group
name = attr.ib(None, type=Optional[str])
#: When the group was last active / when the last message was sent
last_active = attr.ib(None, type=Optional[datetime.datetime])
#: Number of messages in the group
message_count = attr.ib(None, type=Optional[int])
#: Set `Plan`
plan = attr.ib(None, type=Optional["_models.PlanData"])
plan = attr.ib(None, type=Optional[_models.PlanData])
#: The group thread's participant user ids
participants = attr.ib(factory=set, type=Set[str])
#: A dictionary, containing user nicknames mapped to their IDs
Expand Down
4 changes: 2 additions & 2 deletions fbchat/_threads/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class PageData(Page):
"""

#: The page's picture
photo = attr.ib(type="_models.Image")
photo = attr.ib(type=_models.Image)
#: The name of the page
name = attr.ib(type=str)
#: When the thread was last active / when the last message was sent
last_active = attr.ib(None, type=Optional[datetime.datetime])
#: Number of messages in the thread
message_count = attr.ib(None, type=Optional[int])
#: Set `Plan`
plan = attr.ib(None, type=Optional["_models.PlanData"])
plan = attr.ib(None, type=Optional[_models.PlanData])
#: The page's custom URL
url = attr.ib(None, type=Optional[str])
#: The name of the page's location city
Expand Down
4 changes: 2 additions & 2 deletions fbchat/_threads/_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class UserData(User):
"""

#: The user's picture
photo = attr.ib(type="_models.Image")
photo = attr.ib(type=_models.Image)
#: The name of the user
name = attr.ib(type=str)
#: Whether the user and the client are friends
Expand All @@ -119,7 +119,7 @@ class UserData(User):
#: Number of messages in the thread
message_count = attr.ib(None, type=Optional[int])
#: Set `Plan`
plan = attr.ib(None, type=Optional["_models.PlanData"])
plan = attr.ib(None, type=Optional[_models.PlanData])
#: The profile URL. ``None`` for Messenger-only users
url = attr.ib(None, type=Optional[str])
#: The user's gender
Expand Down

0 comments on commit cce947b

Please sign in to comment.