1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7
8 # builds
9 poetry-core,
10
11 # propagates
12 isodate,
13 pyparsing,
14
15 # extras: networkx
16 networkx,
17
18 # extras: html
19 html5lib,
20
21 # tests
22 pip,
23 pytest-cov-stub,
24 pytestCheckHook,
25 setuptools,
26}:
27
28buildPythonPackage rec {
29 pname = "rdflib";
30 version = "7.1.4";
31 pyproject = true;
32
33 disabled = pythonOlder "3.8";
34
35 src = fetchFromGitHub {
36 owner = "RDFLib";
37 repo = "rdflib";
38 tag = version;
39 hash = "sha256-u9hdwxAJIuTQ3zKstbwn88u1opzWXc8otJKbtIl4Li4=";
40 };
41
42 build-system = [ poetry-core ];
43
44 dependencies = [
45 pyparsing
46 ]
47 ++ lib.optionals (pythonOlder "3.11") [ isodate ];
48
49 optional-dependencies = {
50 html = [ html5lib ];
51 networkx = [ networkx ];
52 };
53
54 __darwinAllowLocalNetworking = true;
55
56 nativeCheckInputs = [
57 pip
58 pytest-cov-stub
59 pytestCheckHook
60 setuptools
61 ]
62 ++ optional-dependencies.networkx
63 ++ optional-dependencies.html;
64
65 disabledTestPaths = [
66 # requires network access
67 "rdflib/__init__.py::rdflib"
68 "test/jsonld/test_onedotone.py::test_suite"
69 ];
70
71 disabledTests = [
72 # Requires network access
73 "test_service"
74 "testGuessFormatForParse"
75 "test_infix_owl_example1"
76 "test_context"
77 "test_example"
78 "test_guess_format_for_parse"
79 "rdflib.extras.infixowl"
80 ]
81 ++ lib.optionals stdenv.hostPlatform.isDarwin [
82 # Require loopback network access
83 "TestGraphHTTP"
84 ];
85
86 pythonImportsCheck = [ "rdflib" ];
87
88 meta = with lib; {
89 description = "Python library for working with RDF";
90 homepage = "https://rdflib.readthedocs.io";
91 license = licenses.bsd3;
92 maintainers = [ ];
93 };
94}