From d7ee2fc4eb93dd170a01592ccc1473268e81806a Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
Date: Mon, 16 Nov 2015 09:28:37 -0800
Subject: [PATCH] gnu: Add python-contextlib2.

* gnu/packages/python.scm (python-contextlib2, python2-contextlib2):
  New variables.
---
 gnu/packages/python.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 4e54ef9..2353ab0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2015, Chris Marusich <cmmarusich@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5895,3 +5896,31 @@ automatically detect a wide range of file encodings.")
 
 (define-public python2-chardet
   (package-with-python2 python-chardet))
+
+(define-public python-contextlib2
+  (package
+    (name "python-contextlib2")
+    (version "0.4.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "contextlib2" version))
+        (sha256
+         (base32 "0cmp131dlh0d0zvw0aza1zd13glvngzk8lb4avks0hm7yxwdr9am"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _ (zero?
+                      (system* "python" "test_contextlib2.py", "-v")))))))
+    (home-page "http://contextlib2.readthedocs.org/")
+    (synopsis "Tools for decorators and context managers")
+    (description "This module is primarily a backport of the Python 3.2 contextlib to
+earlier Python versions.  Like contextlib, it provides utilities for common
+tasks involving decorators and context managers.  It also contains
+additional features that are not part of the standard library.")
+    (license psfl)))
+
+(define-public python2-contextlib2
+  (package-with-python2 python-contextlib2))
-- 
2.5.0

