diff mbox series

[bug#64134,11/17] gnu: Add python-ascii-magic.

Message ID 20230617151840.1748096-11-monego@posteo.net
State New
Headers show
Series Add some Python financial libraries. | expand

Commit Message

Vinicius Monego June 17, 2023, 3:18 p.m. UTC
* gnu/packages/python-xyz.scm (python-ascii-magic): New variable.
---
 gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4c1a5fb7c8..6f9566f64e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -30766,6 +30766,43 @@  (define-public python-markuppy
 pythonic way.")
     (license license:expat)))
 
+(define-public python-ascii-magic
+  (package
+    (name "python-ascii-magic")
+    (version "2.3.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "ascii_magic" version))
+              (sha256
+               (base32
+                "119xcjidizz5ig0xqwnxggv06fjsydlvca66rxffvpk7n4f1mm1y"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:test-flags #~(list "-k" (string-append
+                                      ;; Skip online and clipboard tests.
+                                      "not test_from_url"
+                                      " and not test_wrong_url"
+                                      " and not test_quick_test"
+                                      " and not test_from_clipboard"))
+           #:phases #~(modify-phases %standard-phases
+                        ;; Test files are in tests/ directory but pytest
+                        ;; runs in the source root, symlink to find them.
+                        (add-before 'check 'image-paths
+                          (lambda _
+                            (for-each (lambda (fname)
+                                        (symlink (format #f "tests/~a" fname)
+                                                 (format #f "~a" fname)))
+                                      '("chicken_transparent.png"
+                                        "kid.jpg" "lion.jpg" "moon.jpg")))))))
+    (native-inputs (list python-pytest))
+    (propagated-inputs (list python-colorama python-pillow))
+    (home-page "https://github.com/LeandroBarone/python-ascii_magic")
+    (synopsis "Converts pictures into ASCII art")
+    (description
+     "Ascii Magic is a Python package that converts images into ASCII art for
+terminals and HTML.")
+    (license license:expat)))
+
 (define-public python-tablib
   (package
     (name "python-tablib")