summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/admin.scm22
-rw-r--r--gnu/packages/bioinformatics.scm31
-rw-r--r--gnu/packages/calendar.scm2
-rw-r--r--gnu/packages/django.scm13
-rw-r--r--gnu/packages/enlightenment.scm12
-rw-r--r--gnu/packages/jrnl.scm2
-rw-r--r--gnu/packages/music.scm2
-rw-r--r--gnu/packages/openstack.scm84
-rw-r--r--gnu/packages/patches/python-pyopenssl-skip-network-test.patch50
-rw-r--r--gnu/packages/pdf.scm4
-rw-r--r--gnu/packages/python.scm926
-rw-r--r--gnu/packages/rdf.scm22
-rw-r--r--gnu/packages/terminals.scm3
-rw-r--r--gnu/packages/version-control.scm2
-rw-r--r--gnu/packages/vpn.scm8
16 files changed, 904 insertions, 280 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 0e8d901104..8615d12b08 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -861,6 +861,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-configobj-setuptools.patch	\
   %D%/packages/patches/python-paste-remove-website-test.patch	\
   %D%/packages/patches/python-paste-remove-timing-test.patch	\
+  %D%/packages/patches/python-pyopenssl-skip-network-test.patch	\
   %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch	\
   %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index b2207a1205..e12cfd23e3 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1698,15 +1698,29 @@ throughput (in the same interval).")
                (base32
                 "04q2cn8c83f6z6wn1scla1ilrpi5ssjc64987hvmwfvwvb82bvkp"))))
     (build-system python-build-system)
-    (inputs
+    (arguments
+     '(#:tests? #f))
+       ;; FIXME: 10 test failures. Some require newer pytest (> 2.9.2).
+       ;; Others need more work. Un-comment the below to run the tests.
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       ;; Some tests need write access to $HOME.
+       ;;       (setenv "HOME" "/tmp")
+       ;;       (zero? (system* "py.test" "-v")))))))
+    (propagated-inputs
      `(("python-colorama" ,python-colorama)
        ("python-decorator" ,python-decorator)
        ("python-psutil" ,python-psutil)
        ("python-six" ,python-six)))
     (native-inputs
-     ;; Requires setuptools >= 17.1 due to some features used, while our
-     ;; python currently only includes 12.0. TODO: Remove this input.
-     `(("python-setuptools" ,python-setuptools)))
+     `(("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-mock" ,python-pytest-mock)
+       ;; Requires setuptools >= 17.1 due to some features used, while our
+       ;; python currently only includes 12.0. TODO: Remove this input.
+       ("python-setuptools" ,python-setuptools)))
     (home-page "https://github.com/nvbn/thefuck")
     (synopsis "Correct mistyped console command")
     (description
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index a448b51c6c..5a1738b936 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -604,6 +604,8 @@ Python.")
       ("python-future" ,python-future)
       ("python-click" ,python-click)
       ("python-h5py" ,python-h5py)))
+   (native-inputs
+    `(("python-nose" ,python-nose)))
    (home-page "http://www.biom-format.org")
    (synopsis "Biological Observation Matrix (BIOM) format utilities")
    (description
@@ -1602,6 +1604,7 @@ databases.")
        ("python-scipy" ,python2-scipy)))
     (native-inputs
      `(("python-mock" ,python2-mock)   ; for tests
+       ("python-nose" ,python2-nose)   ; for tests
        ("python-pytz" ,python2-pytz))) ; for tests
     (home-page "https://github.com/YeoLab/clipper")
     (synopsis "CLIP peak enrichment recognition")
@@ -2030,6 +2033,7 @@ trees (phylogenies) and characters.")
        ("python-pybigwig" ,python2-pybigwig)))
     (native-inputs
      `(("python-mock" ,python2-mock)   ;for tests
+       ("python-nose" ,python2-nose)   ;for tests
        ("python-pytz" ,python2-pytz))) ;for tests
     (home-page "https://github.com/fidelram/deepTools")
     (synopsis "Tools for normalizing and visualizing deep-sequencing data")
@@ -2969,28 +2973,10 @@ data.  It also provides the bgzip, htsfile, and tabix utilities.")
                 "1k3x44biak00aiv3hpm1yd6nn4hhp7n0qnbs3zh2q9sw7qr1qj5r"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after
-          'install 'wrap-program
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let* ((out (assoc-ref outputs "out"))
-                   (python-version (string-take (string-take-right
-                                                 (assoc-ref inputs "python") 5) 3))
-                   (path (string-join
-                          (map (lambda (name)
-                                 (string-append (assoc-ref inputs name)
-                                                "/lib/python" python-version
-                                                "/site-packages"))
-                               '("python-scipy"
-                                 "python-numpy"
-                                 "python-matplotlib"))
-                          ":")))
-              (wrap-program (string-append out "/bin/idr")
-                `("PYTHONPATH" ":" prefix (,path))))
-            #t)))))
-    (inputs
+     `(#:tests? #f)) ; FIXME: "ImportError: No module named 'utility'"
+    (propagated-inputs
      `(("python-scipy" ,python-scipy)
+       ("python-sympy" ,python-sympy)
        ("python-numpy" ,python-numpy)
        ("python-matplotlib" ,python-matplotlib)))
     (native-inputs
@@ -3679,6 +3665,9 @@ the phenotype as it models the data.")
       (build-system python-build-system)
       (arguments
        `(#:python ,python-2
+         ;; FIXME: Tests fail with "No such file or directory:
+         ;; pbtools/pbtranscript/modified_bx_intervals/intersection_unique.so"
+         #:tests? #f
          #:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'enter-directory
diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm
index 70d9991659..bc044918a8 100644
--- a/gnu/packages/calendar.scm
+++ b/gnu/packages/calendar.scm
@@ -125,7 +125,7 @@ data units.")
      `(("sqlite" ,sqlite)))
     (propagated-inputs
      `(("python-configobj" ,python-configobj)
-       ("python-dateutil-2" ,python-dateutil-2)
+       ("python-dateutil" ,python-dateutil)
        ("python-icalendar" ,python-icalendar)
        ("python-tzlocal" ,python-tzlocal)
        ("python-urwid" ,python-urwid)
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index 9a3c66c45e..185fbf8e62 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -106,6 +106,10 @@ to the @dfn{don't repeat yourself} (DRY) principle.")
                (base32
                 "0906hms6y6znjhpd0g4wmzv9vcla4brkdpsm4zha9zdj8g5vq2hd"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: Upstream uses a 'runtests.py' script that is not
+     ;; present in the pypi tarball.
+     '(#:tests? #f))
     (propagated-inputs
      `(("python-django" ,python-django)))
     (home-page "https://github.com/alsoicode/django-simple-math-captcha")
@@ -131,7 +135,8 @@ with arguments to the field constructor.")
                 "1mmc7zsz3dlhs6sx4sppkj1vgshabi362r1a8b8wpj1qfximpqcb"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
+     `(#:tests? #f ; FIXME: How to run tests?
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-setuppy
            (lambda _
@@ -163,6 +168,12 @@ useful tools for testing Django applications and projects.")
                (base32
                 "0f78hmk8c903zwfzlsiw7ivgag81ymmb5hi73rzxbhnlg2v0l3fx"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "runtests.py")))))))
     (native-inputs
      `(("python-django" ,python-django)
        ("python-mock" ,python-mock)))
diff --git a/gnu/packages/enlightenment.scm b/gnu/packages/enlightenment.scm
index a34578afe7..d9eef54b88 100644
--- a/gnu/packages/enlightenment.scm
+++ b/gnu/packages/enlightenment.scm
@@ -253,7 +253,17 @@ embedded systems.")
          (lambda _
            (setenv "CFLAGS"
                    (string-append "-I" (assoc-ref %build-inputs "python-dbus")
-                                  "/include/dbus-1.0")))))))
+                                  "/include/dbus-1.0"))
+           #t))
+        (add-before 'check 'set-environment
+          (lambda _
+            ;; Some tests require write access to HOME.
+            (setenv "HOME" "/tmp")
+            #t)))
+       ;; FIXME: Some tests require a running D-Bus server or a network
+       ;; connection and should be disabled. Other test failures looks
+       ;; legitimate. Disabled for now, needs work!
+       #:tests? #f))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("python-cython" ,python-cython)))
diff --git a/gnu/packages/jrnl.scm b/gnu/packages/jrnl.scm
index ef1f52956c..f26de0d4ab 100644
--- a/gnu/packages/jrnl.scm
+++ b/gnu/packages/jrnl.scm
@@ -48,7 +48,7 @@
        ("python-pytz" ,python-pytz)
        ("python-tzlocal" ,python-tzlocal)
        ("python-six" ,python-six)
-       ("python-dateutil" , python-dateutil-2)
+       ("python-dateutil" ,python-dateutil)
        ("python-parsedatetime" ,python-parsedatetime)))
     (home-page "http://maebert.github.io/jrnl/")
     (synopsis "Personal journal application")
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index ce874ac436..b603b0580e 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -2061,6 +2061,8 @@ detailed track info including timbre, pitch, rhythm and loudness information.
                (base32
                 "0bml11gfkxqd3i2jxkn5k2xllc4rvxjcyhs8an05gcyy1zp2bwvb"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Requires unpackaged python-flaky.
     (native-inputs
      `(("python-coverage" ,python-coverage)
        ("python-mock" ,python-mock)
diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm
index e2672668d8..5bb83095a0 100644
--- a/gnu/packages/openstack.scm
+++ b/gnu/packages/openstack.scm
@@ -19,6 +19,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages openstack)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages python)
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages tls)
@@ -81,6 +82,8 @@ all the files it generates a report.")
           (base32
            "0g4dfskaiy47rhsh4gh66l5vmdsrgq0qk68pl3ix1cj3ffvfndzv"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ;FIXME: Requires packaging python-doc8.
     (propagated-inputs
      `(("python-six" ,python-six)
        ("python-wrapt" ,python-wrapt)))
@@ -113,6 +116,9 @@ manner.")
         (base32
          "1a310k3dv04jg7zvmk37h2ql7y9kf4hvdxb74bjlwdxgmy6h4wap"))))
     (build-system python-build-system)
+    (arguments
+     ;; TODO: Requires unpackaged 'eventlet'.
+     '(#:tests? #f))
     (propagated-inputs
       `(("python-flake8-2.2.4" ,python-flake8-2.2.4)
         ("python-mccabe-0.2.1" ,python-mccabe-0.2.1)
@@ -146,9 +152,14 @@ guidelines}.")
           (base32
            "0njmh40i1lg5mzn9hc2ax83adj6dli455j6xifilrw27c4wlkjzx"))))
     (build-system python-build-system)
+    (arguments
+     ;; TODO: Resolve dependency cycle and re-enable.
+     '(#:tests? #f))
     (native-inputs
       `(("python-fixtures" ,python-fixtures)
+        ; TODO re-add ("python-oslosphinx" ,python-oslosphinx)
         ("python-pbr" ,python-pbr)
+        ("python-sphinx" ,python-sphinx)
         ("python-testtools" ,python-testtools)))
     (home-page "http://www.openstack.org/")
     (synopsis "Mock object framework for Python")
@@ -282,10 +293,13 @@ portions of your testing code.")
     (native-inputs
       `(("python-pbr" ,python-pbr)
         ;; Tests
+        ("python-discover" ,python-discover)
         ("python-docutils" ,python-docutils)
         ("python-mock" ,python-mock)
+        ("python-oslosphinx" ,python-oslosphinx)
         ("python-oslotest" ,python-oslotest)
-        ("python-sphinx" ,python-sphinx)))
+        ("python-sphinx" ,python-sphinx)
+        ("python-testrepository" ,python-testrepository)))
     (home-page "https://github.com/dreamhost/stevedore")
     (synopsis "Manage dynamic plugins for Python applications")
     (description
@@ -315,7 +329,8 @@ extensions.")
         "1cpp2vwmawpd29hjsklsps181lq2ah91cl412qvpnz228nf9sqn5"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
+     `(#:tests? #f ; FIXME: Requires oslo.log >= 1.14.0.
+       #:phases
        (modify-phases %standard-phases
          (add-before
           'check 'pre-check
@@ -362,6 +377,8 @@ common features used in Tempest.")
          (base32
           "13r778jfb0fhna37c2pd1f2xipnsbd7zli7qhn96acrzymrwj5k1"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Requires packaging python-argparse.
     (propagated-inputs
       `(("python-netaddr" ,python-netaddr)
         ("python-six" ,python-six)
@@ -395,11 +412,19 @@ common features used in Tempest.")
         (base32
          "0kvha0rs9295njyl2z6n6zm5dapi5mrl5zwjm0m6ldqrvccyf8c3"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Requires python-mock >= 1.2.
     (native-inputs
       `(("python-babel" ,python-babel)
         ("python-pbr" ,python-pbr)
         ;; Tests.
-        ("python-oslotest" ,python-oslotest)))
+        ("python-coverage" ,python-coverage)
+        ("python-hacking" ,python-hacking)
+        ("python-mock" ,python-mock)
+        ("python-os-client-config" ,python-os-client-config)
+        ("python-oslotest" ,python-oslotest)
+        ("python-oslosphinx" ,python-oslosphinx)
+        ("python-sphinx" ,python-sphinx)))
     (home-page "http://launchpad.net/oslo")
     (synopsis "Oslo context library")
     (description
@@ -423,6 +448,8 @@ pipeline and used by various modules such as logging.")
           (base32
            "0bpb1c20sm8my650gl824nzaip83bfn8hr91s65k5ncmyh8hb6pl"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Circular dependency on python-oslo.config.
     (propagated-inputs
       `(("python-babel" ,python-babel)
         ("python-six" ,python-six)))
@@ -459,6 +486,8 @@ in an application or library.")
         (base32
           "1fhy6yvbd565nv4x4i3ppyrlbmz3yy9d0xsvw5nkqsa7g43nmf8z"))))
   (build-system python-build-system)
+  (arguments
+   '(#:tests? #f)) ; FIXME: Requires oslo.utils >= 3.2.0.
   (propagated-inputs
    `(("python-debtcollector" ,python-debtcollector)
      ("python-oslo.config" ,python-oslo.config)
@@ -496,6 +525,8 @@ handlers and support for context specific logging (like resource id’s etc).")
         (base32
          "00s03krhf833gs76aw5ns32w9m1i4hx6x6d9g82m0j5wyqk0sci4"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Requires python-oslo.utils >= 3.2.0.
     (propagated-inputs
       `(("python-iso8601" ,python-iso8601)
         ("python-netaddr" ,python-netaddr)
@@ -520,6 +551,47 @@ in transmittable and storable formats, such as JSON and MessagePack.")
 (define-public python2-oslo.serialization
   (package-with-python2 python-oslo.serialization))
 
+(define-public python-reno
+  (package
+    (name "python-reno")
+    (version "2.0.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "reno" version))
+        (sha256
+          (base32 "1i2wnn5fnm3jm5774pahg000q0lma5i913hml91bbbm2mybphndd"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'init-git
+           (lambda _
+             ;; reno expects a git repo
+             (zero? (system* "git" "init")))))))
+    (propagated-inputs
+      `(("python-babel" ,python-babel)
+        ("python-dulwich" ,python-dulwich)
+        ("python-pyyaml" ,python-pyyaml)
+        ("python-six" ,python-six)))
+    (native-inputs
+      `(("python-testtools" ,python-testtools)
+        ("python-pbr" ,python-pbr)
+        ("python-testscenarios" ,python-testscenarios)
+        ("python-testrepository" ,python-testrepository)
+        ("python-mock" ,python-mock)
+        ("python-oslotest" ,python-oslotest)
+        ("gnupg" ,gnupg)
+        ("git" ,git)))
+    (home-page "http://docs.openstack.org/developer/reno/")
+    (synopsis "Release notes manager")
+    (description "Reno is a tool for storing release notes in a git repository
+and building documentation from them.")
+    (license asl2.0)))
+
+(define-public python2-reno
+  (package-with-python2 python-reno))
+
 (define-public python-oslosphinx
   (package
     (name "python-oslosphinx")
@@ -603,6 +675,8 @@ and better support for mocking results.")
             ;; phase.
             (delete-file "oslo_utils/tests/test_netutils.py")))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Requires oslo.config >= 2.7.0.
     (propagated-inputs
       `(("python-debtcollector" ,python-debtcollector)
         ("python-oslo.i18n" ,python-oslo.i18n)
@@ -616,6 +690,8 @@ and better support for mocking results.")
       `(("python-babel" ,python-babel)
         ("python-pbr" ,python-pbr)
         ;; Tests.
+        ("python-bandit" ,python-bandit)
+        ("python-oslo.config" ,python-oslo.config)
         ("python-oslotest" ,python-oslotest)
         ("python-mock" ,python-mock)
         ("python-mox3" ,python-mox3)
@@ -643,6 +719,8 @@ handling.")
          (base32
           "1w4csvkah67rfpxylxnvs2s3594i0f9isy8pf4gnsqs5zirvjaa4"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Many tests are failing.
     (native-inputs
      `(("python-sphinx" ,python-sphinx)
        ;; and some packages for the tests
diff --git a/gnu/packages/patches/python-pyopenssl-skip-network-test.patch b/gnu/packages/patches/python-pyopenssl-skip-network-test.patch
new file mode 100644
index 0000000000..a24eaf69a0
--- /dev/null
+++ b/gnu/packages/patches/python-pyopenssl-skip-network-test.patch
@@ -0,0 +1,50 @@
+This test tries connecting to an external server which is not supported
+in the build environment. See discussion at:
+
+https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00650.html
+
+diff --git a/tests/test_ssl.py b/tests/test_ssl.py
+index ee849fd..60048b8 100644
+--- a/tests/test_ssl.py
++++ b/tests/test_ssl.py
+@@ -1180,40 +1180,6 @@ class ContextTests(TestCase, _LoopbackMixin):
+             TypeError, context.load_verify_locations, None, None, None
+         )
+ 
+-    @pytest.mark.skipif(
+-        platform == "win32",
+-        reason="set_default_verify_paths appears not to work on Windows.  "
+-        "See LP#404343 and LP#404344."
+-    )
+-    def test_set_default_verify_paths(self):
+-        """
+-        :py:obj:`Context.set_default_verify_paths` causes the
+-        platform-specific CA certificate locations to be used for
+-        verification purposes.
+-        """
+-        # Testing this requires a server with a certificate signed by one
+-        # of the CAs in the platform CA location.  Getting one of those
+-        # costs money.  Fortunately (or unfortunately, depending on your
+-        # perspective), it's easy to think of a public server on the
+-        # internet which has such a certificate.  Connecting to the network
+-        # in a unit test is bad, but it's the only way I can think of to
+-        # really test this. -exarkun
+-
+-        # Arg, verisign.com doesn't speak anything newer than TLS 1.0
+-        context = Context(SSLv23_METHOD)
+-        context.set_default_verify_paths()
+-        context.set_verify(
+-            VERIFY_PEER,
+-            lambda conn, cert, errno, depth, preverify_ok: preverify_ok)
+-
+-        client = socket()
+-        client.connect(("encrypted.google.com", 443))
+-        clientSSL = Connection(context, client)
+-        clientSSL.set_connect_state()
+-        clientSSL.do_handshake()
+-        clientSSL.send(b"GET / HTTP/1.0\r\n\r\n")
+-        self.assertTrue(clientSSL.recv(1024))
+-
+     def test_set_default_verify_paths_signature(self):
+         """
+         :py:obj:`Context.set_default_verify_paths` takes no arguments and
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 2ea48e5999..58416ee66c 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -643,6 +643,10 @@ using a stylus.")
                (base32
                 "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
     (build-system python-build-system)
+    (arguments
+     '(;; FIXME: There is one test failure, but it does not cause the
+       ;; build to fail. No time to investigate right now.
+       #:test-target "tests"))
     (propagated-inputs
      `(("python-pillow" ,python-pillow)))
     (home-page "http://www.reportlab.com")
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 22a4c590b0..1492e0f369 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -69,6 +69,7 @@
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
@@ -77,6 +78,7 @@
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages networking)
@@ -89,6 +91,7 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
@@ -440,6 +443,9 @@ instead of @command{python3}.")))
         (base32
          "1w4r09fvn6kd80m5mx4ws1wz100brkaq6hzzpwrns8cgjzjpl6c6"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: some tests does not return and times out.
+     '(#:tests? #f))
     (home-page "https://www.github.com/giampaolo/psutil")
     (synopsis "Library for retrieving information on running processes")
     (description
@@ -540,6 +546,14 @@ John the Ripper).")
         (base32
          "14k8z7ndc3zk5xivnm4d8lncchx475ll5izpf8vmfbq7rp9yp5rj"))))
     (build-system python-build-system)
+    (arguments
+     '(;; FIXME: One test fails with "EOFError not raised by connect".
+       #:tests? #f))
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       (zero? (system* "python" "test.py")))))))
     (propagated-inputs
      `(("python-pycrypto" ,python-pycrypto)
        ("python-ecdsa" ,python-ecdsa)))
@@ -1048,6 +1062,9 @@ password storage.")
        (base32
         "0snmb8xffb3vsma0z67i0h0w2g2dy0p3gsgh9gi4i0kgc5l8spqh"))))
     (build-system python-build-system)
+    (native-inputs
+     `(("python-py" ,python-py)
+       ("python-pytest" ,python-pytest)))
     (home-page "http://pypi.python.org/pypi/six/")
     (synopsis "Python 2 and 3 compatibility utilities")
     (description
@@ -1061,7 +1078,7 @@ Python file, so it can be easily copied into your project.")
 (define-public python2-six
   (package-with-python2 python-six))
 
-(define-public python-dateutil-2
+(define-public python-dateutil
   (package
     (name "python-dateutil")
     (version "2.5.3")
@@ -1082,29 +1099,6 @@ Python file, so it can be easily copied into your project.")
 datetime module, available in Python 2.3+.")
     (license license:bsd-3)))
 
-(define-public python2-dateutil-2
-  (package-with-python2 python-dateutil-2))
-
-(define-public python-dateutil
-  (package
-    (name "python-dateutil")
-    (version "1.5") ; last version for python < 3
-    (source
-     (origin
-      (method url-fetch)
-      (uri (string-append "http://labix.org/download/python-dateutil/"
-                          "python-dateutil-" version ".tar.gz"))
-      (sha256
-       (base32
-        "0fqfglhy5khbvsipr3x7m6bcaqljh8xl5cw33vbfxy7qhmywm2n0"))))
-    (build-system python-build-system)
-    (home-page "https://dateutil.readthedocs.io/en/stable/")
-    (synopsis "Extensions to the standard datetime module")
-    (description
-     "The dateutil module provides powerful extensions to the standard
-datetime module, available in Python 2.3+.")
-    (license license:psfl)))
-
 (define-public python2-dateutil
   (package-with-python2 python-dateutil))
 
@@ -1150,7 +1144,7 @@ datetime module, available in Python 2.3+.")
     (propagated-inputs
      `(("python-numpy" ,python-numpy)
        ("python-pytz" ,python-pytz)
-       ("python-dateutil" ,python-dateutil-2)))
+       ("python-dateutil" ,python-dateutil)))
     (native-inputs
      `(("python-nose" ,python-nose)
        ("python-cython" ,python-cython)))
@@ -1726,6 +1720,12 @@ standard library.")
         (base32
          "0561gz2w3i825gyl42mcq14y3dcgkapfiv5zv9a2bz15qxiijl56"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: "ImportError: 'test' module incorrectly imported from
+     ;; '/gnu/store/...-python-pytest-mimimal-3.0.5/lib/python3.5/site-packages'.
+     ;; Expected '/tmp/guix-build-python-py-1.4.31.drv-0/py-1.4.31/py'.
+     ;; Is this module globally installed?"
+     '(#:tests? #f))
     (home-page "http://pylib.readthedocs.org/")
     (synopsis "Python library for parsing, I/O, instrospection, and logging")
     (description
@@ -1924,6 +1924,15 @@ same arguments.")
            (for-each delete-file (find-files "." "\\.pyc$"))
            #t))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ;FIXME: Some tests are failing.
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (delete 'check)
+       ;;   (add-after 'install 'check
+       ;;     (lambda* (#:key inputs outputs #:allow-other-keys)
+       ;;       (add-installed-pythonpath inputs outputs)
+       ;;       (zero? (system* "py.test" "-v")))))
     (native-inputs
      `(("unzip" ,unzip)
        ("python-setuptools-scm" ,python-setuptools-scm)))
@@ -1976,17 +1985,36 @@ subprocess and see the output as well as any file modifications.")
 (define-public python-testtools
   (package
     (name "python-testtools")
-    (version "1.0.0")
+    (version "1.4.0")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/t/testtools/testtools-"
-             version ".tar.gz"))
+       (uri (pypi-uri "testtools" version))
        (sha256
         (base32
-         "1dyml28ykpl5jb9khdmcdvhy1cxqingys6qvj2k04fzlaj6z3bbx"))))
+         "1vw8yljnd75d396hhw6s2hrf4cclzy845ifd5am0lxsl235z3i8c"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-module-imports
+           (lambda _
+             (substitute* "setup.py"
+               (("'unittest2>=0.8.0',") ""))
+             (substitute* '("testtools/testcase.py"
+                            "testtools/testsuite.py"
+                            "testtools/run.py"
+                            "testtools/tests/test_run.py"
+                            "testtools/tests/test_testsuite.py"
+                            "testtools/tests/test_deferredruntest.py")
+               ;; unittest2 is a backport of Python2.7 features to Python 2.4.
+               (("import unittest2 as unittest") "import unittest")
+               (("import unittest2") "import unittest as unittest2")
+               (("from unittest2 import") "from unittest import"))
+             (substitute* "testtools/tests/test_testresult.py"
+               ;; NUL in source code is not allowed (raises ValueError).
+               (("\\x00\\x04") "\\x04"))
+             #t)))))
     (propagated-inputs
      `(("python-mimeparse" ,python-mimeparse)
        ("python-extras" ,python-extras)))
@@ -2157,10 +2185,18 @@ from git information.
         (base32
          "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "-m" "testtools.run"
+                             "fixtures.test_suite")))))))
     (propagated-inputs
      `(("python-six" ,python-six)))
     (native-inputs
-     `(("python-pbr-minimal" ,python-pbr-minimal)
+     `(("python-mock" ,python-mock)
+       ("python-pbr-minimal" ,python-pbr-minimal)
        ("python-testtools" ,python-testtools)))
     (home-page "https://launchpad.net/python-fixtures")
     (synopsis "Python test fixture library")
@@ -2186,6 +2222,9 @@ Python tests.")
         (base32
          "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: Many tests are failing.
+     '(#:tests? #f))
     (propagated-inputs
      `(("python-fixtures" ,python-fixtures)
        ("python-subunit" ,python-subunit)
@@ -2215,6 +2254,9 @@ have failed since the last commit or what tests are currently failing.")
         (base32
          "01rbr4br4lsk0lwn8fb96zwd2xr4f0mg1w7iq3j11i8f5ig2nqs1"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
+     '(#:tests? #f))
     (home-page "http://nedbatchelder.com/code/coverage")
     (synopsis "Code coverage measurement for Python")
     (description
@@ -2390,7 +2432,12 @@ is used by the Requests library to verify HTTPS requests.")
                (substitute* "click/_unicodefun.py"
                  (("'locale'")
                   (string-append "'" glibc "/bin/locale'"))))
-             #t)))))
+             #t))
+         (replace 'check
+           (lambda _
+             (zero? (system* "make" "test")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (home-page "http://click.pocoo.org")
     (synopsis "Command line library for Python")
     (description
@@ -2442,19 +2489,18 @@ installed with a newer @code{pip} or with wheel's own command line utility.")
 (define-public python-requests
   (package
     (name "python-requests")
-    (version "2.9.1")
+    (version "2.12.4")
     (source (origin
              (method url-fetch)
              (uri (pypi-uri "requests" version))
              (sha256
               (base32
-               "0zsqrzlybf25xscgi7ja4s48y2abf9wvjkn47wh984qgs1fq2xy5"))))
+               "0d5fwxmw4ibynk3imph3n4n84m0n3ib1vj339fxhkqri0qd4767d"))))
+    ;; TODO: unbundle urllib3 and chardet.
     (build-system python-build-system)
-    (native-inputs
-     `(("python-py" ,python-py)
-       ("python-pytest" ,python-pytest)
-       ("python-pytest-cov" ,python-pytest-cov)
-       ("python-wheel" ,python-wheel)))
+    (arguments
+     ;; FIXME: Some tests require network access.
+     '(#:tests? #f))
     (home-page "http://python-requests.org/")
     (synopsis "Python HTTP library")
     (description
@@ -2627,6 +2673,7 @@ somewhat intelligeble.")
     (build-system python-build-system)
     (native-inputs
      `(("python-nose" ,python-nose)
+       ("python-mock" ,python-mock)
        ("python-cryptography" ,python-cryptography)
        ("python-pyjwt" ,python-pyjwt)
        ("python-blinker" ,python-blinker)))
@@ -2643,7 +2690,6 @@ OAuth request-signing logic.")
     (package
       (inherit base)
       (native-inputs `(("python2-unittest2" ,python2-unittest2)
-                       ("python2-mock" ,python2-mock)
                        ,@(package-native-inputs base))))))
 
 (define-public python-itsdangerous
@@ -2790,15 +2836,26 @@ written in pure Python.")
                (base32
                 "0nmqsfmiw4arjxqkmf9z66ml950pcdjk6aq4gin4sywmzdjw5fzp"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Python 3 tests are failing.
     (home-page "http://defunkt.io/pystache/")
     (synopsis "Python logic-less template engine")
     (description
      "Pystache is a Python implementation of the framework agnostic,
 logic-free templating system Mustache.")
-    (license license:expat)))
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pystache))))))
 
 (define-public python2-pystache
-  (package-with-python2 python-pystache))
+  (package (inherit (package-with-python2
+                     (strip-python2-variant python-pystache)))
+           (arguments
+            `(#:python ,python-2
+              #:phases
+              (modify-phases %standard-phases
+                (replace 'check
+                  (lambda _
+                    (zero? (system* "python" "test_pystache.py")))))))))
 
 (define-public python-joblib
   (package
@@ -2895,6 +2952,9 @@ reStructuredText.")
         (base32
          "10axnp2wpjnq9g8wg53fx0c70dfxqrz498jyz8mrdx9a3flwir48"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: Tests require sphinx, which depends on this.
+     '(#:tests? #f))
     (home-page "http://pygments.org/")
     (synopsis "Syntax highlighting")
     (description
@@ -2907,30 +2967,74 @@ reStructuredText.")
 (define-public python-sphinx
   (package
     (name "python-sphinx")
-    (version "1.2.3")
+    (version "1.5.1")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-"
-             version ".tar.gz"))
+       (uri (pypi-uri "Sphinx" version))
        (sha256
         (base32
-         "011xizm3jnmf4cvs5i6kgf6c5nn046h79i8j0vd0f27yw9j3p4wl"))))
+         "1i8p9idnli4gr0y4x67yakbdk5w6a0xjzhrg6bg51y9d1fi7fslf"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; Requires Internet access.
+             (delete-file "tests/test_build_linkcheck.py")
+             (zero? (system* "make" "test")))))))
     (propagated-inputs
-     `(("python-jinja2" ,python-jinja2)
+     `(("python-imagesize" ,python-imagesize)
+       ("python-sphinx-alabaster-theme"
+        ,python-sphinx-alabaster-theme)
+       ("python-babel" ,python-babel)
+       ("python-snowballstemmer" ,python-snowballstemmer)
        ("python-docutils" ,python-docutils)
-       ("python-pygments" ,python-pygments)))
+       ("python-jinja2" ,python-jinja2)
+       ("python-pygments" ,python-pygments)
+       ("python-six" ,python-six)))
+    (native-inputs
+     `(("graphviz" ,graphviz)
+       ("python-html5lib" ,python-html5lib)
+       ("python-mock" ,python-mock)
+       ("python-nose" ,python-nose)
+       ("python-requests" ,python-requests)))
     (home-page "http://sphinx-doc.org/")
     (synopsis "Python documentation generator")
     (description "Sphinx is a tool that makes it easy to create documentation
 for Python projects or other documents consisting of multiple reStructuredText
 sources.")
-    (license license:bsd-3)))
+    (license license:bsd-3)
+    (properties `((python2-variant . ,(delay python2-sphinx))))))
 
 (define-public python2-sphinx
-  (package-with-python2 python-sphinx))
+  (let ((base (package-with-python2 (strip-python2-variant python-sphinx))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-mock" ,python2-mock)
+                       ("python2-enum34" ,python2-enum34)
+                       ,@(package-native-inputs base)))
+      (propagated-inputs `(("python2-pytz" ,python2-pytz)
+                       ,@(package-propagated-inputs base))))))
+
+;; This is needed for python-matplotlib@1.4 and python-scipy@0.16, at least.
+;; Try removing this when they are updated.
+(define-public python-sphinx-1.2.3
+  (package (inherit python-sphinx)
+           (version "1.2.3")
+           (source (origin
+                     (method url-fetch)
+                     (uri (pypi-uri "Sphinx" version))
+                     (sha256
+                      (base32
+                       "011xizm3jnmf4cvs5i6kgf6c5nn046h79i8j0vd0f27yw9j3p4wl"))))
+           ;; XXX: "'NoneType' object has no attribute 'split'".
+           (arguments '(#:tests? #f))))
+
+(define-public python2-sphinx-1.2.3
+  (package (inherit (package-with-python2
+                     (strip-python2-variant python-sphinx-1.2.3)))))
 
 (define-public python-sphinx-rtd-theme
   (package
@@ -2946,6 +3050,8 @@ sources.")
         (base32
          "19nw3rn7awplcdrz63kg1njqwkbymfg9lwn7l2grhdyhyr2gaa8g"))))
     (build-system python-build-system)
+    (propagated-inputs
+     `(("python-sphinx" ,python-sphinx)))
     (home-page "https://github.com/snide/sphinx_rtd_theme/")
     (synopsis "ReadTheDocs.org theme for Sphinx")
     (description "A theme for Sphinx used by ReadTheDocs.org.")
@@ -2967,7 +3073,7 @@ sources.")
          "0bh4lnj2p1nh0wf5pgxgfbrp27xhb1rinahkb5j7s3qprq6qn0sr"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-dateutil" ,python-dateutil-2)
+     `(("python-dateutil" ,python-dateutil)
        ("python-six" ,python-six)))
     (native-inputs
      `(("python-setuptools-scm" ,python-setuptools-scm)))
@@ -3061,7 +3167,7 @@ interested parties to subscribe to events, or \"signals\".")
        ("python-blinker" ,python-blinker)
        ("python-unidecode" ,python-unidecode)
        ("python-six" ,python-six)
-       ("python-dateutil-2" ,python-dateutil-2)))
+       ("python-dateutil" ,python-dateutil)))
     (home-page "http://getpelican.com/")
     (arguments
      `(;; XXX Requires a lot more packages to do unit tests :P
@@ -3138,6 +3244,9 @@ mining and data analysis.")
        (sha256
         (base32 "0jz416fqvpahqyffw8plmszzfj669w8wvf3y9clnr5lr6a7md3kn"))))
     (build-system python-build-system)
+    (arguments
+     ;; TODO: Some tests require running X11 server. Disable them?
+     '(#:tests? #f))
     ;; See DEPENDS.txt for the list of build and run time requiremnts
     (propagated-inputs
      `(("python-matplotlib" ,python-matplotlib)
@@ -3387,7 +3496,8 @@ objects.")
     (native-inputs
      `(("unzip" ,unzip)
        ("python2-cython" ,python2-cython)
-       ("python2-mock" ,python2-mock)))
+       ("python2-mock" ,python2-mock)
+       ("python2-nose" ,python2-nose)))
     (home-page "http://research.microsoft.com/en-us/um/redmond/projects/mscompbio/fastlmm/")
     (synopsis "Perform genome-wide association studies on large data sets")
     (description
@@ -3622,7 +3732,7 @@ transcendental functions).")
        ("python-pygobject" ,python-pygobject)
        ("gobject-introspection" ,gobject-introspection)
        ("python-tkinter" ,python "tk")
-       ("python-dateutil" ,python-dateutil-2)
+       ("python-dateutil" ,python-dateutil)
        ("python-numpy" ,python-numpy-bootstrap)
        ("python-pillow" ,python-pillow)
        ("python-pytz" ,python-pytz)
@@ -3655,7 +3765,7 @@ transcendental functions).")
        ("tk" ,tk)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("python-sphinx" ,python-sphinx)
+       ("python-sphinx" ,python-sphinx-1.2.3)
        ("python-numpydoc" ,python-numpydoc)
        ("python-nose" ,python-nose)
        ("python-mock" ,python-mock)
@@ -3663,62 +3773,65 @@ transcendental functions).")
        ("texinfo" ,texinfo)))
     (arguments
      `(#:phases
-       (alist-cons-before
-        'build 'configure-environment
-        (lambda* (#:key outputs inputs #:allow-other-keys)
-          (let ((cairo (assoc-ref inputs "cairo"))
-                (gtk+ (assoc-ref inputs "gtk+")))
-            ;; Setting these directories in the 'basedirlist' of 'setup.cfg'
-            ;; has not effect.
-            (setenv "LD_LIBRARY_PATH"
-                    (string-append cairo "/lib:" gtk+ "/lib"))
-            (setenv "HOME" (getcwd))
-            (call-with-output-file "setup.cfg"
-              (lambda (port)
-                (format port "[directories]~%
+       (modify-phases %standard-phases
+         (add-before 'build 'configure-environment
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((cairo (assoc-ref inputs "cairo"))
+                   (gtk+ (assoc-ref inputs "gtk+")))
+               ;; Setting these directories in the 'basedirlist' of 'setup.cfg'
+               ;; has not effect.
+               (setenv "LD_LIBRARY_PATH"
+                       (string-append cairo "/lib:" gtk+ "/lib"))
+               (setenv "HOME" (getcwd))
+               (call-with-output-file "setup.cfg"
+                 (lambda (port)
+                   (format port "[directories]~%
 basedirlist = ~a,~a~%
  [rc_options]~%
 backend = TkAgg~%"
-                        (assoc-ref inputs "tcl")
-                        (assoc-ref inputs "tk"))))))
-        (alist-cons-after
-         'install 'install-doc
-         (lambda* (#:key inputs outputs #:allow-other-keys)
-           (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                  (doc (string-append data "/doc/" ,name "-" ,version))
-                  (info (string-append data "/info"))
-                  (html (string-append doc "/html")))
-             ;; Make installed package available for building the
-             ;; documentation
-             (add-installed-pythonpath inputs outputs)
-             (with-directory-excursion "doc"
-               ;; Produce pdf in 'A4' format.
-               (substitute* (find-files "." "conf\\.py")
-                 (("latex_paper_size = 'letter'")
-                  "latex_paper_size = 'a4'"))
-               (mkdir-p html)
-               (mkdir-p info)
-               ;; The doc recommends to run the 'html' target twice.
-               (system* "python" "make.py" "html")
-               (system* "python" "make.py" "html")
-               (copy-recursively "build/html" html)
-               (system* "python" "make.py" "latex")
-               (system* "python" "make.py" "texinfo")
-               (symlink (string-append html "/_images")
-                        (string-append info "/matplotlib-figures"))
-               (with-directory-excursion "build/texinfo"
-                 (substitute* "matplotlib.texi"
-                   (("@image\\{([^,]*)" all file)
-                    (string-append "@image{matplotlib-figures/" file)))
+                           (assoc-ref inputs "tcl")
+                           (assoc-ref inputs "tk"))))
+               #t)))
+         (add-after 'install 'install-doc
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                    (doc (string-append data "/doc/" ,name "-" ,version))
+                    (info (string-append data "/info"))
+                    (html (string-append doc "/html")))
+               ;; Make installed package available for building the
+               ;; documentation
+               (add-installed-pythonpath inputs outputs)
+               (with-directory-excursion "doc"
+                 ;; Produce pdf in 'A4' format.
+                 (substitute* (find-files "." "conf\\.py")
+                   (("latex_paper_size = 'letter'")
+                    "latex_paper_size = 'a4'"))
+                 (substitute* "users/intro.rst"
+                   ;; Fix reST markup error (see <https://github.com/sphinx-doc/sphinx/issues/3044>)
+                   (("[[][*][]]") "[#]"))
+                 (mkdir-p html)
+                 (mkdir-p info)
+                 ;; The doc recommends to run the 'html' target twice.
+                 (system* "python" "make.py" "html")
+                 (system* "python" "make.py" "html")
+                 (copy-recursively "build/html" html)
+                 (system* "python" "make.py" "latex")
+                 (system* "python" "make.py" "texinfo")
                  (symlink (string-append html "/_images")
-                          "./matplotlib-figures")
-                 (system* "makeinfo" "--no-split"
-                          "-o" "matplotlib.info" "matplotlib.texi"))
-               (copy-file "build/texinfo/matplotlib.info"
-                          (string-append info "/matplotlib.info"))
-               (copy-file "build/latex/Matplotlib.pdf"
-                          (string-append doc "/Matplotlib.pdf")))))
-        %standard-phases))))
+                          (string-append info "/matplotlib-figures"))
+                 (with-directory-excursion "build/texinfo"
+                   (substitute* "matplotlib.texi"
+                     (("@image\\{([^,]*)" all file)
+                      (string-append "@image{matplotlib-figures/" file)))
+                   (symlink (string-append html "/_images")
+                            "./matplotlib-figures")
+                   (system* "makeinfo" "--no-split"
+                            "-o" "matplotlib.info" "matplotlib.texi"))
+                 (copy-file "build/texinfo/matplotlib.info"
+                            (string-append info "/matplotlib.info"))
+                 (copy-file "build/latex/Matplotlib.pdf"
+                            (string-append doc "/Matplotlib.pdf")))
+                 #t))))))
     (home-page "http://matplotlib.org")
     (synopsis "2D plotting library for Python")
     (description
@@ -3736,6 +3849,10 @@ toolkits.")
     (package (inherit matplotlib)
       ;; Make sure to use special packages for Python 2 instead
       ;; of those automatically rewritten by package-with-python2.
+      (native-inputs
+       `(("python2-sphinx" ,python2-sphinx-1.2.3)
+         ,@(fold alist-delete (package-native-inputs matplotlib)
+                 '("python-sphinx"))))
       (propagated-inputs
        `(("python2-pycairo" ,python2-pycairo)
          ("python2-pygobject-2" ,python2-pygobject-2)
@@ -3786,6 +3903,16 @@ operators such as union, intersection, and difference.")
         (base32
          "0nhan2qvrw7b7gg5zddwa22kybdv3x1g26vkd7q8lvnkgzrs4dga"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             ;; It's easier to run tests after install.
+             ;; Make installed package available for running the tests
+             (add-installed-pythonpath inputs outputs)
+             (zero? (system* "python" "-m" "rpy2.tests" "-v")))))))
     (propagated-inputs
      `(("python-six" ,python-six)))
     (inputs
@@ -3833,7 +3960,7 @@ functions.")
        ("openblas" ,openblas)))
     (native-inputs
      `(("python-nose" ,python-nose)
-       ("python-sphinx" ,python-sphinx)
+       ("python-sphinx" ,python-sphinx-1.2.3)
        ("python-numpydoc" ,python-numpydoc)
        ("gfortran" ,gfortran)
        ("texlive" ,texlive)
@@ -3841,13 +3968,18 @@ functions.")
     (outputs '("out" "doc"))
     (arguments
      `(#:phases
-       (alist-cons-before
-        'build 'configure-openblas
-        (lambda* (#:key inputs #:allow-other-keys)
-          (call-with-output-file "site.cfg"
-            (lambda (port)
-              (format port
-                      "[blas]
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             (substitute* "scipy/integrate/tests/test_quadpack.py"
+               (("libm.so") "libm.so.6"))
+             #t))
+         (add-before 'build 'configure-openblas
+           (lambda* (#:key inputs #:allow-other-keys)
+             (call-with-output-file "site.cfg"
+               (lambda (port)
+                 (format port
+                         "[blas]
 libraries = openblas
 library_dirs = ~a/lib
 include_dirs = ~a/include
@@ -3857,53 +3989,44 @@ include_dirs = ~a/include
 library_dirs = ~a/lib
 atlas_libs = openblas
 "
-                      (assoc-ref inputs "openblas")
-                      (assoc-ref inputs "openblas")
-                      (assoc-ref inputs "openblas"))))
-          #t)
-        (alist-cons-after
-         'install 'install-doc
-         (lambda* (#:key inputs outputs #:allow-other-keys)
-           (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                  (doc (string-append data "/doc/" ,name "-" ,version))
-                  (html (string-append doc "/html"))
-                  (pyver ,(string-append "PYVER=")))
-             ;; Make installed package available for building the
-             ;; documentation
-             (add-installed-pythonpath inputs outputs)
-             (with-directory-excursion "doc"
-               ;; Fix generation of images for mathematical expressions.
-               (substitute* (find-files "source" "conf\\.py")
-                 (("pngmath_use_preview = True")
-                  "pngmath_use_preview = False"))
-               (mkdir-p html)
-               (system* "make" "html" pyver)
-               (system* "make" "latex" "PAPER=a4" pyver)
-               (system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" pyver)
-               (copy-file "build/latex/scipy-ref.pdf"
-                          (string-append doc "/scipy-ref.pdf"))
-               (with-directory-excursion "build/html"
-                 (for-each (lambda (file)
-                             (let* ((dir (dirname file))
-                                    (tgt-dir (string-append html "/" dir)))
-                               (install-file file html)))
-                           (find-files "." ".*"))))))
-         ;; Tests can only be run after the library has been installed and not
-         ;; within the source directory.
-         (alist-cons-after
-          'install 'check
-          (lambda _
-            (with-directory-excursion "/tmp"
-              (zero? (system* "python" "-c" "import scipy; scipy.test()"))))
-          (alist-delete
-           'check
-           (alist-cons-after
-            'unpack 'fix-tests
-            (lambda _
-              (substitute* "scipy/integrate/tests/test_quadpack.py"
-                (("libm.so") "libm.so.6"))
-              #t)
-            %standard-phases)))))))
+                         (assoc-ref inputs "openblas")
+                         (assoc-ref inputs "openblas")
+                         (assoc-ref inputs "openblas"))))
+             #t))
+           (delete 'check)
+           (add-after 'install 'install-doc
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                      (doc (string-append data "/doc/" ,name "-" ,version))
+                      (html (string-append doc "/html"))
+                      (pyver ,(string-append "PYVER=")))
+                 ;; Make installed package available for building the
+                 ;; documentation
+                 (add-installed-pythonpath inputs outputs)
+                 (with-directory-excursion "doc"
+                   ;; Fix generation of images for mathematical expressions.
+                   (substitute* (find-files "source" "conf\\.py")
+                     (("pngmath_use_preview = True")
+                      "pngmath_use_preview = False"))
+                   (mkdir-p html)
+                   (system* "make" "html" pyver)
+                   (system* "make" "latex" "PAPER=a4" pyver)
+                   (system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" pyver)
+                   (copy-file "build/latex/scipy-ref.pdf"
+                              (string-append doc "/scipy-ref.pdf"))
+                   (with-directory-excursion "build/html"
+                     (for-each (lambda (file)
+                                 (let* ((dir (dirname file))
+                                        (tgt-dir (string-append html "/" dir)))
+                                   (install-file file html)))
+                               (find-files "." ".*"))))
+                 #t)))
+           (add-after 'install-doc 'check
+             (lambda _
+               ;; Tests can only be run after the library has been installed and not
+               ;; within the source directory.
+               (with-directory-excursion "/tmp"
+                 (zero? (system* "python" "-c" "import scipy; scipy.test()"))))))))
     (home-page "http://www.scipy.org/")
     (synopsis "The Scipy library provides efficient numerical routines")
     (description "The SciPy library is one of the core packages that make up
@@ -3912,7 +4035,15 @@ routines such as routines for numerical integration and optimization.")
     (license license:bsd-3)))
 
 (define-public python2-scipy
-  (package-with-python2 python-scipy))
+  (let ((scipy (package-with-python2
+                (strip-python2-variant python-scipy))))
+    (package (inherit scipy)
+             ;; Make sure to use special packages for Python 2 instead
+             ;; of those automatically rewritten by package-with-python2.
+             (native-inputs
+              `(("python2-sphinx" ,python2-sphinx-1.2.3)
+                ,@(fold alist-delete (package-native-inputs scipy)
+                        '("python-sphinx")))))))
 
 (define-public python-socksipy-branch
   (package
@@ -4100,11 +4231,22 @@ both of which are installed automatically if you install this library.")
          (base32
           "1wghyvk73cmq3iqyg3fczw128fv2pan2v76m0xg1bw05h8fhvnk3"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Many tests require a running database server.
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       (zero? (system* "py.test" "sqlalchemy_utils" "tests")))))
     (propagated-inputs
      `(("python-six" ,python-six)
        ("python-sqlalchemy" ,python-sqlalchemy)))
     (native-inputs
-     `(("python-pytest" ,python-pytest)))
+     `(("python-dateutil" ,python-dateutil)
+       ("python-flexmock" ,python-flexmock)
+       ("python-psycopg2" ,python-psycopg2)
+       ("python-pytest" ,python-pytest)
+       ("python-pytz" ,python-pytz)))
     (home-page "https://github.com/kvesteri/sqlalchemy-utils")
     (synopsis "Various utility functions for SQLAlchemy")
     (description
@@ -4395,16 +4537,18 @@ a front-end for C compilers or analysis tools.")
      `(("python-cffi" ,python-cffi) ; used at run time
        ("python-six" ,python-six)))
     (arguments
-     `(#:phases
-       (alist-cons-after
-        'install 'install-doc
-        (lambda* (#:key outputs #:allow-other-keys)
-          (let ((doc (string-append (assoc-ref outputs "out") "/share"
-                                    "/doc/" ,name "-" ,version)))
-            (mkdir-p doc)
-            (copy-file "README.md"
-                       (string-append doc "/README.md"))))
-        %standard-phases)))
+     `(;; FIXME: Tests cannot load libxcb.so.1
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((doc (string-append (assoc-ref outputs "out") "/share"
+                                       "/doc/" ,name "-" ,version)))
+               (mkdir-p doc)
+               (copy-file "README.md"
+                          (string-append doc "/README.md"))
+               #t))))))
     (home-page "https://github.com/tych0/xcffib")
     (synopsis "XCB Python bindings")
     (description
@@ -4441,25 +4585,27 @@ support for Python 3 and PyPy.  It is based on cffi.")
     (propagated-inputs
      `(("python-xcffib" ,python-xcffib))) ; used at run time
     (arguments
-     `(#:phases
-       (alist-cons-after
-        'install 'install-doc
-        (lambda* (#:key inputs outputs #:allow-other-keys)
-          (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                 (doc (string-append data "/doc/" ,name "-" ,version))
-                 (html (string-append doc "/html")))
-            (setenv "LD_LIBRARY_PATH"
-                    (string-append (assoc-ref inputs "cairo") "/lib" ":"
-                                   (assoc-ref inputs "gdk-pixbuf") "/lib"))
-            (setenv "LANG" "en_US.UTF-8")
-            (mkdir-p html)
-            (for-each (lambda (file)
-                        (copy-file (string-append "." file)
-                                   (string-append doc file)))
-                      '("/README.rst" "/CHANGES" "/LICENSE"))
-            (system* "python" "setup.py" "build_sphinx")
-            (copy-recursively "docs/_build/html" html)))
-        %standard-phases)))
+     `(;; FIXME: Tests cannot find 'libcairo.so.2'.
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-doc
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                    (doc (string-append data "/doc/" ,name "-" ,version))
+                    (html (string-append doc "/html")))
+               (setenv "LD_LIBRARY_PATH"
+                       (string-append (assoc-ref inputs "cairo") "/lib" ":"
+                                      (assoc-ref inputs "gdk-pixbuf") "/lib"))
+               (setenv "LANG" "en_US.UTF-8")
+               (mkdir-p html)
+               (for-each (lambda (file)
+                           (copy-file (string-append "." file)
+                                      (string-append doc file)))
+                         '("/README.rst" "/CHANGES" "/LICENSE"))
+               (system* "python" "setup.py" "build_sphinx")
+               (copy-recursively "docs/_build/html" html)
+               #t))))))
     (home-page "https://github.com/SimonSapin/cairocffi")
     (synopsis "Python bindings and object-oriented API for Cairo")
     (description
@@ -4540,6 +4686,8 @@ Python language binding specification.")
        (sha256
         (base32 "1gzjg2k6f14i1msm2b0ax8d9ds1hvk6qd5nlaivg8m4cxqp4cp1x"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Requires python-cherrypy.
     (propagated-inputs
      `(("python-psutil" ,python-psutil)
        ("python-drmaa" ,python-drmaa)
@@ -4558,21 +4706,39 @@ cluster without needing to write any wrapper code yourself.")
 (define-public python-pexpect
   (package
     (name "python-pexpect")
-    (version "3.3")
+    (version "4.2.1")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://pypi.python.org/packages/source/p/"
-                           "pexpect/pexpect-" version ".tar.gz"))
+       (uri (pypi-uri "pexpect" version))
        (sha256
-        (base32 "1fp5gm976z7ghm8jw57463rj19cv06c8zw842prgyg788f6n3snz"))))
+        (base32 "14ls7k99pwvl21zqv65kzrhccv50j89m5ij1hf0slmsvlxjj84rx"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-before 'check 'prepare-tests
+           (lambda _
+             (substitute* (find-files "tests")
+               (("/bin/ls") (which "ls"))
+               (("/bin/echo") (which "echo"))
+               (("/bin/which") (which "which"))
+               ;; Many tests try to use the /bin directory which
+               ;; is not present in the build environment.
+               ;; Use one that's non-empty and unlikely to change.
+               (("/bin'") "/dev'"))
+             ;; XXX: Socket connection test gets "Connection reset by peer".
+             ;; Why does it not work? Delete for now.
+             (delete-file "tests/test_socket.py")
+             #t))
          (replace 'check (lambda _ (zero? (system* "nosetests")))))))
     (native-inputs
-     `(("python-nose" ,python-nose)))
+     `(("python-nose" ,python-nose)
+       ("python-pytest" ,python-pytest)
+       ("man-db" ,man-db)
+       ("which" ,which)))
+    (propagated-inputs
+     `(("python-ptyprocess" ,python-ptyprocess)))
     (home-page "http://pexpect.readthedocs.org/")
     (synopsis "Controlling interactive console applications")
     (description
@@ -5288,13 +5454,12 @@ implementation of D-Bus.")
       `(("sqlite" ,sqlite)))
     (arguments
      `(#:phases
-        ;; swap check and install phases
-        (alist-cons-after
-         'install 'check
-         (assoc-ref %standard-phases 'check)
-         (alist-delete
-          'check
-          %standard-phases))))
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (zero? (system* "python" "setup.py" "test")))))))
     (home-page "https://github.com/rogerbinns/apsw/")
     (synopsis "Another Python SQLite Wrapper")
     (description "APSW is a Python wrapper for the SQLite
@@ -5366,7 +5531,8 @@ screen-scraping projects.  It offers Pythonic idioms for navigating,
 searching, and modifying a parse tree, providing a toolkit for
 dissecting a document and extracting what you need.  It automatically
 converts incoming documents to Unicode and outgoing documents to UTF-8.")
-    (license license:expat)))
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-beautifulsoup4))))))
 
 (define-public python2-beautifulsoup4
   (package
@@ -5530,17 +5696,18 @@ of the structure, dynamics, and functions of complex networks.")
 (define-public snakemake
   (package
     (name "snakemake")
-    (version "3.2.1")
+    (version "3.9.0")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/s/snakemake/snakemake-"
-             version ".tar.gz"))
+       (uri (pypi-uri "snakemake" version))
        (sha256
-        (base32 "0fi4b63sj60hvi7rfydvmz2icl4wj74djw5sn2gl8hxd02qw4b91"))))
+        (base32 "1d48ql0010v9ls6mac7fz6j391gm4h74a64hqgw89s0vfqgdyzdl"))))
     (build-system python-build-system)
-    (home-page "https://bitbucket.org/johanneskoester/snakemake")
+    (arguments
+     ;; TODO: Package missing test dependencies.
+     '(#:tests? #f))
+    (home-page "https://bitbucket.org/snakemake/snakemake/wiki/Home")
     (synopsis "Python-based execution environment for make-like workflows")
     (description
       "Snakemake aims to reduce the complexity of creating workflows by
@@ -5559,6 +5726,8 @@ Python style, together with a fast and comfortable execution environment.")
        (sha256
         (base32 "0pawrqc3mxpwd5g9pvi9gba02637bh5c8ldpp8izfwpfn52469zs"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; Tests requires a running X11 server.
     (propagated-inputs
      `(("python-pandas" ,python-pandas)
        ("python-matplotlib" ,python-matplotlib)
@@ -5580,10 +5749,40 @@ and statistical routines from scipy and statsmodels.")
       (propagated-inputs `(("python2-pytz" ,python2-pytz)
                            ,@(package-propagated-inputs base))))))
 
+(define-public python-mpmath
+  (package
+  (name "python-mpmath")
+  (version "0.19")
+  (source (origin
+            (method url-fetch)
+            (uri (string-append "http://mpmath.org/files/mpmath-"
+                                version ".tar.gz"))
+            (sha256
+             (base32
+              "08ijsr4ifrqv3cjc26mkw0dbvyygsa99in376hr4b96ddm1gdpb8"))))
+  (build-system python-build-system)
+  (arguments
+   '(#:phases
+     (modify-phases %standard-phases
+       (replace 'check
+         (lambda _
+           (zero?
+            (system* "python" "mpmath/tests/runtests.py" "-local")))))))
+  (home-page "http://mpmath.org")
+  (synopsis "Arbitrary-precision floating-point arithmetic in python")
+  (description
+    "@code{mpmath} can be used as an arbitrary-precision substitute for
+Python's float/complex types and math/cmath modules, but also does much
+more advanced mathematics.")
+  (license license:bsd-3)))
+
+(define-public python2-mpmath
+  (package-with-python2 python-mpmath))
+
 (define-public python-sympy
   (package
     (name "python-sympy")
-    (version "0.7.6")
+    (version "1.0")
     (source
      (origin
        (method url-fetch)
@@ -5591,8 +5790,10 @@ and statistical routines from scipy and statsmodels.")
              "https://github.com/sympy/sympy/releases/download/sympy-"
              version "/sympy-" version ".tar.gz"))
        (sha256
-        (base32 "19yp0gy4i7p4g6l3b8vaqkj9qj7yqb5kqy0qgbdagpzgkdz958yz"))))
+        (base32 "1bpzjwr9hrr7w88v4vgnj9lr6vxcldc94si13n8xpr1rv08d5b1y"))))
     (build-system python-build-system)
+    (propagated-inputs
+     `(("python-mpmath" ,python-mpmath)))
     (home-page "http://www.sympy.org/")
     (synopsis "Python library for symbolic mathematics")
     (description
@@ -5710,6 +5911,17 @@ It is written entirely in Python.")
        (sha256
         (base32 "1gzgwayl6hmc9jfcl88bni4jcsk2jcca9dn1rvrfsvnijcjx7hn9"))))
     (build-system python-build-system)
+    (arguments
+     '(;; FIXME: Two tests error out with:
+       ;; AssertionError: b'Error in atexit._run_exitfuncs:\nFileNotF[44 chars]ry\n' != b''
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       ;; 'setup.py test' hits an AssertionError on BSD-specific
+       ;;       ;; "tornado/platform/kqueue.py". This is the supported method:
+       ;;       (zero? (system* "python" "-m" "tornado.test")))))
+       #:tests? #f))
     (native-inputs
      `(("python-certifi" ,python-certifi)))
     (propagated-inputs
@@ -5919,7 +6131,10 @@ complexity of Python source code.")
                ".tar.gz"))
         (sha256
           (base32
-            "12b9bbdbwnspxgak14xg58c130x2n0blxzlms5jn2dszn8qj3d0m"))))))
+           "12b9bbdbwnspxgak14xg58c130x2n0blxzlms5jn2dszn8qj3d0m"))))
+    (arguments
+     ;; XXX Tests not compatible with Python 3.5.
+     '(#:tests? #f))))
 
 (define-public python2-pep8-1.5.7
   (package-with-python2 python-pep8-1.5.7))
@@ -5938,7 +6153,10 @@ complexity of Python source code.")
                ".tar.gz"))
         (sha256
           (base32
-            "0sbpq6pqm1i9wqi41mlfrsc5rk92jv4mskvlyxmnhlbdnc80ma1z"))))))
+           "0sbpq6pqm1i9wqi41mlfrsc5rk92jv4mskvlyxmnhlbdnc80ma1z"))))
+    (arguments
+     ;; XXX Tests not compatible with Python 3.5.
+     '(#:tests? #f))))
 
 (define-public python2-pyflakes-0.8.1
   (package-with-python2 python-pyflakes-0.8.1))
@@ -6006,7 +6224,10 @@ complexity of Python source code.")
             (for-each delete-file-recursively
                       (find-files "." "__pycache__" #:directories? #t))
             (for-each delete-file (find-files "." "\\.pyc$"))
-            #t))))))
+            #t))))
+    (arguments
+     ;; XXX Fails with Python 3.5.
+     '(#:tests? #f))))
 
 (define-public python2-flake8-2.2.4
   (package-with-python2 python-flake8-2.2.4))
@@ -6295,6 +6516,9 @@ from an XML-based format.")
         (base32
          "0g6n288l83sfwavxh1aryi0aqvsr3sp7v6f903mckwqa4scpky62"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: Some tests need network access.
+     '(#:tests? #f))
     (synopsis "Tool and library for manipulating LilyPond files")
     (description "This package provides a Python library to parse, manipulate
 or create documents in LilyPond format.  A command line program ly is also
@@ -6463,6 +6687,8 @@ and MAC network addresses.")
        (base32
         "0c7gh3lsdjds262h0v1sqc66l7hqgfwbakn96qrhdbl0i3vm5yz8"))))
   (build-system python-build-system)
+  (native-inputs
+   `(("python-pytest" ,python-pytest)))
   (home-page "https://bitbucket.org/micktwomey/pyiso8601")
   (synopsis "Module to parse ISO 8601 dates")
   (description
@@ -6875,13 +7101,25 @@ message digests and key derivation functions.")
        (uri (pypi-uri "pyOpenSSL" version))
        (sha256
         (base32
-         "0vji4yrfshs15xpczbhzhasnjrwcarsqg87n98ixnyafnyxs6ybp"))))
+         "0vji4yrfshs15xpczbhzhasnjrwcarsqg87n98ixnyafnyxs6ybp"))
+       (patches
+        (search-patches "python-pyopenssl-skip-network-test.patch"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (zero? (system* "py.test" "-v")))))))
     (propagated-inputs
      `(("python-cryptography" ,python-cryptography)
        ("python-six" ,python-six)))
     (inputs
      `(("openssl" ,openssl)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (home-page "https://github.com/pyca/pyopenssl")
     (synopsis "Python wrapper module around the OpenSSL library")
     (description
@@ -7196,9 +7434,19 @@ functions to find and load entry points.")
         (base32
          "0brclbb18l4nmd5qy3dl9wn05rjdh1fz4rmzdlfqacj12rcdvdgp"))))
     (build-system python-build-system)
-    ;; The "bdist_egg" target is disabled by default, causing the installation
-    ;; to fail.
-    (arguments `(#:configure-flags (list "bdist_egg")))
+    (arguments
+     `(;; The "bdist_egg" target is disabled by default, causing the installation
+       ;; to fail.
+       #:configure-flags (list "bdist_egg")
+       ;; FIXME: 5 failures, 40 errors.
+       #:tests? #f))
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       (zero? (system* "py.test" "-v")))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (propagated-inputs
      `(("python-bleach" ,python-bleach)
        ("python-entrypoints" ,python-entrypoints)
@@ -7299,7 +7547,8 @@ interactive computing.")
     (propagated-inputs
      `(("python-notebook" ,python-notebook)))
     (native-inputs
-     `(("python-nose" ,python-nose)))
+     `(("python-certifi" ,python-certifi)
+       ("python-nose" ,python-nose)))
     (home-page "http://ipython.org")
     (synopsis "IPython HTML widgets for Jupyter")
     (description "This package provides interactive HTML widgets for Jupyter
@@ -7580,6 +7829,8 @@ forms, HTTP servers, regular expressions, and more.")
         (base32
          "1r7iqknhh55y45f64mz5hghgvzx34h1i11k350s0avx6q8gznja1"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Tests can't find zope.interface.
     (native-inputs
      `(("python-six" ,python-six)
        ;("python-zope-interface" ,python-zope-interface)
@@ -7640,8 +7891,11 @@ internationalized messages within program source text.")
         (base32
          "1p943jdxb587dh7php4vx04qvn7b2877hr4qs5zyckvp5afhhank"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Tests can't find zope.event.
     (propagated-inputs
      `(("python-zope-event" ,python-zope-event)
+       ("python-zope-exceptions", python-zope-exceptions)
        ("python-zope-interface" ,python-zope-interface)))
     (native-inputs
      `(("python-zope-testing" ,python-zope-testing)
@@ -7669,6 +7923,8 @@ defining data schemas.")
                (base32
                 "1x9dfqypgympnlm25p9m43xh4qv3p7d75vksv9pzqibrb4cggw5n"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Tests can't find zope.interface.
     (propagated-inputs
      `(("python-zope-i18nmessageid" ,python-zope-i18nmessageid)
        ("python-zope-schema" ,python-zope-schema)))
@@ -7694,6 +7950,8 @@ Markup Language.")
         (base32
          "0pqwwmvm1prhwv1ziv9lp8iirz7xkwb6n2kyj36p2h0ppyyhjnm4"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Tests can't find zope.interface.
     (propagated-inputs
      `(("python-zope-interface" ,python-zope-interface)))
     (home-page "http://pypi.python.org/pypi/zope.proxy")
@@ -7721,6 +7979,8 @@ brokering, etc.) for which the proxy is responsible.")
         (base32
          "1nj9da4ksiyv3h8n2vpzwd0pb03mdsh7zy87hfpx72b6p2zcwg74"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Tests can't find zope.interface.
     (propagated-inputs
      `(("python-zope-proxy" ,python-zope-proxy)
        ("python-zope-schema" ,python-zope-schema)))
@@ -7746,12 +8006,15 @@ Zope3, which are are special objects that have a structural location.")
         (base32
          "14zmf684amc0x32kq05yxnhfqd1cmyhafkw05gn81rn90zjv6ssy"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Tests can't find zope.testrunner.
     (propagated-inputs
      `(("python-zope-i18nmessageid" ,python-zope-i18nmessageid)
        ("python-zope-proxy" ,python-zope-proxy)
        ("python-zope-schema" ,python-zope-schema)))
-     (native-inputs
-     `(("python-zope-component" ,python-zope-component)
+    (native-inputs
+     `(("python-six" ,python-six)
+       ("python-zope-component" ,python-zope-component)
        ("python-zope-configuration" ,python-zope-configuration)
        ("python-zope-location" ,python-zope-location)
        ("python-zope-testrunner" ,python-zope-testrunner)
@@ -8355,7 +8618,7 @@ processes across test runs.")
                "17rcy6rb9kqjf4p707ivmx7phjq7ngcz3bf7zriwxrqgrjagj7ag"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-dateutil-2" ,python-dateutil-2)
+     `(("python-dateutil" ,python-dateutil)
        ("python-pytz" ,python-pytz)))
     (synopsis "Python library for parsing iCalendar files")
     (description "The icalendar package is a parser/generator of iCalendar
@@ -8413,6 +8676,14 @@ Blog, News or Announcements section to a Sphinx website.")
                (base32
                 "1an5lkkqk1zha47198p42ji3m94xmzx1a03dn7866m87n4r4q8h5"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "py.test" "-v")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (propagated-inputs
      `(("python-args" ,python-args)))
     (home-page "https://github.com/kennethreitz/clint")
@@ -8482,6 +8753,17 @@ with a new public API, and RPython support.")
                (base32
                 "1msqv747iz12r73mz4qvsmlwkddwjvrahlrk7ysrcz07h7dsscxs"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; Tests require write access to HOME.
+             (setenv "HOME" "/tmp")
+             (zero? (system* "nosetests")))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-nose" ,python-nose)))
     (propagated-inputs
      `(("python-astor" ,python-astor)
        ("python-clint" ,python-clint)
@@ -8756,6 +9038,8 @@ servers.")
       (base32
        "0g9xvl69y7nr3w7ag4fsp6sm4fqf6vrqjw7504x2hzrrsh3ampq8"))))
    (build-system python-build-system)
+   (native-inputs
+    `(("python-nose" ,python-nose)))
    (synopsis "JSON Matching Expressions")
    (description "JMESPath (pronounced “james path”) is a Python library that
 allows one to declaratively specify how to extract elements from a JSON
@@ -8778,8 +9062,11 @@ document.")
       (base32
        "1zxczlwqy9bl27d9bc5x99mb5mcsxm350240lp5nx7014xb311lj"))))
    (build-system python-build-system)
+   (arguments
+    ;; FIXME: Many tests are failing.
+    '(#:tests? #f))
    (propagated-inputs
-    `(("python-dateutil" ,python-dateutil-2)
+    `(("python-dateutil" ,python-dateutil)
       ("python-docutils" ,python-docutils)
       ("python-jmespath" ,python-jmespath)))
    (native-inputs
@@ -8838,7 +9125,7 @@ Amazon Web Services (AWS) API.")
                (base32
                 "0qyqq9akm4vshhn8cngjc1qykcvsn7cz6dlm6njfsgpbraqrmbbw"))))
     (build-system python-build-system)
-    (propagated-inputs
+    (native-inputs
      `(("python-flake8" ,python-flake8)
        ("python-pytest" ,python-pytest)))
     (synopsis "Library for property based testing")
@@ -8855,7 +9142,8 @@ seamlessly into your existing Python unit testing work flow.")
                      (strip-python2-variant python-hypothesis))))
     (package (inherit hypothesis)
       (native-inputs
-       `(("python2-enum34" ,python2-enum34))))))
+       `(("python2-enum34" ,python2-enum34)
+         ,@(package-native-inputs hypothesis))))))
 
 (define-public python-pytest-subtesthack
   (package
@@ -9321,6 +9609,10 @@ RabbitMQ messaging server is the most popular implementation.")
                 (strip-python2-variant python-kombu))))
     (package
       (inherit kombu)
+      (arguments `(;; FIXME: 'TestTransport.test_del_sync' fails on python2.
+                   ;; It works fine on the python3 variant.
+                   #:tests? #f
+                   ,@(package-arguments kombu)))
       (native-inputs `(("python2-unittest2" ,python2-unittest2)
                 ,@(package-native-inputs kombu))))))
 
@@ -9544,7 +9836,7 @@ introspection of @code{zope.interface} instances in code.")
      '(;; The test suite relies on some non-portable Windows interfaces.
        #:tests? #f))
     (propagated-inputs
-     `(("python-dateutil-2" ,python-dateutil-2)
+     `(("python-dateutil" ,python-dateutil)
        ("python-pyicu" ,python-pyicu)))
     (synopsis "Parse and generate vCard and vCalendar files")
     (description "Vobject is intended to be a full featured Python package for
@@ -10230,6 +10522,8 @@ to occurences in strings and comments.")
         (base32
          "0i283z1pivmir61z8kbiycigc94l61v33ygzkhczf1ifq7cppyds"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; TODO: Requires many libraries not in Guix.
     (home-page "https://github.com/ultrabug/py3status")
     (synopsis "Extensible i3status wrapper written in Python")
     (description "py3status is an i3status wrapper which extends i3status
@@ -10373,6 +10667,72 @@ to provide a high-level synchronous API on top of the libev event loop.")
 (define-public python2-gevent
   (package-with-python2 python-gevent))
 
+(define-public python-geventhttpclient
+  (package
+    (name "python-geventhttpclient")
+    (version "1.3.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "geventhttpclient" version))
+              (sha256
+               (base32
+                "07d0q3wzmml75227r6y6mrl5a0zpf4v9gj0ni5rhbyzmaj4az1xx"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Delete pre-compiled files.
+                  (for-each delete-file (find-files "src/geventhttpclient"
+                                                    ".*\\.pyc"))
+                  #t))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'delete-network-tests
+           (lambda _
+             (delete-file "src/geventhttpclient/tests/test_client.py")
+             #t))
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (zero? (system* "py.test" "src/geventhttpclient/tests" "-v")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-certifi" ,python-certifi)
+       ("python-gevent" ,python-gevent)
+       ("python-six" ,python-six)))
+    (home-page "https://github.com/gwik/geventhttpclient")
+    (synopsis "HTTP client library for gevent")
+    (description "@code{python-geventhttpclient} is a high performance,
+concurrent HTTP client library for python using @code{gevent}.")
+    (license license:expat)))
+
+(define-public python2-geventhttpclient
+  (package-with-python2 python-geventhttpclient))
+
+(define-public python-fastimport
+  (package
+    (name "python-fastimport")
+    (version "0.9.6")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "fastimport" version))
+        (sha256
+          (base32 "1aqjsin4rmqm7ln4j0p73fzxifws6c6ikgyhav7r137m2ixsxl43"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/jelmer/python-fastimport")
+    (synopsis "VCS fastimport parser and generator in Python")
+    (description "This package provides a parser for and generator of the Git
+@url{https://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html,fastimport}
+format.")
+    (license license:gpl2+)))
+
+(define-public python2-fastimport
+  (package-with-python2 python-fastimport))
+
 (define-public python-twisted
   (package
     (name "python-twisted")
@@ -10384,6 +10744,13 @@ to provide a high-level synchronous API on top of the libev event loop.")
                (base32
                 "0ydxrp9myw1mvsz3qfzx5579y5llmqa82pxvqchgp5syczffi450"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: Some tests are failing.
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       (zero? (system* "./bin/trial" "twisted")))))
     (propagated-inputs
      `(("python-zope-interface" ,python-zope-interface)))
     (home-page "https://twistedmatrix.com/")
@@ -10622,7 +10989,7 @@ objects, patterned after the Mocha library for Ruby.")
        ("python-chai" ,python-chai)
        ("python-simplejson" ,python-simplejson)))
     (propagated-inputs
-     `(("python-dateutil" ,python-dateutil-2)))
+     `(("python-dateutil" ,python-dateutil)))
     (home-page "https://github.com/crsmithdev/arrow/")
     (synopsis "Dates and times for Python")
     (description
@@ -10645,6 +11012,8 @@ datetime type.")
               (base32
                "1jhnxgnw8y3mbzjssixh6qkc7a3afc4fygajhqrqalnilyvpzshq"))))
     (build-system python-build-system)
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (home-page "http://github.com/jpvanhal/inflection")
     (synopsis "Python string transformation library")
     (description
@@ -10813,13 +11182,19 @@ parsing UK postcodes.")
              (base32
               "0vs0dkmg0dlaxf8w6q2i3k0i03gmp56ablldv7ci9x3nbadkn71g"))))
   (build-system python-build-system)
+  (arguments
+   '(#:phases
+     (modify-phases %standard-phases
+       (replace 'check
+         (lambda _
+           (zero? (system* "python" "-m" "unittest" "-v" "faker.tests")))))))
   (native-inputs
    `(;; For testing
      ("python-email-validator" ,python-email-validator)
      ("python-mock" ,python-mock)
      ("python-ukpostcodeparser" ,python-ukpostcodeparser)))
   (propagated-inputs
-   `(("python-dateutil" ,python-dateutil-2)
+   `(("python-dateutil" ,python-dateutil)
      ("python-six" ,python-six)))
   (home-page "https://github.com/joke2k/faker")
   (synopsis "Python package that generates fake data")
@@ -10849,6 +11224,8 @@ addresses, and phone numbers.")
                (base32
                 "1f5m28vkh4ksq3d80d8mmd2z8wxvc3mgy2pmrv2751dm2xgznm4w"))))
     (build-system python-build-system)
+    (native-inputs
+     `(("python-unidecode" ,python-unidecode)))
     (propagated-inputs
      `(("python-pyyaml" ,python-pyyaml)))
     (home-page "https://github.com/mk-fg/pretty-yaml")
@@ -10963,6 +11340,11 @@ characters, mouse support, and auto suggestions.")
           (base32
             "0c8x962ynpx001fdvp07m2q5jk4igkxbj3rmnydavphvlgxijk1v"))))
     (build-system python-build-system)
+    (arguments
+     ;; FIXME: One test fails (use "py.test" instead of 'setup.py test').
+     '(#:tests? #f))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
     (home-page "https://github.com/davidhalter/jedi")
     (synopsis
       "Autocompletion for Python that can be used for text editors")
@@ -10984,6 +11366,8 @@ characters, mouse support, and auto suggestions.")
                (base32
                 "1mmbiyzf0n8hm7z2a562x7w5cbl6jc0zsk6vp40q1z4cyblv1k13"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: No tests in pypi tarball.
     (propagated-inputs
      `(("python-docopt" ,python-docopt)
        ("python-jedi" ,python-jedi)
@@ -11089,6 +11473,13 @@ relays publish about themselves.")
           (base32
             "0k1nfdrxxkdlv4zgaqsdv8li0pj3gbh2pyxw8q2bsg6f9490amyn"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: 3/49 tests are failing.
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       (zero? (system* "python" "test/run_all_tests.py" "loop://")))))))
     (home-page
       "https://github.com/pyserial/pyserial")
     (synopsis "Python Serial Port Bindings")
@@ -11408,7 +11799,7 @@ List.  Forked from and using the same API as the publicsuffix package.")
        ("python-coverage" ,python-coverage)))
     (propagated-inputs
      `(("python-six" ,python-six)
-       ("python-dateutil-2" ,python-dateutil-2)))
+       ("python-dateutil" ,python-dateutil)))
     (arguments
      `(#:phases (modify-phases %standard-phases
         ;; The tests are normally executed via `make test`, but the PyPi
@@ -12059,7 +12450,7 @@ useful as a validator for JSON data.")
             "1k5mjg9iqbjfslb5prrsfz7dhlvi6s35p1jxq8dm87w1b7dn5i2g"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("python-dateutil-2" ,python-dateutil-2)))
+     `(("python-dateutil" ,python-dateutil)))
     (home-page
       "https://bitbucket.org/nielsenb/aniso8601")
     (synopsis
@@ -12256,10 +12647,7 @@ python-axolotl.")
            (lambda _
              (for-each delete-file-recursively
                        '("axolotl/tests" "build/lib/axolotl/tests"))
-             #t)))
-       ;; Prevent creation of the egg. This works around
-       ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765
-       #:configure-flags '("--root=/")))
+             #t)))))
     (propagated-inputs
      `(("python-axolotl-curve25519" ,python-axolotl-curve25519)
        ("python-dateutil" ,python-dateutil)
@@ -12287,6 +12675,12 @@ asynchronous messaging environments.")
           (base32
             "17wzkkcqy5zc0g68xlad3kcv66iw14d2pwqc0h9420gak0vbhx7g"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "test3.py")))))))
     (home-page "http://github.com/gfxmonk/termstyle")
     (synopsis "Console text coloring for Python")
     (description "This package provides console text coloring for Python.")
@@ -12337,6 +12731,13 @@ asynchronous messaging environments.")
           (base32
             "11his6ii5brpkhld0d5bwzjjw4q3vmplpd6fmgzjrvvklsbk0cf4"))))
     (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; FIXME: 35/882 tests failing.
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       (zero? (system* "nosetests")))))))
     (propagated-inputs
       `(("python-aniso8601" ,python-aniso8601)
         ("python-flask" ,python-flask)
@@ -12417,6 +12818,9 @@ specs from your Flask-Restful projects.")
           (base32
             "11bwiw6j0nilgz81xnw6f1npyga3prp8asjqrm87cdr3ria5l03x"))))
     (build-system python-build-system)
+    (native-inputs
+     `(("python-pexpect" ,python-pexpect)
+       ("tcsh" ,tcsh)))
     (home-page "https://github.com/kislyuk/argcomplete")
     (synopsis "Shell tab completion for Python argparse")
     (description "argcomplete provides extensible command line tab completion
@@ -12498,6 +12902,52 @@ Features:
 @end enumerate")
     (license (license:x11-style "file://LICENSE"))))
 
+(define-public python-dulwich
+  (package
+    (name "python-dulwich")
+    (version "0.16.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (list (string-append "https://www.dulwich.io/releases/"
+                            "dulwich-" version ".tar.gz")
+                   (pypi-uri "dulwich" version)))
+        (sha256
+          (base32 "0fl47vzfgc3w3rmhn8naii905cjqcp0vc68iyvymxp7567hh6als"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'fix-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; The tests use Popen with a custom environment which doesn't
+             ;; include PATH.
+             (substitute* "dulwich/tests/compat/utils.py"
+               (("'git'") (string-append "'"
+                                         (which "git")
+                                         "'")))
+             (substitute* '("dulwich/tests/test_repository.py"
+                            "dulwich/tests/test_hooks.py")
+               (("#!/bin/sh") (string-append "#!" (which "sh"))))
+             (setenv "TEST_RUNNER" "unittest")
+             (setenv "PYTHONHASHSEED" "random")
+             #t)))))
+    (propagated-inputs
+     `(("python-fastimport" ,python-fastimport)))
+    (native-inputs
+     `(("python-mock" ,python-mock)
+       ("python-geventhttpclient" ,python-geventhttpclient)
+       ("git" ,git)))
+    (home-page "https://www.dulwich.io/")
+    (synopsis "Git implementation in Python")
+    (description "Dulwich is an implementation of the Git file formats and
+protocols written in pure Python.")
+    ;; Can be used with either license.
+    (license (list license:asl2.0 license:gpl2+))))
+
+(define-public python2-dulwich
+  (package-with-python2 python-dulwich))
+
 (define-public python-pbkdf2
   (package
     (name "python-pbkdf2")
diff --git a/gnu/packages/rdf.scm b/gnu/packages/rdf.scm
index 1dd23c28e3..97e6b881cc 100644
--- a/gnu/packages/rdf.scm
+++ b/gnu/packages/rdf.scm
@@ -315,6 +315,18 @@ ideal (e.g. in LV2 implementations or embedded applications).")
           (base32
             "0kvaf332cqbi47rqzlpdx4mbkvw12mkrzkj8n9l19wk713d4py9w"))))
     (build-system python-build-system)
+    (arguments
+     '(;; FIXME: Three test failures. Try uncommenting the below next update.
+       #:tests? #f))
+       ;; #:phases
+       ;; (modify-phases %standard-phases
+       ;;   (replace 'check
+       ;;     (lambda _
+       ;;       ;; Run tests from the build directory so python3 only
+       ;;       ;; sees the installed 2to3 version.
+       ;;       (zero? (system* "nosetests" "--where=./build/src")))))
+    (native-inputs
+     `(("python-nose" ,python-nose)))
     (propagated-inputs
       `(("python-html5lib" ,python-html5lib)
         ("python-isodate" ,python-isodate)
@@ -329,12 +341,4 @@ powerful language for representing information.")
                         "See LICENSE in the distribution."))))
 
 (define-public python2-rdflib
-  (let ((base (package-with-python2 python-rdflib)))
-    (package
-      (inherit base)
-      (inputs
-        (append (package-inputs base)
-                `(("python2-nose" ,python2-nose))))
-      (arguments
-        `(#:python ,python-2
-          #:tests? #f))))) ; 3 tests fail, also outside Guix
+  (package-with-python2 python-rdflib))
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index e90ee6847f..d0d99932c4 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -166,6 +166,9 @@ insert mode and command mode where keybindings have different functions.")
                   (string-append "'" ncurses "/bin/tput'"))))
              #t)))))
     (inputs `(("ncurses" ,ncurses)))
+    (native-inputs
+     ;; For tests.
+     `(("python-requests" ,python-requests)))
     (home-page "https://asciinema.org")
     (synopsis "Terminal session recorder")
     (description
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 5c371b0ba0..e49d6137b5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1210,7 +1210,7 @@ Mercurial, Bazaar, Darcs, CVS, Fossil, and Veracity.")
      `(;; for the tests
        ("python2-six" ,python2-six)))
     (propagated-inputs
-     `(("python2-dateutil" ,python2-dateutil-2)
+     `(("python2-dateutil" ,python2-dateutil)
        ("python2-futures" ,python2-futures)
        ("python2-rauth" ,python2-rauth)
        ("python2-swiftclient" ,python2-swiftclient)))
diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 8c7f07a263..efb46f73d4 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -248,6 +248,14 @@ DNS domain name queries.")
         (base32
          "0a92lk8790dpp9j64vb6p4sazax0x3nby01lnfll7mxs1hx6n27q"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-paths
+           (lambda _
+             (substitute* "sshoot/tests/test_manager.py"
+               (("/bin/sh") (which "sh")))
+             #t)))))
     (inputs
      `(("python-argcomplete" ,python-argcomplete)
        ("python-prettytable" ,python-prettytable)