summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2017-04-22 14:47:22 +0200
committerJulien Lepiller <julien@lepiller.eu>2017-05-11 21:57:32 +0200
commit38a370d2bca0502d41186327a5478d542418739e (patch)
tree842a16c2f54fe84a1e5a6d83f02c79b04e9eb252
parenta17ccbbb12eddda9aeb43ec8e004d716c15af4da (diff)
gnu: Add python-scandir.
* gnu/packages/python.scm (python-scandir, python2-scandir): New variables.
-rw-r--r--gnu/packages/python.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 79615862f2..4b87a3b3e1 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14414,3 +14414,27 @@ It supports both normal and Unicode strings.")
(define-public python2-levenshtein
(package-with-python2 python-levenshtein))
+
+(define-public python-scandir
+ (package
+ (name "python-scandir")
+ (version "1.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "scandir" version))
+ (sha256
+ (base32 "0yjrgp0mxp3d8bjkq2m1ac2ys8n76wykksvgyjrnil9gr3fx7a5d"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/benhoyt/scandir")
+ (synopsis "Directory iteration function")
+ (description
+ "Directory iteration function like os.listdir(), except that instead of
+returning a list of bare filenames, it yields DirEntry objects that include
+file type and stat information along with the name. Using scandir() increases
+the speed of os.walk() by 2-20 times (depending on the platform and file
+system) by avoiding unnecessary calls to os.stat() in most cases.")
+ (license license:bsd-3)))
+
+(define-public python2-scandir
+ (package-with-python2 python-scandir))