Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / clickhouse-connect / default.nix
blobe7bf0aa8e036b042d0b6c8c4f3bcddf975c88418
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pythonOlder
5 , pytestCheckHook
6   # build_requires
7 , cython
8   # install_requires
9 , certifi
10 , importlib-metadata
11 , urllib3
12 , pytz
13 , zstandard
14 , lz4
15   # extras_require
16 , sqlalchemy
17 , numpy
18 , pandas
19 , pyarrow
20 , orjson
21   # not in tests_require, but should be
22 , pytest-dotenv
24 buildPythonPackage rec {
25   pname = "clickhouse-connect";
26   version = "0.7.8";
28   format = "setuptools";
30   disabled = pythonOlder "3.7";
32   src = fetchFromGitHub {
33     repo = "clickhouse-connect";
34     owner = "ClickHouse";
35     rev = "refs/tags/v${version}";
36     hash = "sha256-tdf9aYKAFpRyaqGGNxXs4bzmY6mdhKZ5toFBJRmD2VY=";
37   };
39   nativeBuildInputs = [ cython ];
40   setupPyBuildFlags = [ "--inplace" ];
41   enableParallelBuilding = true;
43   propagatedBuildInputs = [
44     certifi
45     importlib-metadata
46     urllib3
47     pytz
48     zstandard
49     lz4
50   ];
52   nativeCheckInputs = [ pytestCheckHook pytest-dotenv ]
53     ++ passthru.optional-dependencies.sqlalchemy
54     ++ passthru.optional-dependencies.numpy;
56   # these tests require a running clickhouse instance
57   disabledTestPaths = [
58     "tests/integration_tests"
59     "tests/tls"
60   ];
62   pythonImportsCheck = [
63     "clickhouse_connect"
64     "clickhouse_connect.driverc.buffer"
65     "clickhouse_connect.driverc.dataconv"
66     "clickhouse_connect.driverc.npconv"
67   ];
69   passthru = {
70     optional-dependencies = {
71       sqlalchemy = [ sqlalchemy ];
72       numpy = [ numpy ];
73       pandas = [ pandas ];
74       arrow = [ pyarrow ];
75       orjson = [ orjson ];
76     };
77   };
79   meta = with lib; {
80     description = "ClickHouse Database Core Driver for Python, Pandas, and Superset";
81     homepage = "https://github.com/ClickHouse/clickhouse-connect";
82     license = licenses.asl20;
83     maintainers = with maintainers; [ cpcloud ];
84   };