2023-04-12 12:48:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-05-20 23:08:51 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, cython
|
|
|
|
, eventlet
|
2023-04-12 12:48:02 +00:00
|
|
|
, fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
, geomet
|
2023-04-12 12:48:02 +00:00
|
|
|
, gevent
|
|
|
|
, gremlinpython
|
|
|
|
, iana-etc
|
2020-04-24 23:36:52 +00:00
|
|
|
, libev
|
2023-04-12 12:48:02 +00:00
|
|
|
, libredirect
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
|
|
|
, nose
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytestCheckHook
|
2023-04-12 12:48:02 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytz
|
|
|
|
, pyyaml
|
|
|
|
, scales
|
|
|
|
, six
|
|
|
|
, sure
|
2021-02-05 17:12:51 +00:00
|
|
|
, twisted
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cassandra-driver";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "3.26.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "datastax";
|
|
|
|
repo = "python-driver";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-mLQEG41WyFtXY2PJzoM4uaI4Cm+0xSIAPGhijHHbTBk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
postPatch = ''
|
2023-04-12 12:48:02 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'geomet>=0.1,<0.3' 'geomet'
|
2021-08-22 07:53:02 +00:00
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
buildInputs = [
|
|
|
|
libev
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
geomet
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
eventlet
|
|
|
|
mock
|
|
|
|
nose
|
|
|
|
pytz
|
|
|
|
pyyaml
|
|
|
|
sure
|
|
|
|
scales
|
|
|
|
gremlinpython
|
|
|
|
gevent
|
|
|
|
twisted
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
# Make /etc/protocols accessible to allow socket.getprotobyname('tcp') in sandbox,
|
|
|
|
# also /etc/resolv.conf is referenced by some tests
|
|
|
|
preCheck = (lib.optionalString stdenv.isLinux ''
|
|
|
|
echo "nameserver 127.0.0.1" > resolv.conf
|
|
|
|
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
|
|
|
|
export LD_PRELOAD=${libredirect}/lib/libredirect.so
|
|
|
|
'') + ''
|
|
|
|
# increase tolerance for time-based test
|
|
|
|
substituteInPlace tests/unit/io/utils.py --replace 'delta=.15' 'delta=.3'
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"cassandra"
|
|
|
|
];
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
unset NIX_REDIRECTS LD_PRELOAD
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests/unit"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTestPaths = [
|
2021-02-05 17:12:51 +00:00
|
|
|
# requires puresasl
|
2021-05-20 23:08:51 +00:00
|
|
|
"tests/unit/advanced/test_auth.py"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# doesn't seem to be intended to be run directly
|
|
|
|
"_PoolTests"
|
|
|
|
# attempts to make connection to localhost
|
|
|
|
"test_connection_initialization"
|
2021-08-22 07:53:02 +00:00
|
|
|
# time-sensitive
|
|
|
|
"test_nts_token_performance"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A Python client driver for Apache Cassandra";
|
|
|
|
homepage = "http://datastax.github.io/python-driver";
|
2023-04-12 12:48:02 +00:00
|
|
|
changelog = "https://github.com/datastax/python-driver/blob/${version}/CHANGELOG.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ turion ris ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|