Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / clickhouse-driver / default.nix
blob375fee87486cda04d1dc14d80983258b347ad704
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , setuptools
5 , pytz
6 , tzlocal
7 , clickhouse-cityhash
8 , zstd
9 , lz4
10 , freezegun
11 , mock
12 , nose
13 , pytestCheckHook
14 , pytest-xdist
17 buildPythonPackage rec {
18   pname = "clickhouse-driver";
19   version = "0.2.5";
21   # pypi source doesn't contain tests
22   src = fetchFromGitHub {
23     owner = "mymarilyn";
24     repo = "clickhouse-driver";
25     rev = version;
26     hash = "sha256-o5v37jPKmvUW4GFVD742nHSdO0g0z2FA4FkacbaRfNA=";
27   };
29   propagatedBuildInputs = [
30     setuptools
31     pytz
32     tzlocal
33     clickhouse-cityhash
34     zstd
35     lz4
36   ];
38   nativeCheckInputs = [
39     freezegun
40     mock
41     nose
42     pytest-xdist
43     pytestCheckHook
44   ];
46   postPatch = ''
47     substituteInPlace setup.py \
48       --replace "lz4<=3.0.1" "lz4<=4"
49   '';
51   # remove source to prevent pytest testing source instead of the build artifacts
52   # (the source doesn't contain the extension modules)
53   preCheck = ''
54     rm -rf clickhouse_driver
55   '';
57   # some test in test_buffered_reader.py doesn't seem to return
58   disabledTestPaths = [ "tests/test_buffered_reader.py" ];
60   # most tests require `clickhouse`
61   # TODO: enable tests after `clickhouse` unbroken
62   doCheck = false;
64   pythonImportsCheck = [ "clickhouse_driver" ];
66   meta = with lib; {
67     description = "Python driver with native interface for ClickHouse";
68     homepage = "https://github.com/mymarilyn/clickhouse-driver";
69     license = licenses.mit;
70     maintainers = with maintainers; [ breakds ];
71   };