gnu: Separate Python core packages from the rest.
[jackhill/guix/guix.git] / gnu / packages / check.scm
index ddd5325..f0e8524 100644 (file)
@@ -7,7 +7,7 @@
 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2015, 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
@@ -26,7 +26,7 @@
 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
   #:use-module (gnu packages compression)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages golang)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages time)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
@@ -209,12 +211,14 @@ multi-paradigm automated test framework for C++ and Objective-C.")
     (version "1.12.2")
     (home-page "https://github.com/catchorg/Catch2")
     (source (origin
-              (method url-fetch)
-              (uri (string-append home-page "/archive/v" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/catchorg/Catch2")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "0g2ysxc6adqca5wh7nsicnxb9wkxg75cd5izjsl39rcj0v903gr7"))
-              (file-name (string-append name "-" version ".tar.gz"))))
+                "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
     (build-system cmake-build-system)
     (synopsis "Automated test framework for C++ and Objective-C")
     (description "Catch2 stands for C++ Automated Test Cases in Headers and is
@@ -250,7 +254,7 @@ a multi-paradigm automated test framework for C++ and Objective-C.")
              ;; the build environment. Hence assuming-failure test fails.
              (delete-file "yarn.tests/assuming-failure.script")
              (delete-file "yarn.tests/assuming-failure.stdout")
-             (zero? (system* "python" "setup.py" "check")))))))
+             (invoke "python" "setup.py" "check"))))))
     (native-inputs
      `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
     (propagated-inputs
@@ -269,7 +273,7 @@ problem, and shows the differences.")
 (define-public cmocka
   (package
     (name "cmocka")
-    (version "1.1.1")
+    (version "1.1.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://cmocka.org/files/"
@@ -277,10 +281,10 @@ problem, and shows the differences.")
                                   version ".tar.xz"))
               (sha256
                (base32
-                "1283zi9qf5613g8iadm1fxmjh4rzxqd5np2j3lcpgairf25g8bph"))))
+                "1p9b6ccv939wjsgapn7wx24xw278awsw9h81lm0g4zw257hx276i"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:tests? #f)) ; No test target
+     `(#:tests? #f))                    ; no test target
     (home-page "https://cmocka.org/")
     (synopsis "Unit testing framework for C")
     (description "Cmocka is a unit testing framework for C with support for
@@ -293,15 +297,18 @@ format.")
 (define-public cppcheck
   (package
     (name "cppcheck")
-    (version "1.84")
+    (version "1.86")
     (source (origin
-      (method url-fetch)
-      (uri (string-append "https://github.com/danmar/cppcheck/archive/"
-                          version ".tar.gz"))
+      (method git-fetch)
+      (uri (git-reference
+             (url "https://github.com/danmar/cppcheck")
+             (commit version)))
+      (file-name (git-file-name name version))
       (sha256
-       (base32 "1ibz07dgs1dpfb8bmjh3qsma37wl5p6s6b4qlv5ccpshj4yjk9ma"))
-      (file-name (string-append name "-" version ".tar.gz"))))
+       (base32 "0jr4aah72c7wy94a8vlj3k050rx6pmc7m9nvmll1jwbscxj5f7ff"))))
     (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags '("-DBUILD_TESTS=ON")))
     (home-page "http://cppcheck.sourceforge.net")
     (synopsis "Static C/C++ code analyzer")
     (description "Cppcheck is a static code analyzer for C and C++.  Unlike
@@ -619,14 +626,14 @@ standard library.")
 (define-public python-pytest
   (package
     (name "python-pytest")
-    (version "3.7.2")
+    (version "3.8.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pytest" version))
        (sha256
         (base32
-         "00jv750alrj62r586hcmvpqlmkqszqfm1x7n6qnqacjmmlis2n9l"))))
+         "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -698,14 +705,14 @@ and many external plugins.")
 (define-public python-pytest-cov
   (package
     (name "python-pytest-cov")
-    (version "2.5.1")
+    (version "2.6.0")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "pytest-cov" version))
         (sha256
          (base32
-          "0bbfpwdh9k3636bxc88vz9fa7vf4akchgn513ql1vd0xy4n7bah3"))))
+          "0qnpp9y3ygx4jk4pf5ad71fh2skbvnr6gl54m7rg5qysnx4g0q73"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -715,8 +722,8 @@ and many external plugins.")
             ;; options taken from tox.ini
             ;; TODO: make "--restructuredtext" tests pass. They currently fail
             ;; with "Duplicate implicit target name"
-            (zero? (system* "python" "./setup.py" "check"
-                            "--strict" "--metadata")))))))
+            (invoke "python" "./setup.py" "check"
+                    "--strict" "--metadata"))))))
     (propagated-inputs
      `(("python-coverage" ,python-coverage)
        ("python-pytest" ,python-pytest)))
@@ -794,14 +801,14 @@ same arguments.")
 (define-public python-pytest-xdist
   (package
     (name "python-pytest-xdist")
-    (version "1.14")
+    (version "1.25.0")
     (source
      (origin
        (method url-fetch)
-       (uri (pypi-uri "pytest-xdist" version ".zip"))
+       (uri (pypi-uri "pytest-xdist" version))
        (sha256
         (base32
-         "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
+         "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -821,8 +828,7 @@ same arguments.")
        ;;       (add-installed-pythonpath inputs outputs)
        ;;       (zero? (system* "py.test" "-v")))))
     (native-inputs
-     `(("unzip" ,unzip)
-       ("python-setuptools-scm" ,python-setuptools-scm)))
+     `(("python-setuptools-scm" ,python-setuptools-scm)))
     (propagated-inputs
      `(("python-execnet" ,python-execnet)
        ("python-pytest" ,python-pytest)
@@ -850,9 +856,7 @@ result back.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
-             version ".tar.gz"))
+       (uri (pypi-uri "scripttest" version))
        (sha256
         (base32
          "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
@@ -879,7 +883,8 @@ subprocess and see the output as well as any file modifications.")
        (uri (pypi-uri "testtools" version))
        (sha256
         (base32
-         "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))))
+         "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
+       (patches (search-patches "python-testtools.patch"))))
     (build-system python-build-system)
     (arguments '(#:tests? #f))
     (propagated-inputs
@@ -1019,14 +1024,14 @@ use of resources by test cases.")))
 (define-public python-subunit-bootstrap
   (package
     (name "python-subunit-bootstrap")
-    (version "1.2.0")
+    (version "1.3.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-subunit" version))
        (sha256
         (base32
-         "1yii2gx3z6323as3iraj1yphj76dy7i3h6kj63pnc5y0hwjs5sgx"))))
+         "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-extras" ,python-extras)
@@ -1035,7 +1040,7 @@ use of resources by test cases.")))
      `(("python-fixtures" ,python-fixtures-bootstrap)
        ("python-hypothesis" ,python-hypothesis)
        ("python-testscenarios" ,python-testscenarios-bootstrap)))
-    (home-page "http://launchpad.net/subunit")
+    (home-page "https://launchpad.net/subunit")
     (synopsis "Python implementation of the subunit protocol")
     (description
      "This package is here for bootstrapping purposes only.  Use the regular
@@ -1099,8 +1104,8 @@ python-fixtures package instead.")
        (modify-phases %standard-phases
          (replace 'check
            (lambda _
-             (zero? (system* "python" "-m" "testtools.run"
-                             "fixtures.test_suite")))))))
+             (invoke "python" "-m" "testtools.run"
+                     "fixtures.test_suite"))))))
     (propagated-inputs
      ;; Fixtures uses pbr at runtime to check versions, etc.
      `(("python-pbr" ,python-pbr)
@@ -1247,13 +1252,14 @@ C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
     (version "0.2")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/jupyter/testpath/archive/"
-                           version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/jupyter/testpath")
+              (commit version)))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
+         "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f ; this package does not even have a setup.py
@@ -1340,20 +1346,20 @@ the last py.test invocation.")
 (define-public python-pytest-localserver
   (package
     (name "python-pytest-localserver")
-    (version "0.4.1")
+    (version "0.5.0")
     (source (origin
-             (method url-fetch)
-             (uri (pypi-uri "pytest-localserver" version))
-             (sha256
-              (base32
-               "08f06rvj31wqf0vgmd1waya87r7vy6x8ck48lxl3dxy83q5gcam7"))))
+              (method url-fetch)
+              (uri (pypi-uri "pytest-localserver" version))
+              (sha256
+               (base32
+                "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
     (build-system python-build-system)
     (arguments
-      `(#:phases (modify-phases %standard-phases
+     '(#:phases
+       (modify-phases %standard-phases
          (replace 'check
            (lambda _
-             (zero? (system* "py.test" "--genscript=runtests.py"))
-             (zero? (system* "py.test")))))))
+             (invoke "py.test" "-v"))))))
     (native-inputs
      `(("python-pytest" ,python-pytest)
        ("python-requests" ,python-requests)
@@ -1412,19 +1418,44 @@ normally the case.")
 (define-public python2-pytest-subtesthack
   (package-with-python2 python-pytest-subtesthack))
 
+(define-public python-pytest-sugar
+  (package
+    (name "python-pytest-sugar")
+    (version "0.9.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-sugar" version))
+       (sha256
+        (base32
+         "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-packaging" ,python-packaging)
+       ("python-pytest" ,python-pytest)
+       ("python-termcolor" ,python-termcolor)))
+    (home-page "https://pivotfinland.com/pytest-sugar/")
+    (synopsis "Plugin for pytest that changes the default look and feel")
+    (description
+     "@code{pytest-sugar} is a plugin for py.test that changes the default
+look and feel of py.test, using a progress bar and showing failures and errors
+instantly.")
+    (license license:bsd-3)))
+
 (define-public python-hypothesis
   (package
     (name "python-hypothesis")
-    (version "3.68.2")
+    (version "3.70.3")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "hypothesis" version))
               (sha256
                (base32
-                "15wlbdy148h3z0ckylf7zkszrfnnk254a6ld3qaf37lkf7hyp4r0"))))
+                "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
     (build-system python-build-system)
     (native-inputs
-     `(("python-flake8" ,python-flake8)
+     `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
+       ("python-flake8" ,python-flake8-3.5)
        ("python-pytest" ,python-pytest-bootstrap)))
     (propagated-inputs
      `(("python-attrs" ,python-attrs-bootstrap)
@@ -1521,7 +1552,7 @@ failures.")
              ;; It's easier to run tests after install.
              ;; Make installed package available for running the tests
              (add-installed-pythonpath inputs outputs)
-             (zero? (system* "py.test" "-vv")))))))
+             (invoke "py.test" "-vv"))))))
     (native-inputs
      `(("python-coverage" ,python-coverage)
        ("python-pytest" ,python-pytest)
@@ -1558,7 +1589,7 @@ failures.")
        (modify-phases %standard-phases
          (replace 'check
            (lambda _
-             (zero? (system* "./testrun")))))))
+             (invoke "./testrun"))))))
     (propagated-inputs
      `(("python2-coverage" ,python2-coverage)))
     (home-page "https://liw.fi/coverage-test-runner/")
@@ -1604,9 +1635,9 @@ statements in the module it tests.")
                               (string-append (getenv "PYTHONPATH") ":" work))
                       (copy-recursively "." work)
                       (with-directory-excursion "/tmp"
-                        (zero? (system* "python" "-m" "unittest" "discover"
-                                        "-s" (string-append work "/pylint/test")
-                                        "-p" "*test_*.py")))))))))
+                        (invoke "python" "-m" "unittest" "discover"
+                                "-s" (string-append work "/pylint/test")
+                                "-p" "*test_*.py"))))))))
     (home-page "https://github.com/PyCQA/pylint")
     (synopsis "Python source code analyzer which looks for coding standard
 errors")
@@ -1839,7 +1870,8 @@ tests written in a natural language style, backed up by Python code.")
            (lambda _
              (substitute* "setup.py"
                (("'wheel'") "")                ; We don't use it.
-               (("'ordereddict==1.1'") ""))))))) ; Python >= 2.7 has it built-in.
+               (("'ordereddict==1.1'") ""))    ; Python >= 2.7 has it built-in.
+             #t)))))
     (propagated-inputs
      `(("behave" ,behave)
        ("python-requests" ,python-requests)))
@@ -1920,14 +1952,14 @@ create data based on random numbers and yet remain repeatable.")
 (define-public python-nose-timer
   (package
     (name "python-nose-timer")
-    (version "0.7.2")
+    (version "0.7.3")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "nose-timer" version))
         (sha256
           (base32
-            "0ywg223p528014z5s0vzck74r4xyw3kvcp2casfnc85dkvir1zj7"))))
+            "0hfz5aqnhf493i9kyb6prm4zm8vx7wmfsyg3nvsnh24lzh2kwx44"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-nose" ,python-nose)
@@ -2032,17 +2064,15 @@ retried.")
     (name "python-pyhamcrest")
     (version "1.9.0")
     (source (origin
-              (method url-fetch)
-              (uri
-               (string-append
-                "https://github.com/hamcrest/PyHamcrest/archive/V"
-                version
-                ".tar.gz"))
-              (file-name
-               (string-append name "-" version ".tar.gz"))
+              ;; Tests not distributed from pypi release.
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/hamcrest/PyHamcrest")
+                     (commit (string-append "V" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1lqjajhwf7x7igvvnj5p1cm31y9njy07qby94w18kl6zwbdjqrwy"))))
+                "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
     (native-inputs                      ; All native inputs are for tests
      `(("python-pytest-cov" ,python-pytest-cov)
        ("python-mock" ,python-mock)
@@ -2066,13 +2096,13 @@ retried.")
     (name "unittest-cpp")
     (version "2.0.0")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/unittest-cpp/unittest-cpp/archive/v"
-                    version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/unittest-cpp/unittest-cpp")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
-               (base32 "1fgmna2la7z4pwwy2gd10gpgi2q1fk89npjfvkmzvhkxhyc231bl"))))
+               (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
     (arguments
      `(#:tests? #f))                     ; It's run after build automatically.
     (build-system cmake-build-system)
@@ -2085,3 +2115,42 @@ aspects of UnitTest++.  UnitTest++ is mostly standard C++ and makes minimal use
 of advanced library and language features, which means it should be easily
 portable to just about any platform.")
     (license license:expat)))
+
+(define-public libfaketime
+  (package
+    (name "libfaketime")
+    (version "0.9.7")
+    (home-page "https://github.com/wolfcw/libfaketime")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
+              (file-name (git-file-name name version))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'configure
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (setenv "CC" "gcc")
+                        (setenv "PREFIX" out)
+                        #t)))
+                  (add-before 'check 'pre-check
+                    (lambda _
+                      (substitute* "test/functests/test_exclude_mono.sh"
+                        (("/bin/bash") (which "bash")))
+                      #t)))
+       #:test-target "test"))
+    (native-inputs
+     `(("perl" ,perl)))                           ;for tests
+    (synopsis "Fake the system time for single applications")
+    (description
+     "The libfaketime library allows users to modify the system time that an
+application \"sees\".  It is meant to be loaded using the dynamic linker's
+@code{LD_PRELOAD} environment variable.  The @command{faketime} command
+provides a simple way to achieve this.")
+    (license license:gpl2)))