Skip to content

Commit d78c134

Browse files
committed
Drop support for python 3.8 and add 3.13 support
1 parent 6ca8b47 commit d78c134

File tree

13 files changed

+30
-39
lines changed

13 files changed

+30
-39
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ repos:
2929
- id: ruff
3030
args: [ --exit-non-zero-on-fix, --fix ]
3131
files: ^(prawcore/.*.py)$
32-
33-
- repo: https://github.com/psf/black
34-
hooks:
35-
- id: black
36-
rev: 24.10.0
32+
- id: ruff-format
3733

3834
- repo: https://github.com/LilSpazJoekp/docstrfmt
3935
hooks:

CHANGES.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ prawcore follows `semantic versioning <https://semver.org/>`_.
66
Unreleased
77
----------
88

9+
**Changed**
10+
11+
- Drop support for Python 3.8, which was end-of-life on 2024-10-07.
12+
913
2.4.0 (2023/10/01)
1014
------------------
1115

1216
**Changed**
1317

14-
- Drop support for Python 3.6, which is end-of-life on 2021-12-23.
18+
- Drop support for Python 3.6, which was end-of-life on 2021-12-23.
1519
- Updated rate limit algorithm to better handle Reddit's new rate limits.
16-
- Drop support for Python 3.7, which is end-of-life on 2023-06-27.
20+
- Drop support for Python 3.7, which was end-of-life on 2023-06-27.
1721

1822
2.3.0 (2021-07-26)
1923
------------------
@@ -75,7 +79,7 @@ Unreleased
7579

7680
**Changed**
7781

78-
- Drop support for Python 3.5, which is end-of-life on 2020-09-13.
82+
- Drop support for Python 3.5, which was end-of-life on 2020-09-13.
7983

8084
1.4.0 (2020-05-28)
8185
------------------

README.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ prawcore
3535
:alt: pre-commit
3636
:target: https://github.com/pre-commit/pre-commit
3737

38-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
39-
:alt: Black code style
40-
:target: https://github.com/psf/black
41-
4238
prawcore is a low-level communication layer used by PRAW 4+.
4339

4440
Installation

examples/obtain_refresh_token.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
application OAuth2 credentials.
1010
1111
"""
12+
1213
import os
1314
import random
1415
import socket

examples/read_only_auth_trophies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require an access token to make authenticated requests to Reddit.
77
88
"""
9+
910
import os
1011
import sys
1112

examples/script_auth_friend_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
password.
88
99
"""
10+
1011
import os
1112
import sys
1213

prawcore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""""Low-level communication layer for PRAW 4+."""
1+
"""Low-level communication layer for PRAW 4+."""
22

33
import logging
44

prawcore/const.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
REVOKE_TOKEN_PATH = "/api/v1/revoke_token" # noqa: S105
88
TIMEOUT = float(
99
os.environ.get(
10-
"PRAWCORE_TIMEOUT", os.environ.get("prawcore_timeout", 16) # noqa: SIM112
10+
"PRAWCORE_TIMEOUT",
11+
os.environ.get("prawcore_timeout", 16), # noqa: SIM112
1112
)
1213
)
1314
WINDOW_SIZE = 600

prawcore/rate_limit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
import logging
66
import time
7-
from typing import TYPE_CHECKING, Any, Callable, Mapping
7+
from typing import TYPE_CHECKING, Any, Callable
88

99
if TYPE_CHECKING:
10+
from collections.abc import Mapping
11+
1012
from requests.models import Response
1113

1214
log = logging.getLogger(__package__)

prawcore/sessions.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,8 @@ def _make_request(
205205
)
206206
return response, None
207207
except RequestException as exception:
208-
if (
209-
not retry_strategy_state.should_retry_on_failure()
210-
or not isinstance( # noqa: E501
211-
exception.original_exception, self.RETRY_EXCEPTIONS
212-
)
208+
if not retry_strategy_state.should_retry_on_failure() or not isinstance( # noqa: E501
209+
exception.original_exception, self.RETRY_EXCEPTIONS
213210
):
214211
raise
215212
return None, exception.original_exception
@@ -266,9 +263,9 @@ def _request_with_retries(
266263
raise self.STATUS_EXCEPTIONS[response.status_code](response)
267264
if response.status_code == codes["no_content"]:
268265
return None
269-
assert (
270-
response.status_code in self.SUCCESS_STATUSES
271-
), f"Unexpected status code: {response.status_code}"
266+
assert response.status_code in self.SUCCESS_STATUSES, (
267+
f"Unexpected status code: {response.status_code}"
268+
)
272269
if response.headers.get("content-length") == "0":
273270
return ""
274271
try:

0 commit comments

Comments
 (0)