1
0

6 Commits

Author SHA256 Message Date
8829b4290c Accepting request 1323667 from devel:languages:python:django
OBS-URL: https://build.opensuse.org/request/show/1323667
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-q?expand=0&rev=15
2025-12-19 15:46:01 +00:00
8e06d67d03 - Add upstream patch django5.patch to fix Django 5 support
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-q?expand=0&rev=31
2025-12-19 12:36:31 +00:00
b933399d5d Accepting request 1282132 from devel:languages:python:django
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/request/show/1282132
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-q?expand=0&rev=14
2025-06-03 15:53:12 +00:00
3ecd355ba9 - Switch to pyproject macros.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-q?expand=0&rev=29
2025-06-03 07:12:15 +00:00
e57279ab23 Accepting request 1228390 from devel:languages:python:django
Forwarded request #1228379 from Andreas_Schwab

- Increase timeout not to kill the redis server in the middle of the
    testsuite run

OBS-URL: https://build.opensuse.org/request/show/1228390
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-q?expand=0&rev=13
2024-12-05 16:09:17 +00:00
9088b8edea - Increase timeout not to kill the redis server in the middle of the
testsuite run

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-q?expand=0&rev=27
2024-12-04 22:14:01 +00:00
3 changed files with 102 additions and 8 deletions

71
django5.patch Normal file
View File

@@ -0,0 +1,71 @@
From 1d2a6059db4cd44f14f9f3008098ca04a1a2bc96 Mon Sep 17 00:00:00 2001
From: Stan Triepels <1939656+GDay@users.noreply.github.com>
Date: Thu, 12 Oct 2023 22:44:19 +0200
Subject: [PATCH] Add support for Django 5 (#120)
---
.github/workflows/test.yml | 27 +-
README.rst | 4 +-
django_q/core_signing.py | 12 +-
django_q/utils.py | 2 +-
docs/index.rst | 2 +-
docs/install.rst | 10 +-
poetry.lock | 1751 +++++++++++++++++++-----------------
pyproject.toml | 10 +-
8 files changed, 962 insertions(+), 856 deletions(-)
Index: django-q-1.3.9/django_q/core_signing.py
===================================================================
--- django-q-1.3.9.orig/django_q/core_signing.py
+++ django-q-1.3.9/django_q/core_signing.py
@@ -2,11 +2,18 @@ import datetime
import time
import zlib
+import django
from django.core.signing import BadSignature, JSONSerializer, SignatureExpired
from django.core.signing import Signer as Sgnr
from django.core.signing import TimestampSigner as TsS
from django.core.signing import b64_decode, dumps
-from django.utils import baseconv
+
+if django.VERSION < (5, 0):
+ from django.utils.baseconv import base62
+ b62_decode = base62.decode
+else:
+ from django.core.signing import b62_decode
+
from django.utils.crypto import constant_time_compare
from django.utils.encoding import force_bytes, force_str
@@ -32,7 +39,7 @@ def loads(
"""
# TimestampSigner.unsign() returns str but base64 and zlib compression
# operate on bytes.
- base64d = force_bytes(TimestampSigner(key, salt=salt).unsign(s, max_age=max_age))
+ base64d = force_bytes(TimestampSigner(key=key, salt=salt).unsign(s, max_age=max_age))
decompress = False
if base64d[:1] == b".":
# It's compressed; uncompress it first
@@ -69,7 +76,7 @@ class TimestampSigner(Signer, TsS):
"""
result = super(TimestampSigner, self).unsign(value)
value, timestamp = result.rsplit(self.sep, 1)
- timestamp = baseconv.base62.decode(timestamp)
+ timestamp = b62_decode(timestamp)
if max_age is not None:
if isinstance(max_age, datetime.timedelta):
max_age = max_age.total_seconds()
Index: django-q-1.3.9/django_q/models.py
===================================================================
--- django-q-1.3.9.orig/django_q/models.py
+++ django-q-1.3.9/django_q/models.py
@@ -213,7 +213,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'<a href="{url}">[{task.name}]</a>')
+ return format_html('<a href="{}">[{}]</a>', url, task.name)
return None
def __str__(self):

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Wed Dec 17 13:12:39 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add upstream patch django5.patch to fix Django 5 support
-------------------------------------------------------------------
Tue Jun 3 06:48:29 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pyproject macros.
-------------------------------------------------------------------
Wed Dec 4 20:11:19 UTC 2024 - Andreas Schwab <schwab@suse.de>
- Increase timeout not to kill the redis server in the middle of the
testsuite run
-------------------------------------------------------------------
Thu Jul 18 07:52:24 UTC 2024 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-django-q
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,21 +25,28 @@ License: MIT
URL: https://django-q.readthedocs.org
Source: https://files.pythonhosted.org/packages/source/d/django-q/django-q-%{version}.tar.gz
# pkg_resources is broken since the flufl.lock update in Factory
Patch: gh-pr-737_importlib.patch
Patch0: gh-pr-737_importlib.patch
# PATCH-FIX-UPSTREAM combined bits of:
# https://github.com/django-q2/django-q2/commit/1f31725f43e3b6f0f793ed00f482d994ae50a503 Added Django 4.2 to the test matrix, fixed deprecation warning
# https://github.com/django-q2/django-q2/commit/1d2a6059db4cd44f14f9f3008098ca04a1a2bc96 Add support for Django 5
# https://github.com/django-q2/django-q2/commit/0090a6f4111c95aa4d405a10fcc06cc14c907a4d Update tested versions, add python 3.13 support and django 5.2 support. Drop python 3.8 support
Patch1: django5.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Django >= 2.2
Requires: python-arrow
Requires: python-blessed
Requires: python-django-picklefield
Requires: python-redis
Requires: (python-Django >= 2.2 with python-Django < 5)
Suggests: python-croniter
Suggests: python-django-q-rollbar >= 0.1
Suggests: python-django-q-sentry >= 0.1
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Django >= 2.2 with %python-Django < 5}
BuildRequires: %{python_module Django >= 2.2}
BuildRequires: %{python_module arrow}
BuildRequires: %{python_module blessed}
BuildRequires: %{python_module croniter}
@@ -61,7 +68,7 @@ This package provides a multiprocessing distributed task queue for Django.
%prep
%setup -n django-q-%{version}
# wrong line endings prevent patching
dos2unix django_q/conf.py
dos2unix django_q/*.py
%autopatch -p1
# Fix permissions
@@ -76,10 +83,10 @@ dos2unix README.rst
sed -i '/HiredisParser/d' django_q/tests/settings.py
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand rm -r %{buildroot}%{$python_sitelib}/django_q/tests/
%python_expand %fdupes %{buildroot}%{$python_sitelib}
@@ -92,7 +99,7 @@ export DJANGO_SETTINGS_MODULE=tests.settings
export PYTHONPATH=${PWD}
timeout 5m %{_sbindir}/redis-server &
timeout 20m %{_sbindir}/redis-server &
# Mongo & Disque servers not installed
# test_max_rss assertions fail
%pytest -k 'not (mongo or disque or test_max_rss)'