nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, fetchFromGitHub
3, git
4, python3
5}:
6
7python3.pkgs.buildPythonApplication rec {
8 pname = "dbx";
9 version = "0.8.11";
10 format = "setuptools";
11
12 src = fetchFromGitHub {
13 owner = "databrickslabs";
14 repo = "dbx";
15 rev = "refs/tags/v${version}";
16 hash = "sha256-dArR1z3wkGDd3Y1WHK0sLjhuaKHAcsx6cCH2rgVdUGs=";
17 };
18
19 postPatch = ''
20 substituteInPlace setup.py \
21 --replace "mlflow-skinny>=1.28.0,<3.0.0" "mlflow" \
22 --replace "rich==12.6.0" "rich"
23 '';
24
25 propagatedBuildInputs = with python3.pkgs; [
26 aiohttp
27 click
28 cookiecutter
29 cryptography
30 databricks-cli
31 jinja2
32 mlflow
33 pathspec
34 pydantic
35 pyyaml
36 requests
37 retry
38 rich
39 tenacity
40 typer
41 watchdog
42 ] ++ typer.optional-dependencies.all;
43
44 passthru.optional-dependencies = with python3.pkgs; {
45 aws = [
46 boto3
47 ];
48 azure = [
49 azure-storage-blob
50 azure-identity
51 ];
52 gcp = [
53 google-cloud-storage
54 ];
55 };
56
57 nativeCheckInputs = [
58 git
59 ] ++ (with python3.pkgs; [
60 pytest-asyncio
61 pytest-mock
62 pytest-timeout
63 pytestCheckHook
64 ]);
65
66 preCheck = ''
67 export HOME=$(mktemp -d)
68 export PATH="$PATH:$out/bin"
69 '';
70
71 pytestFlagsArray = [
72 "tests/unit"
73 ];
74
75 disabledTests = [
76 # Fails because of dbfs CLI wrong call
77 "test_dbfs_unknown_user"
78 "test_dbfs_no_root"
79 # Requires pylint, prospector, pydocstyle
80 "test_python_basic_sanity_check"
81 ];
82
83 pythonImportsCheck = [
84 "dbx"
85 ];
86
87 meta = with lib; {
88 description = "CLI tool for advanced Databricks jobs management";
89 homepage = "https://github.com/databrickslabs/dbx";
90 changelog = "https://github.com/databrickslabs/dbx/blob/v${version}/CHANGELOG.md";
91 license = licenses.databricks-dbx;
92 maintainers = with maintainers; [ GuillaumeDesforges ];
93 };
94}