Skip to content

Commit fabb179

Browse files
committed
Update to sphinx latest version
1 parent ac35329 commit fabb179

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+512
-487
lines changed

CHANGES.rst

Lines changed: 40 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -627,28 +627,28 @@ as described below:
627627

628628
**Added**
629629

630-
* :meth:`~praw.models.reddit.subreddit.Modmail.unread_count` to get unread count by
630+
* :meth:`.Modmail.unread_count` to get unread count by
631631
conversation state.
632-
* :meth:`~praw.models.reddit.subreddit.Modmail.bulk_read` to mark conversations as read
632+
* :meth:`.Modmail.bulk_read` to mark conversations as read
633633
by conversation state.
634-
* :meth:`~praw.models.reddit.subreddit.Modmail.subreddits` to fetch subreddits using new
634+
* :meth:`.Modmail.subreddits` to fetch subreddits using new
635635
modmail.
636-
* :meth:`~praw.models.reddit.subreddit.Modmail.create` to create a new modmail
636+
* :meth:`.Modmail.create` to create a new modmail
637637
conversation.
638-
* :meth:`~praw.models.ModmailConversation.read` to mark modmail conversations as read.
639-
* :meth:`~praw.models.ModmailConversation.unread` to mark modmail conversations as
638+
* :meth:`.ModmailConversation.read` to mark modmail conversations as read.
639+
* :meth:`.ModmailConversation.unread` to mark modmail conversations as
640640
unread.
641-
* :meth:`~praw.models.reddit.subreddit.Modmail.conversations` to get new modmail
641+
* :meth:`.subreddit.Modmail.conversations` to get new modmail
642642
conversations.
643-
* :meth:`~praw.models.ModmailConversation.highlight` to highlight modmail conversations.
644-
* :meth:`~praw.models.ModmailConversation.unhighlight` to unhighlight modmail
643+
* :meth:`.ModmailConversation.highlight` to highlight modmail conversations.
644+
* :meth:`.ModmailConversation.unhighlight` to unhighlight modmail
645645
conversations.
646-
* :meth:`~praw.models.ModmailConversation.mute` to mute modmail conversations.
647-
* :meth:`~praw.models.ModmailConversation.unmute` to unmute modmail conversations.
648-
* :meth:`~praw.models.ModmailConversation.archive` to archive modmail conversations.
649-
* :meth:`~praw.models.ModmailConversation.unarchive` to unarchive modmail conversations.
650-
* :meth:`~praw.models.ModmailConversation.reply` to reply to modmail conversations.
651-
* :meth:`~praw.models.reddit.subreddit.Modmail.__call__` to get a new modmail
646+
* :meth:`.ModmailConversation.mute` to mute modmail conversations.
647+
* :meth:`.ModmailConversation.unmute` to unmute modmail conversations.
648+
* :meth:`.ModmailConversation.archive` to archive modmail conversations.
649+
* :meth:`.ModmailConversation.unarchive` to unarchive modmail conversations.
650+
* :meth:`.ModmailConversation.reply` to reply to modmail conversations.
651+
* :meth:`.Modmail.__call__` to get a new modmail
652652
conversation.
653653
* :meth:`.Inbox.stream` to stream new items in the inbox.
654654
* Exponential request delay to all streams when no new items are returned in a request.
@@ -660,9 +660,9 @@ as described below:
660660
* :class:`.Reddit` accepts ``requestor_class=cls`` for a customized requestor class and
661661
``requestor_kwargs={"param": value}`` for passing arguments to requestor
662662
initialization.
663-
* :meth:`~praw.models.reddit.subreddit.SubredditStream.comments`,
664-
:meth:`~praw.models.reddit.subreddit.SubredditStream.submissions`, and
665-
:meth:`~praw.models.Subreddits.stream` accept a ``pause_after`` argument to allow
663+
* :meth:`.SubredditStream.comments`,
664+
:meth:`.SubredditStream.submissions`, and
665+
:meth:`.Subreddits.stream` accept a ``pause_after`` argument to allow
666666
pausing of the stream. The default value of ``None`` retains the preexisting behavior.
667667

668668
**Deprecated**
@@ -789,18 +789,18 @@ as described below:
789789

790790
**Added**
791791

792-
* :meth:`praw.models.Subreddits.search_by_topic` to search subreddits by topic. (see:
792+
* :meth:`.Subreddits.search_by_topic` to search subreddits by topic. (see:
793793
https://www.reddit.com/dev/api/#GET_api_subreddits_by_topic).
794-
* :meth:`praw.models.LiveHelper.__call__` to provide interface to
794+
* :meth:`.LiveHelper.__call__` to provide interface to
795795
``praw.models.LiveThread.__init__``.
796796
* :class:`.SubredditFilters` to work with filters for special subreddits, like
797797
``r/all``.
798798
* Added callables for :class:`.SubredditRelationship` and :class:`.SubredditFlair` so
799799
that ``limit`` and other parameters can be passed.
800-
* Add :meth:`~praw.models.Message.reply` to :class:`.Message` which was accidentally
800+
* Add :meth:`.Message.reply` to :class:`.Message` which was accidentally
801801
missed previously.
802802
* Add ``sticky`` parameter to :meth:`.CommentModeration.distinguish` to sticky comments.
803-
* :meth:`.flair` to add a submission's flair from an instance of :class:`.Submission`.
803+
* :meth:`.Submission.flair` to add a submission's flair from an instance of :class:`.Submission`.
804804
* :meth:`.Comment.parent` to obtain the parent of a :class:`.Comment`.
805805
* :meth:`.opt_in` and :meth:`.opt_out` to :class:`.Subreddit` to permit working with
806806
quarantined subreddits.
@@ -829,7 +829,7 @@ as described below:
829829
``Subreddit.mod.ignore_reports``, ``Subreddit.mod.remove``,
830830
``Subreddit.mod.undistinguish``, ``Subreddit.mod.unignore_reports``.
831831
* Support for passing a :class:`.Submission` to :meth:`.SubredditFlair.set` will be
832-
removed in PRAW 5. Use :meth:`.flair` instead.
832+
removed in PRAW 5. Use :meth:`.Submission.flair` instead.
833833
* The ``thing`` argument to :meth:`.SubredditFlair.set` is replaced with ``redditor``
834834
and will be removed in PRAW 5.
835835

@@ -872,7 +872,7 @@ as described below:
872872

873873
**Fixed**
874874

875-
* :meth:`~praw.models.Auth.authorize` properly sets the session's Authentication (thanks
875+
* :meth:`.Auth.authorize` properly sets the session's Authentication (thanks
876876
@williammck).
877877

878878
4.0.0rc1 (2016/11/20)
@@ -885,31 +885,23 @@ to help with updating your code to PRAW 4. If you require additional help please
885885

886886
**Added**
887887

888-
* :meth:`praw.models.Comment.block`, :meth:`praw.models.Message.block`, and
889-
:meth:`praw.models.SubredditMessage.block` to permit blocking unwanted user contact.
890-
* :meth:`praw.models.LiveHelper.create` to create new live threads.
891-
* :meth:`praw.models.Redditor.unblock` to undo a block.
892-
* :meth:`praw.models.Subreddits.gold` to iterate through gold subreddits.
893-
* :meth:`praw.models.Subreddits.search` to search for subreddits by name and
894-
description.
895-
* :meth:`praw.models.Subreddits.stream` to obtain newly created subreddits in near-
896-
realtime.
897-
* :meth:`praw.models.User.karma` to retrieve the current user's subreddit karma.
888+
* :meth:`.Comment.block`, :meth:`.Message.block`, and
889+
:meth:`.SubredditMessage.block` to permit blocking unwanted user contact.
890+
* :meth:`.LiveHelper.create` to create new live threads.
891+
* :meth:`.Redditor.unblock` to undo a block.
892+
* :meth:`.Subreddits.gold` to iterate through gold subreddits.
893+
* :meth:`.Subreddits.search` to search for subreddits by name and description.
894+
* :meth:`.Subreddits.stream` to obtain newly created subreddits in near realtime.
895+
* :meth:`.User.karma` to retrieve the current user's subreddit karma.
898896
* ``praw.models.reddit.submission.SubmissionModeration.lock`` and
899897
``praw.models.reddit.submission.SubmissionModeration.unlock`` to change a Submission's
900898
lock state.
901-
* :meth:`praw.models.reddit.subreddit.SubredditFlairTemplates.delete` to delete a single
902-
flair template.
903-
* :meth:`praw.models.reddit.subreddit.SubredditModeration.unread` to iterate over unread
904-
moderation messages.
905-
* :meth:`praw.models.reddit.subreddit.ModeratorRelationship.invite` to invite a
906-
moderator to a subreddit.
907-
* :meth:`praw.models.reddit.subreddit.ModeratorRelationship.update` to update a
908-
moderator's permissions.
909-
* :meth:`praw.models.reddit.subreddit.ModeratorRelationship.update_invite` to update an
910-
invited moderator's permissions.
911-
* :meth:`praw.models.Front.random_rising`, :meth:`praw.models.Subreddit.random_rising`
912-
and :meth:`praw.models.Multireddit.random_rising`.
899+
* :meth:`.SubredditFlairTemplates.delete` to delete a single flair template.
900+
* :meth:`.SubredditModeration.unread` to iterate over unread moderation messages.
901+
* :meth:`.ModeratorRelationship.invite` to invite a moderator to a subreddit.
902+
* :meth:`.ModeratorRelationship.update` to update a moderator's permissions.
903+
* :meth:`.ModeratorRelationship.update_invite` to update an invited moderator's permissions.
904+
* :meth:`.Front.random_rising`, :meth:`.Subreddit.random_rising` and :meth:`.Multireddit.random_rising`.
913905
* :class:`~.WikiPage` supports a revision argument.
914906
* :meth:`~.SubredditWiki.revisions` to obtain a list of recent revisions to a subreddit.
915907
* :meth:`~.WikiPage.revisions` to obtain a list of revisions for a wiki page.
@@ -925,12 +917,12 @@ to help with updating your code to PRAW 4. If you require additional help please
925917
Only prominent changes are listed here.
926918

927919
* ``helpers.comments_stream`` is now
928-
:meth:`praw.models.reddit.subreddit.SubredditStream.comments`
920+
:meth:`.SubredditStream.comments`
929921
* ``helpers.submissions_between`` is now ``Subreddit.submissions``. This new method now
930922
only iterates through newest submissions first and as a result makes approximately 33%
931923
fewer requests.
932924
* ``helpers.submission_stream`` is now
933-
:meth:`praw.models.reddit.subreddit.SubredditStream.submissions`
925+
:meth:`.SubredditStream.submissions`
934926

935927
**Removed**
936928

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ModmailConversation
22
===================
33

4-
.. autoclass:: praw.models.ModmailConversation
4+
.. autoclass:: praw.models.reddit.modmail.ModmailConversation
55
:inherited-members:
66

77
.. include:: note_dynamically_provided_attributes.txt
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
WikiPage
2-
============
2+
========
33

4-
.. autoclass:: praw.models.WikiPage
4+
.. autoclass:: praw.models.reddit.wikipage.WikiPage
55
:inherited-members:
66

77
.. include:: note_dynamically_provided_attributes.txt

docs/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
htmlhelp_basename = "PRAW"
1717
intersphinx_mapping = {"python": ("https://docs.python.org/3.8", None)}
1818
master_doc = "index"
19+
nitpick_ignore = [
20+
("py:class", "prawcore.requestor.Requestor"),
21+
("py:class", "praw.models.redditors.PartialRedditor"),
22+
("py:class", "IO"),
23+
]
1924
nitpicky = True
2025
project = "PRAW"
2126
pygments_style = "sphinx"
@@ -24,7 +29,6 @@
2429
suppress_warnings = ["image.nonlocal_uri"]
2530
version = ".".join(__version__.split(".", 2)[:2])
2631

27-
2832
# Use RTD theme locally
2933
if not os.environ.get("READTHEDOCS"):
3034
import sphinx_rtd_theme
@@ -47,4 +51,4 @@ def skip(app, what, name, obj, skip, options):
4751

4852
def setup(app):
4953
app.connect("autodoc-skip-member", skip)
50-
app.add_stylesheet("theme_override.css")
54+
app.add_css_file("theme_override.css")

docs/tutorials/comments.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ or with the submission's ID which comes after ``comments/`` in the URL:
5050
submission = reddit.submission(id="3g1jfi")
5151
5252
With a submission object we can then interact with its :class:`.CommentForest` through
53-
the submission's :attr:`~praw.models.Submission.comments` attribute. A
53+
the submission's :attr:`.Submission.comments` attribute. A
5454
:class:`.CommentForest` is a list of top-level comments each of which contains a
5555
:class:`.CommentForest` of replies.
5656

praw/models/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import TYPE_CHECKING, Any, Dict, Optional
44

55
if TYPE_CHECKING: # pragma: no cover
6-
from .. import Reddit
6+
from ... import praw
77

88

99
class PRAWBase:
@@ -23,7 +23,7 @@ def _safely_add_arguments(argument_dict, key, **new_arguments):
2323
argument_dict[key] = value
2424

2525
@classmethod
26-
def parse(cls, data: Dict[str, Any], reddit: "Reddit") -> Any:
26+
def parse(cls, data: Dict[str, Any], reddit: "praw.Reddit") -> Any:
2727
"""Return an instance of ``cls`` from ``data``.
2828
2929
:param data: The structured data.
@@ -32,7 +32,7 @@ def parse(cls, data: Dict[str, Any], reddit: "Reddit") -> Any:
3232
"""
3333
return cls(reddit, _data=data)
3434

35-
def __init__(self, reddit: "Reddit", _data: Optional[Dict[str, Any]]):
35+
def __init__(self, reddit: "praw.Reddit", _data: Optional[Dict[str, Any]]):
3636
"""Initialize a PRAWModel instance.
3737
3838
:param reddit: An instance of :class:`.Reddit`.

praw/models/comment_forest.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
from .reddit.more import MoreComments
77

88
if TYPE_CHECKING: # pragma: no cover
9-
from .reddit.comment import Comment # noqa: F401
10-
from .reddit.submission import Submission
9+
from ... import praw
1110

1211

1312
class CommentForest:
@@ -57,8 +56,8 @@ def __getitem__(self, index: int):
5756

5857
def __init__(
5958
self,
60-
submission: "Submission",
61-
comments: Optional[List["Comment"]] = None,
59+
submission: "praw.models.Submission",
60+
comments: Optional[List["praw.models.Comment"]] = None,
6261
):
6362
"""Initialize a CommentForest instance.
6463
@@ -93,7 +92,7 @@ def _update(self, comments):
9392
for comment in comments:
9493
comment.submission = self._submission
9594

96-
def list(self) -> List[Union["Comment", "MoreComments"]]:
95+
def list(self) -> List[Union["praw.models.Comment", "praw.models.MoreComments"]]:
9796
"""Return a flattened list of all Comments.
9897
9998
This list may contain :class:`.MoreComments` instances if :meth:`.replace_more`
@@ -109,7 +108,9 @@ def list(self) -> List[Union["Comment", "MoreComments"]]:
109108
queue.extend(comment.replies)
110109
return comments
111110

112-
def replace_more(self, limit: int = 32, threshold: int = 0) -> List["MoreComments"]:
111+
def replace_more(
112+
self, limit: int = 32, threshold: int = 0
113+
) -> List["praw.models.MoreComments"]:
113114
"""Update the comment forest by resolving instances of MoreComments.
114115
115116
:param limit: The maximum number of :class:`.MoreComments` instances to

praw/models/front.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44

55
from .listing.generator import ListingGenerator
66
from .listing.mixins import SubredditListingMixin
7-
from .reddit.submission import Submission
87

98
if TYPE_CHECKING: # pragma: no cover
10-
from .. import Reddit
9+
from ... import praw
1110

1211

1312
class Front(SubredditListingMixin):
1413
"""Front is a Listing class that represents the front page."""
1514

16-
def __init__(self, reddit: "Reddit"):
15+
def __init__(self, reddit: "praw.Reddit"):
1716
"""Initialize a Front instance."""
1817
super().__init__(reddit, _data=None)
1918
self._path = "/"
2019

21-
def best(self, **generator_kwargs: Union[str, int]) -> Iterator[Submission]:
20+
def best(
21+
self, **generator_kwargs: Union[str, int]
22+
) -> Iterator["praw.models.Submission"]:
2223
"""Return a :class:`.ListingGenerator` for best items.
2324
2425
Additional keyword arguments are passed in the initialization of

0 commit comments

Comments
 (0)