Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonApplication
3, fetchFromGitHub
4, fetchpatch
5, poetry-core
6, pandas
7, prompt-toolkit
8, databricks-sql-connector
9, pygments
10, configobj
11, sqlparse
12, cli-helpers
13, click
14, pytestCheckHook
15}:
16
17buildPythonApplication rec {
18 pname = "databricks-sql-cli";
19 version = "0.1.4";
20 format = "pyproject";
21
22 src = fetchFromGitHub {
23 owner = "databricks";
24 repo = "databricks-sql-cli";
25 rev = "v${version}";
26 sha256 = "sha256-gr7LJfnvIu2Jf1XgILqfZoi8CbXeQyq0g1wLEBa5TPM=";
27 };
28
29 patches = [
30 # https://github.com/databricks/databricks-sql-cli/pull/38
31 (fetchpatch {
32 url = "https://github.com/databricks/databricks-sql-cli/commit/fc294e00819b6966f1605e5c1ce654473510aefe.patch";
33 sha256 = "sha256-QVrb7mD0fVbHrbrDywI6tsFNYM19x74LY8rhqqC8szE=";
34 })
35 ];
36
37 postPatch = ''
38 substituteInPlace pyproject.toml \
39 --replace 'python = ">=3.7.1,<4.0"' 'python = ">=3.8,<4.0"' \
40 --replace 'pandas = "1.3.4"' 'pandas = "~1.4"'
41 '';
42
43 nativeBuildInputs = [ poetry-core ];
44
45 propagatedBuildInputs = [
46 prompt-toolkit
47 pandas
48 databricks-sql-connector
49 pygments
50 configobj
51 sqlparse
52 cli-helpers
53 click
54 ];
55
56 checkInputs = [ pytestCheckHook ];
57
58 meta = with lib; {
59 description = "CLI for querying Databricks SQL";
60 homepage = "https://github.com/databricks/databricks-sql-cli";
61 license = licenses.databricks;
62 maintainers = with maintainers; [ kfollesdal ];
63 };
64}