1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 aenum,
6 aiohttp,
7 importlib-metadata,
8 isodate,
9 nest-asyncio,
10 pytestCheckHook,
11 pythonOlder,
12 mock,
13 pyhamcrest,
14 pyyaml,
15 radish-bdd,
16}:
17
18buildPythonPackage rec {
19 __structuredAttrs = true;
20
21 pname = "gremlinpython";
22 version = "3.7.3";
23 format = "setuptools";
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "apache";
29 repo = "tinkerpop";
30 tag = version;
31 hash = "sha256-Yc0l3kE+6dM9v4QUZPFpm/yjDCrqVO35Vy5srEjAExE=";
32 };
33
34 sourceRoot = "${src.name}/gremlin-python/src/main/python";
35
36 postPatch = ''
37 sed -i '/pytest-runner/d' setup.py
38
39 substituteInPlace setup.py \
40 --replace 'importlib-metadata<5.0.0' 'importlib-metadata' \
41 --replace "os.getenv('VERSION', '?').replace('-SNAPSHOT', '.dev-%d' % timestamp)" '"${version}"'
42 '';
43
44 # setup-requires requirements
45 nativeBuildInputs = [ importlib-metadata ];
46
47 propagatedBuildInputs = [
48 aenum
49 aiohttp
50 isodate
51 nest-asyncio
52 ];
53
54 nativeCheckInputs = [
55 pytestCheckHook
56 mock
57 pyhamcrest
58 pyyaml
59 radish-bdd
60 ];
61
62 # disable custom pytest report generation
63 preCheck = ''
64 substituteInPlace setup.cfg --replace 'addopts' '#addopts'
65 export TEST_TRANSACTIONS='false'
66 '';
67
68 # many tests expect a running tinkerpop server
69 disabledTestPaths = [
70 "tests/driver/test_client.py"
71 "tests/driver/test_driver_remote_connection.py"
72 "tests/driver/test_driver_remote_connection_http.py"
73 "tests/driver/test_driver_remote_connection_threaded.py"
74 "tests/driver/test_web_socket_client_behavior.py"
75 "tests/process/test_dsl.py"
76 "tests/structure/io/test_functionalityio.py"
77 ];
78
79 disabledTests = [
80 "TestFunctionalGraphSONIO and test_timestamp"
81 "TestFunctionalGraphSONIO and test_datetime"
82 "TestFunctionalGraphSONIO and test_uuid"
83 "test_transaction_commit"
84 "test_transaction_rollback"
85 "test_transaction_no_begin"
86 "test_multi_commit_transaction"
87 "test_multi_rollback_transaction"
88 "test_multi_commit_and_rollback"
89 "test_transaction_close_tx"
90 "test_transaction_close_tx_from_parent"
91 ];
92
93 meta = with lib; {
94 description = "Gremlin-Python implements Gremlin, the graph traversal language of Apache TinkerPop, within the Python language";
95 homepage = "https://tinkerpop.apache.org/";
96 license = licenses.asl20;
97 maintainers = with maintainers; [ ris ];
98 };
99}