2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
clickhouse-cityhash,
|
|
|
|
cython,
|
|
|
|
fetchFromGitHub,
|
|
|
|
freezegun,
|
|
|
|
lz4,
|
|
|
|
mock,
|
|
|
|
nose,
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-xdist,
|
|
|
|
pytz,
|
|
|
|
setuptools,
|
|
|
|
tzlocal,
|
|
|
|
zstd,
|
2020-12-07 07:45:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "clickhouse-driver";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.2.7";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# pypi source doesn't contain tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mymarilyn";
|
|
|
|
repo = "clickhouse-driver";
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-l0YHWY25PMHgZG/sAZjtGhwmcxWdA8k96zlm9hbKcek=";
|
2020-12-07 07:45:13 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
2020-12-07 07:45:13 +00:00
|
|
|
setuptools
|
2024-04-21 15:54:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
clickhouse-cityhash
|
|
|
|
lz4
|
2020-12-07 07:45:13 +00:00
|
|
|
pytz
|
|
|
|
tzlocal
|
|
|
|
zstd
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-12-07 07:45:13 +00:00
|
|
|
freezegun
|
|
|
|
mock
|
|
|
|
nose
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2020-12-07 07:45:13 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "lz4<=3.0.1" "lz4<=4"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# remove source to prevent pytest testing source instead of the build artifacts
|
|
|
|
# (the source doesn't contain the extension modules)
|
|
|
|
preCheck = ''
|
|
|
|
rm -rf clickhouse_driver
|
|
|
|
'';
|
|
|
|
|
|
|
|
# some test in test_buffered_reader.py doesn't seem to return
|
|
|
|
disabledTestPaths = [ "tests/test_buffered_reader.py" ];
|
|
|
|
|
|
|
|
# most tests require `clickhouse`
|
|
|
|
# TODO: enable tests after `clickhouse` unbroken
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
pythonImportsCheck = [ "clickhouse_driver" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python driver with native interface for ClickHouse";
|
|
|
|
homepage = "https://github.com/mymarilyn/clickhouse-driver";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ breakds ];
|
|
|
|
};
|
|
|
|
}
|