Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / python-arango / default.nix
blob09218269828a114c04ae22e1dd44c41f57e87827
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pythonOlder
5 , pytestCheckHook
7 # build-system
8 , setuptools
9 , setuptools-scm
11 # dependencies
12 , urllib3
13 , requests
14 , requests-toolbelt
15 , pyjwt
16 , importlib-metadata
17 , packaging
19 # tests
20 , arangodb
21 , mock
24 let
25   testDBOpts = {
26     host = "127.0.0.1";
27     port = "8529";
28     password = "test";
29     secret = "secret";
30   };
33 buildPythonPackage rec {
34   pname = "python-arango";
35   version = "7.9.1";
36   format = "pyproject";
38   disabled = pythonOlder "3.7";
40   src = fetchFromGitHub {
41     owner = "ArangoDB-Community";
42     repo = "python-arango";
43     rev = "refs/tags/${version}";
44     hash = "sha256-N10ysJKk0jxFyjgR/MXKHVS2MxCQtfFFGEh1IZ2eJk0=";
45   };
47   nativeBuildInputs = [
48     setuptools
49     setuptools-scm
50   ];
52   propagatedBuildInputs = [
53     importlib-metadata
54     requests
55     requests-toolbelt
56     packaging
57     pyjwt
58     setuptools
59     urllib3
60   ];
62   nativeCheckInputs = [
63     arangodb
64     mock
65     pytestCheckHook
66   ];
68   # arangodb is compiled only for particular target architectures
69   # (i.e. "haswell"). Thus, these tests may not pass reproducibly,
70   # failing with: `166: Illegal instruction` if not run on arangodb's
71   # specified architecture.
72   #
73   # nonetheless, the client library should remain in nixpkgs - since
74   # the client library will talk to arangodb across the network and
75   # architecture issues will be irrelevant.
76   doCheck = false;
78   preCheck = lib.optionalString doCheck ''
79     # Start test DB
80     mkdir -p .nix-test/{data,work}
82     ICU_DATA=${arangodb}/share/arangodb3 \
83     GLIBCXX_FORCE_NEW=1 \
84     TZ=UTC \
85     TZ_DATA=${arangodb}/share/arangodb3/tzdata \
86     ARANGO_ROOT_PASSWORD=${testDBOpts.password} \
87     ${arangodb}/bin/arangod \
88       --server.uid=$(id -u) \
89       --server.gid=$(id -g) \
90       --server.authentication=true \
91       --server.endpoint=http+tcp://${testDBOpts.host}:${testDBOpts.port} \
92       --server.descriptors-minimum=4096 \
93       --server.jwt-secret=${testDBOpts.secret} \
94       --javascript.app-path=.nix-test/app \
95       --log.file=.nix-test/log \
96       --database.directory=.nix-test/data \
97       --foxx.api=false &
98   '';
100   pytestFlagsArray = [
101     "--host"
102     testDBOpts.host
103     "--port"
104     testDBOpts.port
105     "--passwd"
106     testDBOpts.password
107     "--secret"
108     testDBOpts.secret
109   ];
111   disabledTests = [
112     # AssertionError geo-related - try enabling later
113     "test_document_find_in_box"
115     # maybe arangod misconfig - try enabling later
116     # arango.exceptions.JWTAuthError: [HTTP 401][ERR 401] Wrong credentials
117     "test_auth_jwt"
119     # ValueError - try enabling later
120     # maybe missed 3.9.3->3.10.0 changes
121     # most caused by key change: isNewlyCreated->new
122     "test_add_hash_index"
123     "test_add_skiplist_index"
124     "test_add_persistent_index"
125     "test_add_ttl_index"
126     "test_delete_index"
127     "test_pregel_management"
129     # formatting error - try enabling later
130     # maybe missed 3.9.3->3.10.0 changes
131     # caused by: body["computedValues"] = None
132     "test_permission_management"
133     "test_collection_misc_methods"
134     "test_collection_management"
135     "test_replication_inventory"
137     # want outgoing network to update foxx apis
138     # so foxx.api disabled in arangod startup
139     "test_foxx_service_management_file"
140     "test_foxx_service_management_json"
141     "test_foxx_config_management"
142     "test_foxx_dependency_management"
143     "test_foxx_development_toggle"
144     "test_foxx_misc_functions"
146     # no replication configured via arangod invocation
147     "test_replication_applier"
148   ];
150   pythonImportsCheck = [
151     "arango"
152   ];
154   meta = with lib; {
155     description = "Python Driver for ArangoDB";
156     homepage = "https://github.com/ArangoDB-Community/python-arango";
157     changelog = "https://github.com/ArangoDB-Community/python-arango/releases/tag/${version}";
158     license = licenses.mit;
159     maintainers = with maintainers; [ jsoo1 ];
160   };