Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Django 5.0 and 5.1, Python 3.12 #754

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
target: [pil, imagemagick, graphicsmagick, redis, wand, dbm]

include:
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changes
=======

* Add support for Django 5.0 and 5.1
* Drop support for Django 3.2, 4.0 and 4.1

12.10.0
=======
* Fixed safe_filter application on various thumbnail template tags.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thumbnails for Django.
Features at a glance
====================

- Support for Django 3.2, 4.0 and 4.1 following the `Django supported versions policy`_
- Support for Django 4.2, 5.0 and 5.1 following the `Django supported versions policy`_
- Python 3 support
- Storage support
- Pluggable Engine support for `Pillow`_, `ImageMagick`_, `PIL`_, `Wand`_, `pgmagick`_, and `vipsthumbnail`_
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Multimedia :: Graphics',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Framework :: Django :: 5.1',
],
setup_requires=['setuptools_scm'],
)
6 changes: 1 addition & 5 deletions sorl/thumbnail/conf/defaults.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

# When True ThumbnailNode.render can raise errors
THUMBNAIL_DEBUG = False
Expand Down Expand Up @@ -32,10 +31,7 @@
THUMBNAIL_VIPSHEADER = 'vipsheader'

# Storage for the generated thumbnails
try:
THUMBNAIL_STORAGE = settings.STORAGES['default']['BACKEND']
except (AttributeError, KeyError, ImproperlyConfigured):
THUMBNAIL_STORAGE = settings.DEFAULT_FILE_STORAGE
THUMBNAIL_STORAGE = settings.STORAGES['default']['BACKEND']

# Redis settings
THUMBNAIL_REDIS_DB = 0
Expand Down
7 changes: 6 additions & 1 deletion tests/settings/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
}
THUMBNAIL_KVSTORE = 'tests.thumbnail_tests.kvstore.TestKVStore'
THUMBNAIL_STORAGE = 'tests.thumbnail_tests.storage.TestStorage'
DEFAULT_FILE_STORAGE = 'tests.thumbnail_tests.storage.TestStorage'
STORAGES = {
"default": {
"BACKEND": "tests.thumbnail_tests.storage.TestStorage",
},
}

ADMINS = (
('Sorl', 'thumbnail@sorl.net'),
)
Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
DJANGO =
3.2: django32
4.0: django40
4.1: django41
4.2: django42
5.0: django50
5.1: django51
TARGET =
pil: pil
imagemagick: imagemagick
Expand All @@ -24,7 +24,8 @@ TARGET =
skipsdist = True
envlist =
py38-qa,
py{38,39,310,311}-django{32,40,41,42}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
py{38,39,310,311,312}-django{42}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
py{310,311,312}-django{50,51}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}

[testenv]
deps =
Expand All @@ -36,10 +37,9 @@ deps =
dynamodb: boto
pgmagick: pgmagick
wand: wand
django32: django>=3.2,<3.3
django40: django>=4.0,<4.1
django41: django>=4.1,<4.2
django42: django>=4.2,<4.3
django50: django>=5.0,<5.1
django51: django>=5.1,<5.2

setenv =
PYTHONPATH = {toxinidir}:{toxinidir}
Expand Down
Loading