gnu: r-opencyto: Update to 2.8.4.
[jackhill/guix/guix.git] / gnu / packages / django.scm
index e6fa81a..d73a1bb 100644 (file)
@@ -9,6 +9,7 @@
 ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
+;;; Copyright © 2022 Pradana Aumars <paumars@courrier.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +44,7 @@
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
 (define-public python-django-4.0
   (package
     (name "python-django")
-    (version "4.0.4")
+    (version "4.0.7")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "Django" version))
               (sha256
                (base32
-                "1da0vy3nas2m2j50dc5c3s1nv529lagg4c04riipah94hn2pg0af"))))
+                "0qblhh7s7fcznqr79919yp2d7wiz3ixv39navmifb677dg9mlvcw"))))
     (build-system python-build-system)
     (arguments
      '(#:phases
@@ -140,29 +142,45 @@ to the @dfn{don't repeat yourself} (DRY) principle.")
 (define-public python-django-3.2
   (package
     (inherit python-django-4.0)
-    (version "3.2.12")
+    (version "3.2.15")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "Django" version))
               (sha256
                (base32
-                "1qj1kvb6mk2f4b33n4n5l4rh5kqllrk2v0v076crxr83ay9ycwlp"))))
+                "0asqhsw73555wjnvd7769b89q9w96q2k95mcr634mw92m2qk86gp"))))
     (native-search-paths '())           ;no need for TZDIR
     (propagated-inputs
      (modify-inputs (package-propagated-inputs python-django-4.0)
        ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
        (append python-pytz)))))
 
+;; archivebox requires django>=3.1.3,<3.2
+(define-public python-django-3.1.14
+  (package
+    (inherit python-django-3.2)
+    (version "3.1.14")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "Django" version))
+              (sha256
+               (base32
+                "0ix3v2wlnplv78zxjrlw8z3hiap2d5mxvk0ny2fc65526shsb93j"))))
+    (propagated-inputs
+     (modify-inputs (package-propagated-inputs python-django-3.2)
+       ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
+       (append python-pytz)))))
+
 (define-public python-django-2.2
   (package
     (inherit python-django-3.2)
-    (version "2.2.27")
+    (version "2.2.28")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "Django" version))
               (sha256
                (base32
-                "04y9knxd8v9jn54ws5rbdwxyq5im69kx009s7gl62axzn1371qqy"))))
+                "04vl7aivsshzsnn547lm4jdinr67afhdspc40f0c06xzmxbvc002"))))
     (native-inputs
      (modify-inputs (package-native-inputs python-django-3.2)
        (prepend ;; 2.2 requires Selenium for the test suite.
@@ -1183,13 +1201,13 @@ FileFields during tests.")
 (define-public python-django-auth-ldap
   (package
     (name "python-django-auth-ldap")
-    (version "4.0.0")
+    (version "4.1.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "django-auth-ldap" version))
               (sha256
                (base32
-                "0fajn4bk7m1hk0mjz97q7vlfzh7ibzv8f4qn7zhkq26f4kk7jvr7"))))
+                "0jd9jms9qpa92fk5n7gqcxjk3zs6ay79r73ann7cw1vqn79lkxvp"))))
     (build-system python-build-system)
     (arguments
      (list #:phases
@@ -1256,13 +1274,13 @@ to ElasticSearch.")
 (define-public python-django-netfields
   (package
     (name "python-django-netfields")
-    (version "1.2.4")
+    (version "1.3.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "django-netfields" version))
               (sha256
                (base32
-                "0jwlbyaxk91fq69g2y0zpfjgmjgh6l0lqm5mhys7m5968lkihvgp"))))
+                "122d0db1f420cwzrd7hynfbnnpqkjj2ridym5mrnj0l736nin5rr"))))
     (build-system python-build-system)
     (arguments '(#:tests? #f))      ;XXX: Requires a running PostgreSQL server
     (propagated-inputs
@@ -1344,3 +1362,54 @@ Django's filtering system in ORM).")
 models that use Django's standard @code{ImageField}, in addition to the
 image files already supported by it.")
     (license license:expat)))
+
+(define-public python-django-cleanup
+  (package
+    (name "python-django-cleanup")
+    (version "6.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/un1t/django-cleanup")
+             (commit (string-append version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0c1nghn1bnlq0a4d3sy3s363ksqsnxksixbimdy3cc6a0vk4sjps"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tests-settings
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; django-cleanup optionally integrates with
+             ;; sorl-thumbnail, which is not available in Guix yet, so
+             ;; this patch comments it out to avoid import failures in
+             ;; test settings.
+             (substitute* "django_cleanup/testapp/settings.py"
+               (("'sorl\\.thumbnail',") "# 'sorl.thumbnail',"))))
+         (replace 'check
+           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               ;; Add CWD to PYTHONPATH so that the tests can find the
+               ;; testapp package in the source.
+               (setenv "PYTHONPATH" (getcwd))
+               (invoke "pytest")))))))
+    (native-inputs
+     (list ;; python-django-sorl-thumbnail  ; TODO: Add to Guix.
+           python-easy-thumbnails
+           python-pillow
+           python-pytest
+           python-pytest-cov
+           python-pytest-django
+           python-pytest-xdist))
+    (propagated-inputs
+     (list python-django))
+    (home-page "https://github.com/un1t/django-cleanup")
+    (synopsis "Automatically deletes unused media files")
+    (description "This application automatically deletes user-uploaded
+files when a model is modified or deleted.  It works for FileField,
+ImageField and their subclasses.  Files set as default values for any
+FileField are not deleted.")
+    (license license:expat)))