1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, aenum
5, importlib-metadata
6, isodate
7, six
8, tornado
9, pytestCheckHook
10, mock
11, pyhamcrest
12, radish-bdd
13}:
14
15buildPythonPackage rec {
16 pname = "gremlinpython";
17 version = "3.4.10";
18
19 # pypi tarball doesn't include tests
20 src = fetchFromGitHub {
21 owner = "apache";
22 repo = "tinkerpop";
23 rev = version;
24 sha256 = "0i9lkrwbsmpx1h9480vf97pibm2v37sgw2qm2r1c0i8gg5bcmhj3";
25 };
26 sourceRoot = "source/gremlin-python/src/main/jython";
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace 'aenum>=1.4.5,<3.0.0' 'aenum' \
30 --replace 'tornado>=4.4.1,<6.0' 'tornado' \
31 --replace 'PyHamcrest>=1.9.0,<2.0.0' 'PyHamcrest' \
32 --replace 'radish-bdd==0.8.6' 'radish-bdd' \
33 --replace 'mock>=3.0.5,<4.0.0' 'mock' \
34 --replace 'pytest>=4.6.4,<5.0.0' 'pytest' \
35 --replace 'importlib-metadata<3.0.0' 'importlib-metadata' \
36 --replace 'pytest-runner==5.2' ' '
37 '';
38
39 # setup-requires requirements
40 nativeBuildInputs = [
41 importlib-metadata
42 ];
43 propagatedBuildInputs = [
44 aenum
45 isodate
46 six
47 tornado
48 ];
49
50 checkInputs = [
51 pytestCheckHook
52 mock
53 pyhamcrest
54 radish-bdd
55 ];
56
57 # disable custom pytest report generation
58 preCheck = ''
59 substituteInPlace setup.cfg --replace 'addopts' '#addopts'
60 '';
61
62 # many tests expect a running tinkerpop server
63 disabledTestPaths = [
64 "tests/driver/test_client.py"
65 "tests/driver/test_driver_remote_connection.py"
66 "tests/driver/test_driver_remote_connection_threaded.py"
67 "tests/process/test_dsl.py"
68 "tests/structure/io/test_functionalityio.py"
69 ];
70 pytestFlagsArray = [
71 # disabledTests doesn't quite allow us to be precise enough for this
72 "-k 'not (TestFunctionalGraphSONIO and (test_timestamp or test_datetime or test_uuid))'"
73 ];
74
75 meta = with lib; {
76 description = "Gremlin-Python implements Gremlin, the graph traversal language of Apache TinkerPop, within the Python language";
77 homepage = "https://tinkerpop.apache.org/";
78 license = licenses.asl20;
79 maintainers = with maintainers; [ turion ris ];
80 };
81}