From 0090a6f4111c95aa4d405a10fcc06cc14c907a4d Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 16 Apr 2025 00:48:51 +0100 Subject: [PATCH] Update tested versions, add python 3.13 support and django 5.2 support. Drop python 3.8 support (#271) * Update tested versions * Remove f string * Fix second `format_html` --------- Co-authored-by: Stan Triepels <1939656+GDay@users.noreply.github.com> --- .github/workflows/test.yml | 30 ++++++++++++++++++++---------- README.rst | 5 ++++- django_q/admin.py | 2 +- django_q/models.py | 2 +- pyproject.toml | 4 ++-- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ba04b0..476f60a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,19 +26,29 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] - django: [ "4.2", "5.0", "5.1"] + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + django: + - "4.2" + - "5.0" + - "5.1" + - "5.2" exclude: - # django 5.1 does not support 3.8 and 3.9 - - python-version: "3.8" - django: "5.1" + # django 5.2 does not support 3.9 + - python-version: "3.9" + django: "5.2" + # django 5.1 does not support 3.9 - python-version: "3.9" django: "5.1" - # django 5.0 does not support 3.8 and 3.9 - - python-version: "3.8" - django: "5.0" + # django 5.0 does not support 3.9 - python-version: "3.9" - django: "5.0" + django: "5.0" + # django 4.2 does not support 3.13 + - python-version: "3.13" + django: "4.2" services: mongodb: @@ -70,7 +80,7 @@ jobs: run: | python -m pip install --upgrade pip pip install poetry==1.8.5 - poetry add "django==${{ matrix.django }}" --python=${{ matrix.python-version }} + poetry add "django~=${{ matrix.django }}a1" --python=${{ matrix.python-version }} poetry install -E testing - name: Run Tests run: | diff --git a/README.rst b/README.rst index 30ddba3..4d43962 100644 --- a/README.rst +++ b/README.rst @@ -38,7 +38,10 @@ Requirements - `Django `__ > = 4.2 - `Django-picklefield `__ -Tested with: Python 3.8, 3.9, 3.10, 3.11 and 3.12. Works with Django 4.2.X and 5.0.X +Tested with: + +* Python 3.9 to 3.13. +* Django 4.2 to 5.2. Brokers ~~~~~~~ diff --git a/django_q/admin.py b/django_q/admin.py index 294851e..ccb3f9d 100644 --- a/django_q/admin.py +++ b/django_q/admin.py @@ -138,7 +138,7 @@ class ScheduleAdmin(admin.ModelAdmin): url = reverse("admin:django_q_success_change", args=(obj.task_id,)) else: url = reverse("admin:django_q_failure_change", args=(obj.task_id,)) - return format_html(f'[{obj.task_name}]') + return format_html('[{}]', url, obj.task_name) return None get_last_run.allow_tags = True diff --git a/django_q/models.py b/django_q/models.py index 5cc534f..0ff46b4 100644 --- a/django_q/models.py +++ b/django_q/models.py @@ -296,7 +296,7 @@ class Schedule(models.Model): url = reverse("admin:django_q_success_change", args=(task.id,)) else: url = reverse("admin:django_q_failure_change", args=(task.id,)) - return format_html(f'[{task.name}]') + return format_html('[{}]', url, task.name) return None def __str__(self): diff --git a/pyproject.toml b/pyproject.toml index f2236fe..ab42af4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,11 +30,11 @@ classifiers = [ 'Operating System :: MacOS', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - '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', 'Topic :: Internet :: WWW/HTTP', 'Topic :: System :: Distributed Computing', 'Topic :: Software Development :: Libraries :: Python Modules', @@ -52,7 +52,7 @@ include = [ [tool.poetry.dependencies] -python = ">=3.8,<4" +python = ">=3.9,<4" django = ">=4.2, <6" django-picklefield = "^3.1"