Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / databricks-sql-cli / default.nix
blobae118501f47de90e0953027fd0dd648b4161e4eb
1 { lib
2 , fetchFromGitHub
3 , fetchpatch
4 , python3
5 }:
7 python3.pkgs.buildPythonApplication rec {
8   pname = "databricks-sql-cli";
9   version = "0.1.4";
10   format = "pyproject";
12   src = fetchFromGitHub {
13     owner = "databricks";
14     repo = "databricks-sql-cli";
15     rev = "refs/tags/v${version}";
16     hash = "sha256-gr7LJfnvIu2Jf1XgILqfZoi8CbXeQyq0g1wLEBa5TPM=";
17   };
19   patches = [
20     # https://github.com/databricks/databricks-sql-cli/pull/38
21     (fetchpatch {
22       url = "https://github.com/databricks/databricks-sql-cli/commit/fc294e00819b6966f1605e5c1ce654473510aefe.patch";
23       sha256 = "sha256-QVrb7mD0fVbHrbrDywI6tsFNYM19x74LY8rhqqC8szE=";
24     })
25   ];
27   postPatch = ''
28     substituteInPlace pyproject.toml \
29       --replace 'python = ">=3.7.1,<4.0"' 'python = ">=3.8,<4.0"' \
30       --replace 'pandas = "1.3.4"' 'pandas = "~1.5"'
31   '';
33   nativeBuildInputs = with python3.pkgs; [
34     poetry-core
35   ];
37   propagatedBuildInputs = with python3.pkgs; [
38     cli-helpers
39     click
40     configobj
41     databricks-sql-connector
42     pandas
43     prompt-toolkit
44     pygments
45     sqlparse
46   ];
48   nativeCheckInputs = with python3.pkgs; [
49     pytestCheckHook
50   ];
52   meta = with lib; {
53     description = "CLI for querying Databricks SQL";
54     homepage = "https://github.com/databricks/databricks-sql-cli";
55     changelog = "https://github.com/databricks/databricks-sql-cli/releases/tag/v${version}";
56     license = licenses.databricks;
57     maintainers = with maintainers; [ kfollesdal ];
58   };