about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/dbx/default.nix
blob: e8b0d4cc7228d4cec2d02f60725740b79c775256 (plain) (blame)
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
{ lib
, fetchFromGitHub
, git
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "dbx";
  version = "0.8.11";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "databrickslabs";
    repo = "dbx";
    rev = "refs/tags/v${version}";
    hash = "sha256-dArR1z3wkGDd3Y1WHK0sLjhuaKHAcsx6cCH2rgVdUGs=";
  };

  pythonRelaxDeps = [
    "rich"
    "typer"
  ];

  pythonRemoveDeps = [
    "mlflow-skinny"
  ];

  nativeBuildInputs = with python3.pkgs; [
    pythonRelaxDepsHook
  ];

  propagatedBuildInputs = with python3.pkgs; [
    aiohttp
    click
    cookiecutter
    cryptography
    databricks-cli
    jinja2
    mlflow
    pathspec
    pydantic
    pyyaml
    requests
    retry
    rich
    tenacity
    typer
    watchdog
  ] ++ typer.optional-dependencies.all;

  passthru.optional-dependencies = with python3.pkgs; {
    aws = [
      boto3
    ];
    azure = [
      azure-storage-blob
      azure-identity
    ];
    gcp = [
      google-cloud-storage
    ];
  };

  nativeCheckInputs = [
    git
  ] ++ (with python3.pkgs; [
    pytest-asyncio
    pytest-mock
    pytest-timeout
    pytestCheckHook
  ]);

  preCheck = ''
    export HOME=$(mktemp -d)
    export PATH="$PATH:$out/bin"
  '';

  pytestFlagsArray = [
    "tests/unit"
  ];

  disabledTests = [
    # Fails because of dbfs CLI wrong call
    "test_dbfs_unknown_user"
    "test_dbfs_no_root"
    # Requires pylint, prospector, pydocstyle
    "test_python_basic_sanity_check"
  ];

  pythonImportsCheck = [
    "dbx"
  ];

  meta = with lib; {
    description = "CLI tool for advanced Databricks jobs management";
    homepage = "https://github.com/databrickslabs/dbx";
    changelog = "https://github.com/databrickslabs/dbx/blob/v${version}/CHANGELOG.md";
    license = licenses.databricks-dbx;
    maintainers = with maintainers; [ GuillaumeDesforges ];
  };
}