summary refs log tree commit diff
diff options
context:
space:
mode:
authorVinicius Monego <monego@posteo.net>2021-10-21 03:52:46 +0000
committerEfraim Flashner <efraim@flashner.co.il>2021-11-08 22:36:33 +0200
commitb43ad8400a7e25edbf5435c9f450fbf32366c880 (patch)
treef93a300218c8e12b5a0ba5c5b60cc55dffac4141
parenta6dc9f783f9da7beb0d93a761149b36d263ed6ce (diff)
downloadguix-b43ad8400a7e25edbf5435c9f450fbf32366c880.tar.gz
gnu: Add python-filetype.
* gnu/packages/python-xyz.scm (python-filetype): New variable.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
-rw-r--r--gnu/packages/python-xyz.scm33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8ba72170c0..c4c2fe2651 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11071,6 +11071,39 @@ your package is installed, via @code{pkg_resources} (part of
 @code{setuptools}).")
     (license license:gpl3+)))
 
+(define-public python-filetype
+  (package
+    (name "python-filetype")
+    (version "1.0.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "filetype" version))
+       (sha256
+        (base32 "05mkinkcn36v1cnb5hzay3zxmv7jmmflckxxp08rgzbkkf3i9pvp"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest" "-k"
+                       (string-append
+                        ;; Both tests fail with FileNotFoundError.
+                        "not test_infer_zip_from_disk"
+                        " and not test_infer_tar_from_disk"))))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-benchmark" ,python-pytest-benchmark)))
+    (home-page "https://github.com/h2non/filetype.py")
+    (synopsis "Infer file type and MIME type of any file/buffer")
+    (description "@code{filetype} is a small and dependency free Python
+package to infer file type and MIME type checking the magic numbers
+signature of a file or buffer.")
+    (license license:expat)))
+
 (define-public python-legacy-api-wrap
   (package
     (name "python-legacy-api-wrap")