From 65d68d73656a2c282be942e2605585c5a1ada267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Kj=C3=A6r=20Damgaard?= Date: Tue, 7 Nov 2023 20:59:33 +0100 Subject: [PATCH] Fix type checking imports (cherry picked from commit praw-dev/praw@ff019f3e3144ca815330036d8c6254778c1a06b5) --- asyncpraw/models/comment_forest.py | 2 +- asyncpraw/models/front.py | 2 +- asyncpraw/models/helpers.py | 2 +- asyncpraw/models/inbox.py | 2 +- asyncpraw/models/listing/mixins/redditor.py | 2 +- asyncpraw/models/listing/mixins/rising.py | 2 +- asyncpraw/models/listing/mixins/submission.py | 2 +- asyncpraw/models/listing/mixins/subreddit.py | 2 +- asyncpraw/models/mod_action.py | 2 +- asyncpraw/models/mod_notes.py | 2 +- asyncpraw/models/reddit/collections.py | 2 +- asyncpraw/models/reddit/comment.py | 2 +- asyncpraw/models/reddit/draft.py | 2 +- asyncpraw/models/reddit/live.py | 2 +- asyncpraw/models/reddit/message.py | 2 +- asyncpraw/models/reddit/mixins/__init__.py | 2 +- asyncpraw/models/reddit/mixins/editable.py | 2 +- asyncpraw/models/reddit/mixins/modnote.py | 2 +- asyncpraw/models/reddit/mixins/replyable.py | 2 +- asyncpraw/models/reddit/more.py | 2 +- asyncpraw/models/reddit/multi.py | 2 +- asyncpraw/models/reddit/redditor.py | 2 +- asyncpraw/models/reddit/rules.py | 2 +- asyncpraw/models/reddit/submission.py | 2 +- asyncpraw/models/reddit/subreddit.py | 2 +- asyncpraw/models/reddit/user_subreddit.py | 2 +- asyncpraw/models/reddit/widgets.py | 2 +- asyncpraw/models/reddit/wikipage.py | 2 +- asyncpraw/models/redditors.py | 2 +- asyncpraw/models/subreddits.py | 2 +- asyncpraw/models/user.py | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/asyncpraw/models/comment_forest.py b/asyncpraw/models/comment_forest.py index 31ee0ef8..d8827b2c 100644 --- a/asyncpraw/models/comment_forest.py +++ b/asyncpraw/models/comment_forest.py @@ -11,7 +11,7 @@ from .reddit.more import MoreComments if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class CommentForest: diff --git a/asyncpraw/models/front.py b/asyncpraw/models/front.py index 5ad5ac24..3284cec0 100644 --- a/asyncpraw/models/front.py +++ b/asyncpraw/models/front.py @@ -8,7 +8,7 @@ from .listing.mixins import SubredditListingMixin if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Front(SubredditListingMixin): diff --git a/asyncpraw/models/helpers.py b/asyncpraw/models/helpers.py index 7d5c3ced..d082af85 100644 --- a/asyncpraw/models/helpers.py +++ b/asyncpraw/models/helpers.py @@ -12,7 +12,7 @@ from .reddit.multi import Multireddit, Subreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class DraftHelper(AsyncPRAWBase): diff --git a/asyncpraw/models/inbox.py b/asyncpraw/models/inbox.py index bc52d41b..c53639df 100644 --- a/asyncpraw/models/inbox.py +++ b/asyncpraw/models/inbox.py @@ -10,7 +10,7 @@ from .util import stream_generator if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Inbox(AsyncPRAWBase): diff --git a/asyncpraw/models/listing/mixins/redditor.py b/asyncpraw/models/listing/mixins/redditor.py index c023c10a..dc576f28 100644 --- a/asyncpraw/models/listing/mixins/redditor.py +++ b/asyncpraw/models/listing/mixins/redditor.py @@ -10,7 +10,7 @@ from .gilded import GildedListingMixin if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class SubListing(BaseListingMixin): diff --git a/asyncpraw/models/listing/mixins/rising.py b/asyncpraw/models/listing/mixins/rising.py index 0784d0dd..033d7b1f 100644 --- a/asyncpraw/models/listing/mixins/rising.py +++ b/asyncpraw/models/listing/mixins/rising.py @@ -8,7 +8,7 @@ from ..generator import ListingGenerator if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class RisingListingMixin(AsyncPRAWBase): diff --git a/asyncpraw/models/listing/mixins/submission.py b/asyncpraw/models/listing/mixins/submission.py index ea1c5dc8..12c34924 100644 --- a/asyncpraw/models/listing/mixins/submission.py +++ b/asyncpraw/models/listing/mixins/submission.py @@ -8,7 +8,7 @@ from ..generator import ListingGenerator if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class SubmissionListingMixin(AsyncPRAWBase): diff --git a/asyncpraw/models/listing/mixins/subreddit.py b/asyncpraw/models/listing/mixins/subreddit.py index 7444eb8b..98123c0f 100644 --- a/asyncpraw/models/listing/mixins/subreddit.py +++ b/asyncpraw/models/listing/mixins/subreddit.py @@ -12,7 +12,7 @@ from .rising import RisingListingMixin if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class CommentHelper(AsyncPRAWBase): diff --git a/asyncpraw/models/mod_action.py b/asyncpraw/models/mod_action.py index 3d22e61f..32184dc3 100644 --- a/asyncpraw/models/mod_action.py +++ b/asyncpraw/models/mod_action.py @@ -7,7 +7,7 @@ from .reddit.redditor import Redditor if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class ModAction(AsyncPRAWBase): diff --git a/asyncpraw/models/mod_notes.py b/asyncpraw/models/mod_notes.py index fd6eb444..705f9ee7 100644 --- a/asyncpraw/models/mod_notes.py +++ b/asyncpraw/models/mod_notes.py @@ -10,7 +10,7 @@ from .reddit.submission import Submission if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models RedditorType = Union[Redditor, str] SubredditType = Union["asyncpraw.models.Subreddit", str] diff --git a/asyncpraw/models/reddit/collections.py b/asyncpraw/models/reddit/collections.py index 8a404bdd..6b071e81 100644 --- a/asyncpraw/models/reddit/collections.py +++ b/asyncpraw/models/reddit/collections.py @@ -15,7 +15,7 @@ from .subreddit import Subreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class CollectionModeration(AsyncPRAWBase): diff --git a/asyncpraw/models/reddit/comment.py b/asyncpraw/models/reddit/comment.py index 5cb50c01..8d27149e 100644 --- a/asyncpraw/models/reddit/comment.py +++ b/asyncpraw/models/reddit/comment.py @@ -19,7 +19,7 @@ from .subreddit import Subreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Comment(InboxableMixin, UserContentMixin, FullnameMixin, RedditBase): diff --git a/asyncpraw/models/reddit/draft.py b/asyncpraw/models/reddit/draft.py index 8f2aa5fc..558c9773 100644 --- a/asyncpraw/models/reddit/draft.py +++ b/asyncpraw/models/reddit/draft.py @@ -10,7 +10,7 @@ from .user_subreddit import UserSubreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Draft(RedditBase): diff --git a/asyncpraw/models/reddit/live.py b/asyncpraw/models/reddit/live.py index 66902f5c..c07fe2ed 100644 --- a/asyncpraw/models/reddit/live.py +++ b/asyncpraw/models/reddit/live.py @@ -14,7 +14,7 @@ from .redditor import Redditor if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class LiveContributorRelationship: diff --git a/asyncpraw/models/reddit/message.py b/asyncpraw/models/reddit/message.py index 104ed4ec..c0ccff7f 100644 --- a/asyncpraw/models/reddit/message.py +++ b/asyncpraw/models/reddit/message.py @@ -10,7 +10,7 @@ from .subreddit import Subreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Message(InboxableMixin, ReplyableMixin, FullnameMixin, RedditBase): diff --git a/asyncpraw/models/reddit/mixins/__init__.py b/asyncpraw/models/reddit/mixins/__init__.py index 932dbf36..71c9445b 100644 --- a/asyncpraw/models/reddit/mixins/__init__.py +++ b/asyncpraw/models/reddit/mixins/__init__.py @@ -19,7 +19,7 @@ from .votable import VotableMixin if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class ThingModerationMixin(ModNoteMixin): diff --git a/asyncpraw/models/reddit/mixins/editable.py b/asyncpraw/models/reddit/mixins/editable.py index 8dc75b10..ce5894d0 100644 --- a/asyncpraw/models/reddit/mixins/editable.py +++ b/asyncpraw/models/reddit/mixins/editable.py @@ -6,7 +6,7 @@ from ....const import API_PATH if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class EditableMixin: diff --git a/asyncpraw/models/reddit/mixins/modnote.py b/asyncpraw/models/reddit/mixins/modnote.py index 1c8ab17d..13e1432c 100644 --- a/asyncpraw/models/reddit/mixins/modnote.py +++ b/asyncpraw/models/reddit/mixins/modnote.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Any, AsyncGenerator if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class ModNoteMixin: diff --git a/asyncpraw/models/reddit/mixins/replyable.py b/asyncpraw/models/reddit/mixins/replyable.py index 33842a30..3e0cd0fa 100644 --- a/asyncpraw/models/reddit/mixins/replyable.py +++ b/asyncpraw/models/reddit/mixins/replyable.py @@ -6,7 +6,7 @@ from ....const import API_PATH if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class ReplyableMixin: diff --git a/asyncpraw/models/reddit/more.py b/asyncpraw/models/reddit/more.py index 40d22fd2..05cf3b17 100644 --- a/asyncpraw/models/reddit/more.py +++ b/asyncpraw/models/reddit/more.py @@ -8,7 +8,7 @@ from ..base import AsyncPRAWBase if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class MoreComments(AsyncPRAWBase): diff --git a/asyncpraw/models/reddit/multi.py b/asyncpraw/models/reddit/multi.py index 416fb6e0..584c8f36 100644 --- a/asyncpraw/models/reddit/multi.py +++ b/asyncpraw/models/reddit/multi.py @@ -14,7 +14,7 @@ from .subreddit import Subreddit, SubredditStream if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Multireddit(SubredditListingMixin, RedditBase): diff --git a/asyncpraw/models/reddit/redditor.py b/asyncpraw/models/reddit/redditor.py index 8b4332da..3f403dbd 100644 --- a/asyncpraw/models/reddit/redditor.py +++ b/asyncpraw/models/reddit/redditor.py @@ -13,7 +13,7 @@ from .mixins import FullnameMixin, MessageableMixin if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Redditor(MessageableMixin, RedditorListingMixin, FullnameMixin, RedditBase): diff --git a/asyncpraw/models/reddit/rules.py b/asyncpraw/models/reddit/rules.py index 860e2d01..a2afa8f4 100644 --- a/asyncpraw/models/reddit/rules.py +++ b/asyncpraw/models/reddit/rules.py @@ -11,7 +11,7 @@ from .base import RedditBase if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Rule(RedditBase): diff --git a/asyncpraw/models/reddit/submission.py b/asyncpraw/models/reddit/submission.py index b8f716cc..90e410c8 100644 --- a/asyncpraw/models/reddit/submission.py +++ b/asyncpraw/models/reddit/submission.py @@ -22,7 +22,7 @@ from .subreddit import Subreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models INLINE_MEDIA_PATTERN = re.compile( r"\n\n!?(\[.*?])?\(?((https://((preview|i)\.redd\.it|reddit.com/link).*?)|(?!https)([a-zA-Z0-9]+( \".*?\")?))\)?" diff --git a/asyncpraw/models/reddit/subreddit.py b/asyncpraw/models/reddit/subreddit.py index 2147f4bd..cc2409f6 100644 --- a/asyncpraw/models/reddit/subreddit.py +++ b/asyncpraw/models/reddit/subreddit.py @@ -49,7 +49,7 @@ if TYPE_CHECKING: # pragma: no cover from aiohttp import ClientResponse - import asyncpraw + import asyncpraw.models class Modmail: diff --git a/asyncpraw/models/reddit/user_subreddit.py b/asyncpraw/models/reddit/user_subreddit.py index 0f548225..ddc7c951 100644 --- a/asyncpraw/models/reddit/user_subreddit.py +++ b/asyncpraw/models/reddit/user_subreddit.py @@ -9,7 +9,7 @@ from .subreddit import Subreddit, SubredditModeration if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class UserSubreddit(Subreddit): diff --git a/asyncpraw/models/reddit/widgets.py b/asyncpraw/models/reddit/widgets.py index e29ed103..12a2e205 100644 --- a/asyncpraw/models/reddit/widgets.py +++ b/asyncpraw/models/reddit/widgets.py @@ -12,7 +12,7 @@ from ..list.base import BaseList if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models WidgetType: TypeVar = TypeVar("WidgetType", bound="Widget") diff --git a/asyncpraw/models/reddit/wikipage.py b/asyncpraw/models/reddit/wikipage.py index 774395ab..2b9389cf 100644 --- a/asyncpraw/models/reddit/wikipage.py +++ b/asyncpraw/models/reddit/wikipage.py @@ -16,7 +16,7 @@ from .redditor import Redditor if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class WikiPageModeration: diff --git a/asyncpraw/models/redditors.py b/asyncpraw/models/redditors.py index 8db5473b..87b72e58 100644 --- a/asyncpraw/models/redditors.py +++ b/asyncpraw/models/redditors.py @@ -13,7 +13,7 @@ from .util import stream_generator if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class PartialRedditor(SimpleNamespace): diff --git a/asyncpraw/models/subreddits.py b/asyncpraw/models/subreddits.py index c09b708c..f10fcf9d 100644 --- a/asyncpraw/models/subreddits.py +++ b/asyncpraw/models/subreddits.py @@ -12,7 +12,7 @@ from .util import stream_generator if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class Subreddits(AsyncPRAWBase): diff --git a/asyncpraw/models/user.py b/asyncpraw/models/user.py index b3bbca7b..8edcf6d9 100644 --- a/asyncpraw/models/user.py +++ b/asyncpraw/models/user.py @@ -17,7 +17,7 @@ from .reddit.subreddit import Subreddit if TYPE_CHECKING: # pragma: no cover - import asyncpraw + import asyncpraw.models class User(AsyncPRAWBase):