Skip to content

Commit 3dd227e

Browse files
authored
Merge pull request #583 from matthewwithanm/feat/python3.14
Support Python 3.14
2 parents dfbbf0b + ef9f0ea commit 3dd227e

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

.github/workflows/python.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
strategy:
1414
max-parallel: 4
1515
matrix:
16-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
16+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14.0-rc.2']
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v5
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v6
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

imagekit/hashers.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from copy import copy
23
from hashlib import md5
34
from io import BytesIO
@@ -14,12 +15,20 @@ def save_set(self, obj):
1415

1516
dispatch[set] = save_set
1617

17-
def save_dict(self, obj):
18-
write = self.write
19-
write(MARK + DICT)
18+
if sys.version_info[:2] >= (3, 14):
19+
def save_dict(self, obj):
20+
write = self.write
21+
write(MARK + DICT)
2022

21-
self.memoize(obj)
22-
self._batch_setitems(sorted(obj.items()))
23+
self.memoize(obj)
24+
self._batch_setitems(sorted(obj.items()), obj)
25+
else:
26+
def save_dict(self, obj):
27+
write = self.write
28+
write(MARK + DICT)
29+
30+
self.memoize(obj)
31+
self._batch_setitems(sorted(obj.items()))
2332

2433
dispatch[dict] = save_dict
2534

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def exec_file(filepath, globalz=None, localz=None):
6767
'Programming Language :: Python :: 3.11',
6868
'Programming Language :: Python :: 3.12',
6969
'Programming Language :: Python :: 3.13',
70+
'Programming Language :: Python :: 3.14',
7071
'Topic :: Utilities'
7172
],
7273
)

tox.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[tox]
22
envlist =
3-
django32-py{39,310}
4-
django42-py{39,310,311,312}
5-
django51-py{310,311,312,313}
6-
django52-py{310,311,312,313}
7-
djangomain-{312,313}
3+
django32-py3{9,10}
4+
django42-py3{9,10,11,12}
5+
django52-py3{10,11,12,13,14}
6+
djangomain-py3{13,14}
87
coverage-report
98

109
[gh-actions]
@@ -14,6 +13,7 @@ python =
1413
3.11: py311, coverage-report
1514
3.12: py312
1615
3.13: py313
16+
3.14: py314
1717

1818
[testenv]
1919
deps =
@@ -25,7 +25,7 @@ deps =
2525
djangomain: https://github.com/django/django/archive/refs/heads/main.zip
2626

2727
setenv = COVERAGE_FILE=.coverage.{envname}
28-
commands = python -m pytest --cov --cov-report term-missing:skip-covered
28+
commands = python -Wdefault -m pytest --cov --cov-report term-missing:skip-covered
2929

3030
ignore_outcome =
3131
djangomain: true

0 commit comments

Comments
 (0)