diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 143caa1..cb93e81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,10 +6,13 @@ jobs: strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] - django-version: ['3.2', '4.0', '4.1'] + django-version: ['3.2', '4.1', '4.2'] include: - python-version: 3.7 django-version: 3.2 + exclude: + - python-version: 3.11 + django-version: 3.2 fail-fast: false steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index adb8393..a37d6dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -12,13 +12,13 @@ repos: args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.9.1 hooks: - id: black args: [--target-version=py310] - repo: https://github.com/pycqa/flake8 - rev: '6.0.0' + rev: '6.1.0' hooks: - id: flake8 additional_dependencies: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 98eba14..8a77ee1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,8 @@ Changelog ========= +* Unreleased + * Use ``Image.Resampling.LANCZOS`` instead of ``Image.LANCZOS`` that was removed in Pillow 10.0.0 + * 7.1.1 (February 23, 2023) * Switch to setuptools for building diff --git a/avatar/admin.py b/avatar/admin.py index 55ad544..9425ef3 100644 --- a/avatar/admin.py +++ b/avatar/admin.py @@ -17,14 +17,12 @@ class AvatarAdmin(admin.ModelAdmin): list_per_page = 50 def get_avatar(self, avatar_in): - context = dict( - { - "user": avatar_in.user, - "url": avatar_in.avatar.url, - "alt": str(avatar_in.user), - "size": 80, - } - ) + context = { + "user": avatar_in.user, + "url": avatar_in.avatar.url, + "alt": str(avatar_in.user), + "size": 80, + } return render_to_string("avatar/avatar_tag.html", context) get_avatar.short_description = _("Avatar") diff --git a/avatar/conf.py b/avatar/conf.py index caf3da9..a29cec6 100644 --- a/avatar/conf.py +++ b/avatar/conf.py @@ -5,7 +5,7 @@ from PIL import Image class AvatarConf(AppConf): DEFAULT_SIZE = 80 - RESIZE_METHOD = Image.LANCZOS + RESIZE_METHOD = Image.Resampling.LANCZOS STORAGE_DIR = "avatars" PATH_HANDLER = "avatar.models.avatar_path_handler" GRAVATAR_BASE_URL = "https://www.gravatar.com/avatar/" diff --git a/avatar/templates/avatar/add.html b/avatar/templates/avatar/add.html index 9b4fed6..b5214fa 100644 --- a/avatar/templates/avatar/add.html +++ b/avatar/templates/avatar/add.html @@ -7,7 +7,7 @@ {% if not avatars %}
{% trans "You haven't uploaded an avatar yet. Please upload one now." %}
{% endif %} - diff --git a/avatar/templates/avatar/change.html b/avatar/templates/avatar/change.html index 8d27359..444015a 100644 --- a/avatar/templates/avatar/change.html +++ b/avatar/templates/avatar/change.html @@ -7,14 +7,14 @@ {% if not avatars %}{% trans "You haven't uploaded an avatar yet. Please upload one now." %}
{% else %} - {% endif %} - diff --git a/avatar/templates/avatar/confirm_delete.html b/avatar/templates/avatar/confirm_delete.html index aad11a9..dfb4626 100644 --- a/avatar/templates/avatar/confirm_delete.html +++ b/avatar/templates/avatar/confirm_delete.html @@ -7,7 +7,7 @@{% blocktrans %}You have no avatars to delete. Please upload one now.{% endblocktrans %}
{% else %}{% trans "Please select the avatars that you would like to delete." %}
-