summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2016-02-15 04:22:01 -0500
committerLeo Famulari <leo@famulari.name>2016-03-18 14:27:16 -0400
commit76b94885348b20c79c49613c07a0e472d284a36b (patch)
tree0fc9f6de46c5385140737b2781c439f66749e347 /gnu
parent0efde7d6d6370759f62cb38cc97bd9ee942cb23c (diff)
downloadguix-76b94885348b20c79c49613c07a0e472d284a36b.tar.gz
gnu: Add python2-pathlib.
* gnu/packages/python.scm (python-pathlib, python2-pathlib): New variables.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b2b906704f..cff82fa198 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -8349,3 +8349,37 @@ library.")
     (package (inherit responses)
       (native-inputs `(("python2-setuptools" ,python2-setuptools)
                        ,@(package-native-inputs responses))))))
+
+(define-public python-pathlib
+  (package
+    (name "python-pathlib")
+    (version "1.0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pathlib" version))
+              (sha256
+               (base32
+                "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _ (zero? (system* "python" "./test_pathlib.py")))))))
+    (home-page "https://pathlib.readthedocs.org/")
+    (synopsis "Object-oriented filesystem paths")
+    (description "Pathlib offers a set of classes to handle filesystem paths.
+It offers the following advantages over using string objects:
+
+@enumerate
+@item No more cumbersome use of os and os.path functions.  Everything can
+be done easily through operators, attribute accesses, and method calls.
+@item Embodies the semantics of different path types.  For example,
+comparing Windows paths ignores casing.
+@item Well-defined semantics, eliminating any inconsistencies or
+ambiguities (forward vs. backward slashes, etc.).
+@end enumerate\n")
+    (license license:expat)))
+
+(define-public python2-pathlib
+  (package-with-python2 python-pathlib))