1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 google-auth,
11 requests,
12
13 # tests
14 langchain-openai,
15 openai,
16 pyfakefs,
17 pytestCheckHook,
18 pytest-mock,
19 requests-mock,
20}:
21
22buildPythonPackage rec {
23 pname = "databricks-sdk";
24 version = "0.67.0";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "databricks";
29 repo = "databricks-sdk-py";
30 tag = "v${version}";
31 hash = "sha256-3UGPB3KEO7M4QFYiniU4hcaOUmCMq3vW4yBIxDUhHLk=";
32 };
33
34 build-system = [
35 setuptools
36 ];
37
38 dependencies = [
39 google-auth
40 requests
41 ];
42
43 pythonImportsCheck = [
44 "databricks.sdk"
45 ];
46
47 nativeCheckInputs = [
48 langchain-openai
49 openai
50 pyfakefs
51 pytestCheckHook
52 pytest-mock
53 requests-mock
54 ];
55
56 disabledTests = [
57 # Require internet access
58 # ValueError: default auth: cannot configure default credentials, please check...
59 "test_azure_cli_does_not_specify_tenant_id_with_msi"
60 "test_azure_cli_fallback"
61 "test_azure_cli_user_no_management_access"
62 "test_azure_cli_user_with_management_access"
63 "test_azure_cli_with_warning_on_stderr"
64 "test_azure_cli_workspace_header_present"
65 "test_config_azure_cli_host"
66 "test_config_azure_cli_host_and_resource_id"
67 "test_config_azure_cli_host_and_resource_i_d_configuration_precedence"
68 "test_load_azure_tenant_id_404"
69 "test_load_azure_tenant_id_happy_path"
70 "test_load_azure_tenant_id_no_location_header"
71 "test_load_azure_tenant_id_unparsable_location_header"
72 # Take an exceptionally long time when sandboxing is enabled due to retries
73 "test_multipart_upload"
74 "test_rewind_seekable_stream"
75 "test_resumable_upload"
76 # flaky -- ConnectionBroken under heavy load indicates a timing issue
77 "test_github_oidc_flow_works_with_azure"
78 ];
79
80 __darwinAllowLocalNetworking = true;
81
82 meta = {
83 description = "Databricks SDK for Python";
84 homepage = "https://github.com/databricks/databricks-sdk-py";
85 changelog = "https://github.com/databricks/databricks-sdk-py/blob/${src.tag}/CHANGELOG.md";
86 license = lib.licenses.asl20;
87 maintainers = with lib.maintainers; [ GaetanLepage ];
88 };
89}