2024-04-05 10:44:16 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
git,
|
|
|
|
python3,
|
2022-07-20 14:39:18 +00:00
|
|
|
}:
|
2024-04-05 10:44:16 +00:00
|
|
|
let
|
2024-08-02 11:10:35 +00:00
|
|
|
python = python3.override { self = python; packageOverrides = self: super: { pydantic = super.pydantic_1; }; };
|
2024-04-05 10:44:16 +00:00
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
2022-07-20 14:39:18 +00:00
|
|
|
pname = "dbx";
|
2023-08-14 11:49:48 +00:00
|
|
|
version = "0.8.18";
|
2024-04-05 10:42:05 +00:00
|
|
|
pyproject = true;
|
2022-07-20 14:39:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "databrickslabs";
|
|
|
|
repo = "dbx";
|
2023-02-27 09:12:58 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-08-14 11:49:48 +00:00
|
|
|
hash = "sha256-5qjEABNTSUD9I2uAn49HQ4n+gbAcmfnqS4Z2M9MvFXQ=";
|
2022-07-20 14:39:18 +00:00
|
|
|
};
|
|
|
|
|
2023-06-10 22:31:40 +00:00
|
|
|
pythonRelaxDeps = [
|
2024-04-05 10:42:05 +00:00
|
|
|
"cryptography"
|
|
|
|
"databricks-cli"
|
2023-06-10 22:31:40 +00:00
|
|
|
"rich"
|
|
|
|
"typer"
|
|
|
|
];
|
|
|
|
|
2024-04-05 10:44:16 +00:00
|
|
|
pythonRemoveDeps = [ "mlflow-skinny" ];
|
2023-06-10 22:31:40 +00:00
|
|
|
|
2024-04-05 10:44:16 +00:00
|
|
|
build-system = with python.pkgs; [ setuptools ];
|
2024-04-05 10:42:05 +00:00
|
|
|
|
2023-02-27 09:25:33 +00:00
|
|
|
|
2024-04-05 10:44:16 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
with python.pkgs;
|
|
|
|
[
|
|
|
|
aiohttp
|
|
|
|
click
|
|
|
|
cookiecutter
|
|
|
|
cryptography
|
|
|
|
databricks-cli
|
|
|
|
jinja2
|
|
|
|
mlflow
|
|
|
|
pathspec
|
|
|
|
pydantic
|
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
retry
|
|
|
|
rich
|
|
|
|
tenacity
|
|
|
|
typer
|
|
|
|
watchdog
|
2024-07-07 09:52:13 +00:00
|
|
|
];
|
2022-07-20 14:39:18 +00:00
|
|
|
|
2024-09-29 05:35:45 +00:00
|
|
|
optional-dependencies = with python3.pkgs; {
|
2024-04-05 10:44:16 +00:00
|
|
|
aws = [ boto3 ];
|
2023-02-27 09:25:33 +00:00
|
|
|
azure = [
|
|
|
|
azure-storage-blob
|
|
|
|
azure-identity
|
|
|
|
];
|
2024-04-05 10:44:16 +00:00
|
|
|
gcp = [ google-cloud-storage ];
|
2023-02-27 09:25:33 +00:00
|
|
|
};
|
|
|
|
|
2024-04-05 10:44:16 +00:00
|
|
|
nativeCheckInputs =
|
|
|
|
[ git ]
|
|
|
|
++ (with python3.pkgs; [
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
|
|
|
pytest-timeout
|
|
|
|
pytestCheckHook
|
|
|
|
]);
|
2022-10-16 21:39:01 +00:00
|
|
|
|
2022-07-31 09:10:14 +00:00
|
|
|
preCheck = ''
|
2022-10-16 21:39:01 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
export PATH="$PATH:$out/bin"
|
2022-07-31 09:10:14 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-05 10:44:16 +00:00
|
|
|
pytestFlagsArray = [ "tests/unit" ];
|
2022-10-16 21:39:01 +00:00
|
|
|
|
2022-07-20 14:39:18 +00:00
|
|
|
disabledTests = [
|
2022-10-16 21:39:01 +00:00
|
|
|
# Fails because of dbfs CLI wrong call
|
2022-07-20 14:39:18 +00:00
|
|
|
"test_dbfs_unknown_user"
|
|
|
|
"test_dbfs_no_root"
|
2022-10-16 21:39:01 +00:00
|
|
|
# Requires pylint, prospector, pydocstyle
|
|
|
|
"test_python_basic_sanity_check"
|
|
|
|
];
|
|
|
|
|
2024-04-05 10:42:05 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/unit/api/"
|
|
|
|
"tests/unit/api/test_build.py"
|
|
|
|
"tests/unit/api/test_destroyer.py"
|
|
|
|
"tests/unit/api/test_jinja.py"
|
|
|
|
"tests/unit/commands/test_configure.py"
|
|
|
|
"tests/unit/commands/test_deploy_jinja_variables_file.py"
|
|
|
|
"tests/unit/commands/test_deploy.py"
|
|
|
|
"tests/unit/commands/test_destroy.py"
|
|
|
|
"tests/unit/commands/test_execute.py"
|
|
|
|
"tests/unit/commands/test_help.py"
|
|
|
|
"tests/unit/commands/test_launch.py"
|
|
|
|
"tests/unit/models/test_deployment.py"
|
|
|
|
"tests/unit/models/test_destroyer.py"
|
|
|
|
"tests/unit/models/test_task.py"
|
|
|
|
"tests/unit/sync/test_commands.py"
|
|
|
|
"tests/unit/utils/test_common.py"
|
|
|
|
];
|
|
|
|
|
2024-04-05 10:44:16 +00:00
|
|
|
pythonImportsCheck = [ "dbx" ];
|
2022-07-20 14:39:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "CLI tool for advanced Databricks jobs management";
|
2022-10-16 21:39:01 +00:00
|
|
|
homepage = "https://github.com/databrickslabs/dbx";
|
2023-02-27 09:12:58 +00:00
|
|
|
changelog = "https://github.com/databrickslabs/dbx/blob/v${version}/CHANGELOG.md";
|
2022-07-20 14:39:18 +00:00
|
|
|
license = licenses.databricks-dbx;
|
|
|
|
maintainers = with maintainers; [ GuillaumeDesforges ];
|
|
|
|
};
|
|
|
|
}
|