diff mbox series

[bug#65758,v7,23/57] gnu: python-django-sortedm2m: Update to 3.1.1-0-ddf321f.

Message ID 574033b800e3e5d50bee3be69ea58a9917614e60.1693991781.git.ngraves@ngraves.fr
State New
Headers show
Series [bug#65758,v7,01/57] gnu: python-django-4.0: Update to 4.0.9. | expand

Commit Message

Nicolas Graves Sept. 6, 2023, 9:15 a.m. UTC
* gnu/packages/django.scm (python-django-sortedm2m): Update to 3.1.1-0-ddf321f.
[build-system]: Use pyproject-build-system.
[arguments](tests?): Disable tests.
(phases): Execute phase 'check command when tests?.
[native-inputs]: Add python-psycopg2.
---
 gnu/packages/django.scm | 58 ++++++++++++++++++++++++-----------------
 1 file changed, 34 insertions(+), 24 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index 11e4279829..00a83ab06d 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -975,32 +975,42 @@  (define-public python-django-q
     (license license:expat)))
 
 (define-public python-django-sortedm2m
-  (package
-    (name "python-django-sortedm2m")
-    (version "3.0.2")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "django-sortedm2m" version))
-              (sha256
-               (base32
-                "0z0yymmrr2l5cznqbzwziw624df0qsiflvbpqwrpan52nww3dk4a"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:phases (modify-phases %standard-phases
-                  (replace 'check
-                    (lambda _
-                      (invoke "django-admin"
-                              "test" "--settings=test_project.settings"
-                              "--pythonpath=."))))))
-    (propagated-inputs
-     (list python-django-3.2))
-    (home-page "https://github.com/jazzband/django-sortedm2m")
-    (synopsis "Drop-in replacement for django's own ManyToManyField")
-    (description
-      "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
+  (let ((commit "ddf321fc9736b9a9477d496c60250270111cf2ce")
+        (revision "0"))
+    (package
+      (name "python-django-sortedm2m")
+      (version (git-version "3.1.1" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/jazzband/django-sortedm2m")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1j08xyvlc5dypd26p48v0dj3k5g5ssrygvdy8zgg64g3iw8sw7v3"))))
+      (build-system pyproject-build-system)
+      (arguments
+       `(#:tests? #f ; require a running postgresql server
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (invoke "django-admin"
+                         "test" "--settings=test_project.settings"
+                         "--pythonpath=.")))))))
+      (native-inputs
+       (list python-psycopg2))
+      (propagated-inputs
+       (list python-django))
+      (home-page "https://github.com/jazzband/django-sortedm2m")
+      (synopsis "Drop-in replacement for django's own ManyToManyField")
+      (description
+       "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
 The provided SortedManyToManyField behaves like the original one but remembers
 the order of added relations.")
-    (license license:bsd-3)))
+      (license license:bsd-3))))
 
 (define-public python-django-appconf
   (package