summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/azure-kusto-data/default.nix
blob: 4aece96fb20ba614e955b5363dfade1f56ad00be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  uv-build,

  # dependencies
  azure-core,
  azure-identity,
  ijson,
  msal,
  python-dateutil,
  requests,

  # optional-dependencies

  # tests
  # aio:
  aiohttp,
  asgiref,
  # pandas:
  pandas,

  # tests
  aioresponses,
  pytest-asyncio,
  pytest-xdist,
  pytestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "azure-kusto-data";
  version = "6.0.4";
  pyproject = true;
  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "Azure";
    repo = "azure-kusto-python";
    tag = "v${finalAttrs.version}";
    hash = "sha256-iggsVxLmDbP6+oSPaIiujPLsZAWwm5VLZSl+HYm0DIQ=";
  };

  sourceRoot = "${finalAttrs.src.name}/azure-kusto-data";

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "uv_build>=0.8.9,<0.9.0" uv_build
  '';

  build-system = [ uv-build ];

  pythonRelaxDeps = [
    "ijson"
  ];
  dependencies = [
    azure-core
    azure-identity
    ijson
    msal
    python-dateutil
    requests
  ];

  optional-dependencies = {
    aio = [
      aiohttp
      asgiref
    ];
    pandas = [ pandas ];
  };

  nativeCheckInputs = [
    aioresponses
    pytest-asyncio
    pytest-xdist
    pytestCheckHook
  ]
  ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;

  pythonImportsCheck = [ "azure.kusto.data" ];

  disabledTests = [
    # AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="rowguid") are different
    "test_sanity_data_frame"
  ];

  disabledTestPaths = [
    # Tests require network access
    "tests/aio/test_async_token_providers.py"
    "tests/test_token_providers.py"
    "tests/test_e2e_data.py"

    # AssertionError: assert <class 'pandas.Timestamp'> is <class 'pandas.api.typing.NaTType'>
    "tests/test_helpers.py"
  ];

  meta = {
    description = "Kusto Data Client";
    homepage = "https://github.com/Azure/azure-kusto-python/tree/master/azure-kusto-data";
    changelog = "https://github.com/Azure/azure-kusto-python/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
})