2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, aenum
|
2021-08-10 14:31:46 +00:00
|
|
|
, aiohttp
|
2021-05-20 23:08:51 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, isodate
|
2021-08-10 14:31:46 +00:00
|
|
|
, nest-asyncio
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, mock
|
|
|
|
, pyhamcrest
|
|
|
|
, radish-bdd
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gremlinpython";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "3.6.1";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
# pypi tarball doesn't include tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "tinkerpop";
|
|
|
|
rev = version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-FMA9hJdq7gYkDtQO04Bwpjq2Q7nXGuN9wrBD4b9GgwY=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
sourceRoot = "source/gremlin-python/src/main/python";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postPatch = ''
|
2022-11-21 17:40:18 +00:00
|
|
|
sed -i '/pytest-runner/d' setup.py
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
substituteInPlace setup.py \
|
2023-01-20 10:41:00 +00:00
|
|
|
--replace 'aiohttp>=3.8.0,<=3.8.1' 'aiohttp' \
|
2023-03-30 22:05:00 +00:00
|
|
|
--replace 'importlib-metadata<5.0.0' 'importlib-metadata' \
|
|
|
|
--replace "os.getenv('VERSION', '?').replace('-SNAPSHOT', '.dev-%d' % timestamp)" '"${version}"'
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# setup-requires requirements
|
|
|
|
nativeBuildInputs = [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aenum
|
2021-08-10 14:31:46 +00:00
|
|
|
aiohttp
|
2021-05-20 23:08:51 +00:00
|
|
|
isodate
|
2021-08-10 14:31:46 +00:00
|
|
|
nest-asyncio
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
mock
|
|
|
|
pyhamcrest
|
|
|
|
radish-bdd
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
# disable custom pytest report generation
|
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace setup.cfg --replace 'addopts' '#addopts'
|
2022-04-15 01:41:22 +00:00
|
|
|
export TEST_TRANSACTIONS='false'
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# many tests expect a running tinkerpop server
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/driver/test_client.py"
|
|
|
|
"tests/driver/test_driver_remote_connection.py"
|
|
|
|
"tests/driver/test_driver_remote_connection_threaded.py"
|
|
|
|
"tests/process/test_dsl.py"
|
|
|
|
"tests/structure/io/test_functionalityio.py"
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# disabledTests doesn't quite allow us to be precise enough for this
|
|
|
|
"-k 'not (TestFunctionalGraphSONIO and (test_timestamp or test_datetime or test_uuid))'"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Gremlin-Python implements Gremlin, the graph traversal language of Apache TinkerPop, within the Python language";
|
|
|
|
homepage = "https://tinkerpop.apache.org/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ turion ris ];
|
|
|
|
};
|
|
|
|
}
|