1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, pythonOlder
6
7# propagates
8, isodate
9, pyparsing
10
11# propagates <3.8
12, importlib-metadata
13
14# extras: networkx
15, networkx
16
17# extras: html
18, html5lib
19
20# tests
21, pytestCheckHook
22}:
23
24buildPythonPackage rec {
25 pname = "rdflib";
26 version = "6.1.1";
27 format = "setuptools";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "RDFLib";
33 repo = pname;
34 rev = version;
35 hash = "sha256:1ih7vx4i16np1p8ig5faw74apmbm7kgyj9alya521yvzid6d7pzd";
36 };
37
38 propagatedBuildInputs = [
39 isodate
40 html5lib
41 pyparsing
42 ] ++ lib.optionals (pythonOlder "3.8") [
43 importlib-metadata
44 ];
45
46 passthru.optional-dependencies = {
47 html = [
48 html5lib
49 ];
50 networkx = [
51 networkx
52 ];
53 };
54
55 checkInputs = [
56 pytestCheckHook
57 ]
58 ++ passthru.optional-dependencies.networkx
59 ++ passthru.optional-dependencies.html;
60
61 pytestFlagsArray = [
62 # requires network access
63 "--deselect=rdflib/__init__.py::rdflib"
64 "--deselect=test/jsonld/test_onedotone.py::test_suite"
65 ];
66
67 disabledTests = [
68 # Requires network access
69 "test_service"
70 "testGuessFormatForParse"
71 ] ++ lib.optionals stdenv.isDarwin [
72 # Require loopback network access
73 "TestGraphHTTP"
74 ];
75
76 pythonImportsCheck = [
77 "rdflib"
78 ];
79
80 meta = with lib; {
81 description = "Python library for working with RDF";
82 homepage = "https://rdflib.readthedocs.io";
83 license = licenses.bsd3;
84 maintainers = with maintainers; [ ];
85 };
86}