Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / rdflib / default.nix
blob471439b28e5ce3ff4106d1860202616173da6ac6
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
5 , pythonOlder
7 # builds
8 , poetry-core
10 # propagates
11 , isodate
12 , pyparsing
14 # propagates <3.8
15 , importlib-metadata
17 # extras: networkx
18 , networkx
20 # extras: html
21 , html5lib
23 # tests
24 , pip
25 , pytest-cov
26 , pytestCheckHook
29 buildPythonPackage rec {
30   pname = "rdflib";
31   version = "7.0.0";
32   format = "pyproject";
34   disabled = pythonOlder "3.8";
36   src = fetchFromGitHub {
37     owner = "RDFLib";
38     repo = pname;
39     rev = "refs/tags/${version}";
40     hash = "sha256-VCjvgXMun1Hs+gPeqjzLXbIX1NBQ5aMLz0aWlwsm0iY=";
41   };
43   nativeBuildInputs = [
44     poetry-core
45   ];
47   propagatedBuildInputs = [
48     isodate
49     html5lib
50     pyparsing
51   ] ++ lib.optionals (pythonOlder "3.8") [
52     importlib-metadata
53   ];
55   passthru.optional-dependencies = {
56     html = [
57       html5lib
58     ];
59     networkx = [
60       networkx
61     ];
62   };
64   __darwinAllowLocalNetworking = true;
66   nativeCheckInputs = [
67     pip
68     pytest-cov
69     pytestCheckHook
70   ]
71   ++ passthru.optional-dependencies.networkx
72   ++ passthru.optional-dependencies.html;
74   pytestFlagsArray = [
75     # requires network access
76     "--deselect=rdflib/__init__.py::rdflib"
77     "--deselect=test/jsonld/test_onedotone.py::test_suite"
78   ];
80   disabledTests = [
81     # Requires network access
82     "test_service"
83     "testGuessFormatForParse"
84     "test_infix_owl_example1"
85     "test_context"
86     "test_example"
87     "test_guess_format_for_parse"
88     "rdflib.extras.infixowl"
89   ] ++ lib.optionals stdenv.isDarwin [
90     # Require loopback network access
91     "TestGraphHTTP"
92   ];
94   pythonImportsCheck = [
95     "rdflib"
96   ];
98   meta = with lib; {
99     description = "Python library for working with RDF";
100     homepage = "https://rdflib.readthedocs.io";
101     license = licenses.bsd3;
102     maintainers = with maintainers; [ ];
103   };