Subject: [bug#50481] [PATCH 2/3] gnu: python-rdflib: Update to 6.0.0.

From: Arun Isaac <[email-masked]>
Date: Thu, 9 Sep 2021 01:12:10 +0530

* gnu/packages/rdf.scm (python-rdflib): Update to 6.0.0.
[arguments]: Replace check phase. Enable tests.
[native-inputs]: Add python-black, python-coverage,
python-doctest-ignore-unicode, python-flake8, python-networkx and
python-nose-timer.
[propagated-inputs]: Add python-berkeleydb.
---
 gnu/packages/rdf.scm | 53 +++++++++++++++++++++++++++-----------------
 1 file changed, 33 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/rdf.scm b/gnu/packages/rdf.scm
index fb84d8053d..d09c28402a 100644
--- a/gnu/packages/rdf.scm
+++ b/gnu/packages/rdf.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Pjotr Prins <[email-masked]>
 ;;; Copyright © 2020 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2020 pukkamustard <[email-masked]>
+;;; Copyright © 2021 Arun Isaac <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -337,31 +338,43 @@ ideal (e.g. in LV2 implementations or embedded applications).")
 (define-public python-rdflib
   (package
     (name "python-rdflib")
-    (version "4.2.2")
+    (version "6.0.0")
     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "rdflib" version))
-        (sha256
-         (base32
-          "0398c714znnhaa2x7v51b269hk20iz073knq2mvmqp2ma92z27fs"))))
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "rdflib" version))
+       (sha256
+        (base32
+         "0ycqczf33irq0ai6wpg4vxd9xwlpq3c41hsy411xvx16xdbxgr3w"))))
     (build-system python-build-system)
     (arguments
-     '(;; FIXME: Three test failures. Should be fixed next release.
-       #:tests? #f))
-       ;; #:phases
-       ;; (modify-phases %standard-phases
-       ;;   (replace 'check
-       ;;     (lambda _
-       ;;       ;; Run tests from the build directory so python3 only
-       ;;       ;; sees the installed 2to3 version.
-       ;;       (invoke "nosetests" "--where=./build/src"))))))
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key outputs tests? #:allow-other-keys)
+             (when tests?
+               ;; Make installed package available for running the tests.
+               (setenv "PATH" (string-append (assoc-ref outputs "out")
+                                             "/bin:" (getenv "PATH")))
+               (invoke "nosetests"
+                       ;; Exclude tests that require network access.
+                       "--exclude" "^test_sparql_service$"
+                       "--exclude" "^testGuessFormatForParse$"
+                       "--exclude" "^test_onedotone$"
+                       "--exclude" "^rdflib$")))))))
     (native-inputs
-     `(("python-nose" ,python-nose)))
+     `(("python-black" ,python-black)
+       ("python-coverage" ,python-coverage)
+       ("python-doctest-ignore-unicode" ,python-doctest-ignore-unicode)
+       ("python-flake8" ,python-flake8)
+       ("python-networkx" ,python-networkx)
+       ("python-nose" ,python-nose)
+       ("python-nose-timer" ,python-nose-timer)))
     (propagated-inputs
-      `(("python-html5lib" ,python-html5lib)
-        ("python-isodate" ,python-isodate)
-        ("python-pyparsing" ,python-pyparsing)))
+     `(("python-berkeleydb" ,python-berkeleydb)
+       ("python-html5lib" ,python-html5lib)
+       ("python-isodate" ,python-isodate)
+       ("python-pyparsing" ,python-pyparsing)))
     (home-page "https://github.com/RDFLib/rdflib")
     (synopsis "Python RDF library")
     (description
-- 
2.33.0