diff mbox series

[bug#55474,v4,06/19] gnu: Add python-jinjalint.

Message ID d24f3cf41eae23acc2e5ea7a4ffb4b2c8e5ef70f.1685982295.git.ngraves@ngraves.fr
State New
Headers show
Series [bug#55474,v4,01/19] gnu: python-django-taggit: Update to 3.1.0. | expand

Commit Message

Nicolas Graves June 5, 2023, 4:25 p.m. UTC
* gnu/packages/python-xyz.scm (python-jinjalint): New variable.
---
 gnu/packages/python-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 59ebc31de5..2a1c8ec161 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5206,6 +5206,45 @@  (define-public python-pysdl2
 common SDL2 functionality.")
     (license license:cc0)))
 
+(define-public python-jinjalint
+  (package
+    (name "python-jinjalint")
+    (version "0.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jinjalint" version))
+       (sha256
+        (base32 "09qqqi6iggr64zms9j9sgfq9v5samvsqyyqk0s1y4gfjy6lf9424"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-build
+           (lambda _
+             ;; Lift requirements.
+             (substitute* "requirements.txt"
+               (("parsy==1.1.0.*") "parsy\n")
+               (("attrs==17.2.*") "attrs\n")
+               (("docopt==0.6.2.*") "docopt\n"))
+             ;; Python 3.10 support.
+             (substitute* "jinjalint/util.py"
+               (("import collections")
+                "from collections.abc import Iterable")
+               (("collections\\.Iterable")
+                "Iterable"))))
+         (replace 'check
+           (lambda* (#:key tests? inputs #:allow-other-keys)
+             (if tests?
+                 (invoke "python3" "-m" "jinjalint" "jinjalint/test.py")
+                 (format #t "test suite not run~%")))))))
+    (propagated-inputs (list python-attrs python-docopt python-parsy))
+    (home-page "https://github.com/motet-a/jinjalint")
+    (synopsis "Linter for Jinja-like templates")
+    (description "This package provides @code{jinjalint} a linter for
+Jinja-like templates in Python.")
+    (license license:expat)))
+
 (define-public python-pystache
   (package
     (name "python-pystache")