[bug#77541,35/38] gnu: python-django-rq: Update to 3.0.0.

Message ID 20250404191717.32747-35-ngraves@ngraves.fr
State New
Headers
Series [bug#77541,01/38] gnu: Add clipper2. |

Commit Message

Nicolas Graves April 4, 2025, 7:17 p.m. UTC
  * gnu/packages/django.scm (python-django-rq): Update to 3.0.0.
[arguments]{test-flags}: Ignore failing tests.
{phases}: Replace 'check phase replacement by a simpler 'pre-check
configuration phase.
[native-inputs]: Add python-pytest, python-pytest-django.
[propagated-inputs]: Add python-redis, python-pyaml.
---
 gnu/packages/django.scm | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
  

Patch

diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index cb9df0d2df..44d47b39ab 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -1055,39 +1055,41 @@  (define-public python-django-redis
 (define-public python-django-rq
   (package
     (name "python-django-rq")
-    (version "2.7.0")
+    (version "3.0.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "django-rq" version))
               (sha256
                (base32
-                "0aw0fi0lg80qgdp9fhjbnlhvfh2p09rgy1nj6hxpyhi37kihni2h"))))
+                "1b371w4cdjlz83i2sg4gpx0z3svl3bfrn6zfy661374hv62xpnkv"))))
     (build-system pyproject-build-system)
     (arguments
      (list
+      #:test-flags
+      #~(list "-k" "not test_scheduled_jobs and not test_started_jobs")
       #:phases
-      '(modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "redis-server" "--daemonize" "yes")
-               (invoke "django-admin" "test" "django_rq"
-                       "--settings=django_rq.tests.settings"
-                       "--pythonpath=.")))))))
+      #~(modify-phases %standard-phases
+          (add-before 'check 'pre-check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "redis-server" "--daemonize" "yes")
+                (setenv "DJANGO_SETTINGS_MODULE" "django_rq.tests.settings")
+                (setenv "PYTHONPATH" (getcwd))))))))
     (native-inputs
      (list python-django-redis
-           python-mock
+           python-pytest
+           python-pytest-django
            python-rq-scheduler
            python-setuptools
            python-wheel
            redis
            tzdata-for-tests))
     (propagated-inputs
-     (list python-django python-rq))
+     (list python-django python-redis python-rq python-pyaml))
     (home-page "https://github.com/ui/django-rq")
     (synopsis "Django integration with RQ")
     (description
-      "Django integration with RQ, a Redis based Python queuing library.
+     "Django integration with RQ, a Redis based Python queuing library.
 Django-RQ is a simple app that allows you to configure your queues in django's
 settings.py and easily use them in your project.")
     (license license:expat)))