summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/gremlinpython/default.nix
blob: 370b702f14de9c2b10a7b028b9b775de63a98a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  aenum,
  aiohttp,
  isodate,
  nest-asyncio,
  pytestCheckHook,
  pythonOlder,
  mock,
  pyhamcrest,
  pyyaml,
  radish-bdd,
  setuptools,
}:

buildPythonPackage rec {
  __structuredAttrs = true;

  pname = "gremlinpython";
  version = "3.8.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "apache";
    repo = "tinkerpop";
    tag = version;
    hash = "sha256-dslSvtne+0mobjhjZDiO7crQE3aW5wEMWw7l3LkBTV8=";
  };

  patches = [
    (fetchpatch {
      name = "remove-async_timeout.pach";
      url = "https://github.com/apache/tinkerpop/commit/aa327ace6feaf6ccd3eca411f3b5f6f86f8571f6.patch";
      excludes = [ "gremlin-python/src/main/python/setup.py" ];
      hash = "sha256-NyXA9vffFem1EzhdNWuoYr7JPkT5DuKyl409LFj9AvQ=";
    })
  ];

  postPatch = ''
    cd gremlin-python/src/main/python

    substituteInPlace gremlin_python/__init__.py \
      --replace-fail ".dev1" ""
  '';

  build-system = [ setuptools ];

  pythonRemoveDeps = [
    "async-timeout"
  ];

  dependencies = [
    aenum
    aiohttp
    isodate
    nest-asyncio
  ];

  nativeCheckInputs = [
    pytestCheckHook
    mock
    pyhamcrest
    pyyaml
    radish-bdd
  ];

  # disable custom pytest report generation
  preCheck = ''
    export TEST_TRANSACTIONS='false'
  '';

  # many tests expect a running tinkerpop server
  disabledTestPaths = [
    "tests/driver/test_client.py"
    "tests/driver/test_driver_remote_connection.py"
    "tests/driver/test_driver_remote_connection_http.py"
    "tests/driver/test_driver_remote_connection_threaded.py"
    "tests/driver/test_web_socket_client_behavior.py"
    "tests/process/test_dsl.py"
    "tests/structure/io/test_functionalityio.py"
  ];

  disabledTests = [
    "TestFunctionalGraphSONIO and test_timestamp"
    "TestFunctionalGraphSONIO and test_datetime"
    "TestFunctionalGraphSONIO and test_uuid"
    "test_transaction_commit"
    "test_transaction_rollback"
    "test_transaction_no_begin"
    "test_multi_commit_transaction"
    "test_multi_rollback_transaction"
    "test_multi_commit_and_rollback"
    "test_transaction_close_tx"
    "test_transaction_close_tx_from_parent"
  ];

  meta = {
    changelog = "https://github.com/apache/tinkerpop/blob/${src.tag}/CHANGELOG.asciidoc";
    description = "Gremlin-Python implements Gremlin, the graph traversal language of Apache TinkerPop, within the Python language";
    homepage = "https://tinkerpop.apache.org/";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ ris ];
  };
}