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