Subject: [PATCHv2 2/4] gnu: python-codecov: Update to 2.1.12.

From: Giacomo Leidi <[email-masked]>
Date: Wed, 4 Jan 2023 17:08:53 +0100

* gnu/packages/check.scm (python-codecov): Update to 2.1.12.
---
 gnu/packages/check.scm | 46 +++++++++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index d042f60207..31c46cc8a0 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -80,6 +80,7 @@ (define-module (gnu packages check)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages time)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages xml)
   #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:)
@@ -2094,19 +2095,46 @@ (define-public python-cov-core
 (define-public python-codecov
   (package
     (name "python-codecov")
-    (version "2.0.15")
+    (version "2.1.12")
     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "codecov" version))
-        (sha256
-         (base32
-          "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/codecov/codecov-python")
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0bdk1cp3hxydpx9knqfv88ywwzw7yqhywi0inxjd6x53qh75prqy"))))
     (build-system python-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (replace 'check
+                 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+                   (when tests?
+                     (setenv "CI" "True")
+                     (setenv "APPVEYOR" "True")
+                     (invoke (string-append #$python-pytest "/bin/py.test")
+                             "tests/test.py" "-vv"
+                             "--cov=codecov" "-k"
+                             (string-append
+                              ;; These tests require network access.
+                              "not test_bowerrc and "
+                              "not test_none_found and "
+                              "not test_run_coverage_fails and "
+                              "not test_disable_search"))))))))
     (native-inputs
-     (list python-unittest2))
+     (list git-minimal
+           mercurial
+           python-coverage-5.5
+           python-ddt
+           python-mock
+           python-pytest
+           python-pytest-cov
+           python-requests))
     (propagated-inputs
-     (list python-coverage python-requests))
+     (list python-coverage-5.5 python-requests))
     (home-page "https://github.com/codecov/codecov-python")
     (synopsis "Upload code coverage reports to @code{codecov.io}")
     (description
-- 
2.38.1