gnu: r-fields: Update to 11.4.
[jackhill/guix/guix.git] / gnu / packages / django.scm
index 7c89757..2370de6 100644 (file)
@@ -34,6 +34,8 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages geo)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-compression)
+  #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages sphinx)
 (define-public python-django
   (package
     (name "python-django")
-    (version "1.11.28")
+    (version "1.11.29")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "Django" version))
               (sha256
                (base32
-                "1ss1jyip7mlbfjn27m0j6wx80s8h4ksg6g5annkgwigp8xgy6g5k"))))
+                "171jsi54fbnxzi2n3l4hkdmmwfnfrwacs180rw59l0bqcvxsw022"))))
     (build-system python-build-system)
     (arguments
      '(#:modules ((srfi srfi-1)
@@ -83,9 +85,6 @@
     ;; TODO: Install extras/django_bash_completion.
     (native-inputs
      `(("tzdata" ,tzdata-for-tests)
-       ;; bcrypt and argon2-cffi are extra requirements not yet in guix
-       ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0
-       ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt!
        ;; Remaining packages are test requirements taken from
        ;; tests/requirements/py3.txt
        ("python-docutils" ,python-docutils)
@@ -99,7 +98,9 @@
        ("python-sqlparse" ,python-sqlparse)
        ("python-tblib" ,python-tblib)))
     (propagated-inputs
-     `(("python-pytz" ,python-pytz)))
+     `(("python-argon2-cffi" ,python-argon2-cffi)
+       ("python-bcrypt" ,python-bcrypt)
+       ("python-pytz" ,python-pytz)))
     (home-page "https://www.djangoproject.com/")
     (synopsis "High-level Python Web framework")
     (description
@@ -1080,24 +1081,45 @@ higher quality while welcoming newcomers.")
 (define-public python-django-tagging
   (package
     (name "python-django-tagging")
-    (version "0.4.6")
+    (version "0.5.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "django-tagging" version))
        (sha256
         (base32
-         "0s7b4v45j783yaxs7rni10k24san0ya77nqz4s7zdf3jhfpk42r1"))))
+         "13afxx30chssclxzd9gqnvwm9qyrdpnlbs6iswdfa18phfj8zmi8"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (setenv "DJANGO_SETTINGS_MODULE" "tagging.tests.settings")
+             (invoke "django-admin" "test" "--pythonpath=."))))))
+    (inputs
+     `(("python-django" ,python-django)))
     (home-page "https://github.com/Fantomas42/django-tagging")
     (synopsis "Generic tagging application for Django")
     (description "This package provides a generic tagging application for
 Django projects, which allows association of a number of tags with any
 @code{Model} instance and makes retrieval of tags simple.")
+    (properties `((python2-variant . ,(delay python2-django-tagging))))
     (license license:bsd-3)))
 
 (define-public python2-django-tagging
-  (package-with-python2 python-django-tagging))
+  (let ((base (package-with-python2
+                (strip-python2-variant python-django-tagging))))
+    (package
+      (inherit base)
+      (version "0.4.6")
+      (source
+        (origin
+          (method url-fetch)
+          (uri (pypi-uri "django-tagging" version))
+          (sha256
+           (base32
+            "0s7b4v45j783yaxs7rni10k24san0ya77nqz4s7zdf3jhfpk42r1")))))))
 
 (define-public python-djangorestframework
   (package
@@ -1123,6 +1145,35 @@ Django projects, which allows association of a number of tags with any
 provides features like a web browseable API and authentication policies.")
     (license license:bsd-2)))
 
+(define-public python-django-sekizai
+  (package
+    (name "python-django-sekizai")
+    (version "1.1.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "django-sekizai" version))
+        (sha256
+         (base32
+          "1nc4sv109valdn6azmgm2j01k7khxy2wnji84z63x7fxsikfdxp2"))))
+    (build-system python-build-system)
+    (arguments '(#:tests? #f)) ; Tests not included with release.
+    (propagated-inputs
+     `(("python-django" ,python-django)
+       ("python-django-classy-tags" ,python-django-classy-tags)
+       ("python-six" ,python-six)))
+    (home-page "https://github.com/divio/django-sekizai")
+    (synopsis "Template blocks for Django projects")
+    (description "Sekizai means blocks in Japanese, and thats what this app
+provides.  A fresh look at blocks.  With @code{django-sekizai} you can define
+placeholders where your blocks get rendered and at different places in your
+templates append to those blocks.  This is especially useful for css and
+javascript.  Your subtemplates can now define css and javscript files to be
+included, and the css will be nicely put at the top and the javascript to the
+bottom, just like you should.  Also sekizai will ignore any duplicate content in
+a single block.")
+    (license license:bsd-3)))
+
 (define-public python-django-crispy-forms
   (package
     (name "python-django-crispy-forms")
@@ -1148,6 +1199,51 @@ provides features like a web browseable API and authentication policies.")
 forms using your favorite CSS framework, without writing template code.")
     (license license:expat)))
 
+(define-public python-django-compressor
+  (package
+    (name "python-django-compressor")
+    (version "2.4")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "django_compressor" version))
+        (sha256
+         (base32
+          "0kx7bclfa0sxlsz6ka70zr9ra00lks0hmv1kc99wbanx6xhirvfj"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+               (begin
+                 (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
+                 (invoke "django-admin" "test"
+                         "--pythonpath=."))
+               #t))))
+       ;; Tests fail with beautifulsoup 4.9+
+       ;; https://github.com/django-compressor/django-compressor/issues/998
+       #:tests? #f))
+    (propagated-inputs
+     `(("python-django-appconf" ,python-django-appconf)
+       ("python-rcssmin" ,python-rcssmin)
+       ("python-rjsmin" ,python-rjsmin)))
+    (native-inputs
+     `(("python-beautifulsoup4" ,python-beautifulsoup4)
+       ("python-brotli" ,python-brotli)
+       ("python-csscompressor" ,python-csscompressor)
+       ("python-django-sekizai" ,python-django-sekizai)
+       ("python-mock" ,python-mock)))
+    (home-page "https://django-compressor.readthedocs.io/en/latest/")
+    (synopsis
+     "Compress linked and inline JavaScript or CSS into single cached files")
+    (description
+     "Django Compressor combines and compresses linked and inline Javascript or
+CSS in a Django templates into cacheable static files by using the compress
+template tag.")
+    (license license:expat)))
+
 (define-public python-django-override-storage
   (package
     (name "python-django-override-storage")