Skip to content

Commit 5b07d62

Browse files
Merge branch 'praw-dev:main' into main
2 parents fe29e21 + 2ce92c0 commit 5b07d62

36 files changed

Lines changed: 6843 additions & 3407 deletions

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: ruff
2323
args: [ --exit-non-zero-on-fix, --fix ]
2424
files: ^(praw/.*.py)$
25-
rev: v0.11.13
25+
rev: v0.12.8
2626

2727
- repo: https://github.com/LilSpazJoekp/docstrfmt
2828
hooks:
@@ -41,7 +41,7 @@ repos:
4141
rev: v0.24.2
4242

4343
- repo: https://github.com/pre-commit/pre-commit-hooks
44-
rev: v5.0.0
44+
rev: v6.0.0
4545
hooks:
4646
- id: check-added-large-files
4747
- id: check-executables-have-shebangs

CHANGES.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Unreleased
5353
- Remove ``WebSocketException.original_exception`` method.
5454
- Remove the ``after`` argument for :meth:`.conversations`.
5555
- Remove key ``reset_timestamp`` from :meth:`.limits`.
56+
- Remove ``SubredditMessage.mute`` and ``SubredditMessage.unmute`` methods.
57+
- Remove ``InboxableMixin.unblock_subreddit`` method.
5658

5759
7.8.1 (2024/10/25)
5860
------------------
@@ -213,7 +215,7 @@ Unreleased
213215
WikiPage.
214216
- :meth:`.revert` to revert a WikiPage to a specified revision.
215217
- :meth:`.Inbox.mark_all_read` to mark all messages as read with one API call.
216-
- :meth:`~.InboxableMixin.unblock_subreddit` to unblock a subreddit.
218+
- ``InboxableMixin.unblock_subreddit`` to unblock a subreddit.
217219
- :meth:`.update_crowd_control_level` to update the crowd control level of a post.
218220
- :meth:`.moderator_subreddits`, which returns information about the subreddits that the
219221
authenticated user moderates, has been restored.

praw/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _load_config(cls, *, config_interpolation: str | None = None) -> None:
5050
interpolator_class = None
5151

5252
config = configparser.ConfigParser(interpolation=interpolator_class)
53-
with importlib.resources.open_text(__package__, "praw.ini") as hdl:
53+
with importlib.resources.files(__package__).joinpath("praw.ini").open("r") as hdl:
5454
config.read_file(hdl)
5555

5656
if "APPDATA" in os.environ: # Windows

praw/models/reddit/message.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -135,39 +135,3 @@ class SubredditMessage(Message):
135135
.. _unix time: https://en.wikipedia.org/wiki/Unix_time
136136
137137
"""
138-
139-
def mute(self) -> None:
140-
"""Mute the sender of this :class:`.SubredditMessage`.
141-
142-
For example, to mute the sender of the first :class:`.SubredditMessage` in the
143-
authenticated users' inbox:
144-
145-
.. code-block:: python
146-
147-
from praw.models import SubredditMessage
148-
149-
msg = next(
150-
message for message in reddit.inbox.all() if isinstance(message, SubredditMessage)
151-
)
152-
msg.mute()
153-
154-
"""
155-
self._reddit.post(API_PATH["mute_sender"], data={"id": self.fullname})
156-
157-
def unmute(self) -> None:
158-
"""Unmute the sender of this :class:`.SubredditMessage`.
159-
160-
For example, to unmute the sender of the first :class:`.SubredditMessage` in the
161-
authenticated users' inbox:
162-
163-
.. code-block:: python
164-
165-
from praw.models import SubredditMessage
166-
167-
msg = next(
168-
message for message in reddit.inbox.all() if isinstance(message, SubredditMessage)
169-
)
170-
msg.unmute()
171-
172-
"""
173-
self._reddit.post(API_PATH["unmute_sender"], data={"id": self.fullname})

praw/models/reddit/mixins/inboxable.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,33 +101,6 @@ def mark_unread(self) -> None:
101101
"""
102102
self._reddit.inbox.mark_unread([self])
103103

104-
def unblock_subreddit(self) -> None:
105-
"""Unblock a subreddit.
106-
107-
.. note::
108-
109-
This method pertains only to objects which were retrieved via the inbox.
110-
111-
For example, to unblock all blocked subreddits that you can find by going
112-
through your inbox:
113-
114-
.. code-block:: python
115-
116-
from praw.models import SubredditMessage
117-
118-
subs = set()
119-
for item in reddit.inbox.messages(limit=None):
120-
if isinstance(item, SubredditMessage):
121-
if (
122-
item.subject == "[message from blocked subreddit]"
123-
and str(item.subreddit) not in subs
124-
):
125-
item.unblock_subreddit()
126-
subs.add(str(item.subreddit))
127-
128-
"""
129-
self._reddit.post(API_PATH["unblock_subreddit"], data={"id": self.fullname})
130-
131104
def uncollapse(self) -> None:
132105
"""Mark the item as uncollapsed.
133106

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ maintainers = [
4141
]
4242
name = "praw"
4343
readme = "README.rst"
44-
requires-python = "~=3.9"
44+
requires-python = ">=3.9"
4545

4646
[project.optional-dependencies]
4747
dev = [

tests/integration/cassettes/TestInbox.test_all.json

Lines changed: 162 additions & 51 deletions
Large diffs are not rendered by default.

tests/integration/cassettes/TestInbox.test_all__with_limit.json

Lines changed: 249 additions & 82 deletions
Large diffs are not rendered by default.

tests/integration/cassettes/TestInbox.test_comment_replies.json

Lines changed: 162 additions & 51 deletions
Large diffs are not rendered by default.

tests/integration/cassettes/TestInbox.test_comment_reply__refresh.json

Lines changed: 247 additions & 97 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)