diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0e37f1..aa6cd0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: 3.11 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1daa80a..27dce5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,32 +5,26 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - django-version: ['3.2', '4.1', '4.2', '5.0', '5.1.*'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + django-version: ['4.2', '5.2', '6.0.*'] exclude: + - python-version: 3.13 + django-version: 4.2 + + - python-version: 3.14 + django-version: 4.2 + + - python-version: 3.10 + django-version: 6.0.* + - python-version: 3.11 - django-version: 3.2 - - - python-version: 3.12 - django-version: 3.2 - - - python-version: 3.8 - django-version: 5.0 - - - python-version: 3.9 - django-version: 5.0 - - - python-version: 3.8 - django-version: 5.1.* - - - python-version: 3.9 - django-version: 5.1.* + django-version: 6.0.* fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: 'Set up Python ${{ matrix.python-version }}' - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: '${{ matrix.python-version }}' cache: 'pip' @@ -48,4 +42,4 @@ jobs: coverage report coverage xml - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7d38ca..0b3308f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,24 +1,24 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/isort - rev: "6.0.0" + rev: "7.0.0" hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: 25.1.0 + rev: 25.12.0 hooks: - id: black args: [--target-version=py310] - repo: https://github.com/pycqa/flake8 - rev: '7.1.2' + rev: '7.3.0' hooks: - id: flake8 additional_dependencies: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a9af654..2c04bac 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog ========= * 9.0.0 (in progress) * Fix files not closed in `create_thumbnail` + * Add Django 5.2 and 6.0 support + * Add Python 3.13, 3.14 support + * Drop Python 3.8, 3.9 support * 8.0.1 * Fix Django 5.1 compatibility diff --git a/avatar/providers.py b/avatar/providers.py index 78424ed..2991012 100644 --- a/avatar/providers.py +++ b/avatar/providers.py @@ -68,7 +68,7 @@ class GravatarAvatarProvider(object): class LibRAvatarProvider: """ - Returns the url of an avatar by the Ravatar service. + Returns the url of an avatar by the LibRavatar service. """ @classmethod @@ -87,8 +87,17 @@ class LibRAvatarProvider: baseurl = "http://" + hostname + ":" + port + "/avatar/" except Exception: baseurl = "https://seccdn.libravatar.org/avatar/" - hash = hashlib.md5(email.strip().lower()).hexdigest() - return baseurl + hash + + params = {"s": str(width)} + if settings.AVATAR_GRAVATAR_DEFAULT: + params["d"] = settings.AVATAR_GRAVATAR_DEFAULT + if settings.AVATAR_GRAVATAR_FORCEDEFAULT: + params["f"] = "y" + path = "%s/?%s" % ( + hashlib.md5(force_bytes(email.strip().lower())).hexdigest(), + urlencode(params), + ) + return urljoin(baseurl, path) class FacebookAvatarProvider(object): diff --git a/avatar/templates/avatar/confirm_delete.html b/avatar/templates/avatar/confirm_delete.html index dfb4626..b8f193c 100644 --- a/avatar/templates/avatar/confirm_delete.html +++ b/avatar/templates/avatar/confirm_delete.html @@ -3,7 +3,7 @@ {% block content %} {% if not avatars %} - {% url 'avatar_change' as avatar_change_url %} + {% url 'avatar:change' as avatar_change_url %}

{% blocktrans %}You have no avatars to delete. Please upload one now.{% endblocktrans %}

{% else %}

{% trans "Please select the avatars that you would like to delete." %}

diff --git a/pyproject.toml b/pyproject.toml index 4a34c61..c554f37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,20 +13,20 @@ keywords=["avatar", "django"] classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", - "Framework :: Django", "Intended Audience :: Developers", "Framework :: Django", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", + "Framework :: Django :: 5.2", + "Framework :: Django :: 6.0", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dynamic = ["version", "dependencies"]