2022-09-05 13:26:30 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, thrift
|
|
|
|
, pandas
|
|
|
|
, pyarrow
|
|
|
|
, poetry-core
|
|
|
|
, pytestCheckHook
|
2023-01-26 12:51:57 +00:00
|
|
|
, pythonOlder
|
2022-09-05 13:26:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "databricks-sql-connector";
|
2022-12-30 19:13:04 +00:00
|
|
|
version = "2.2.1";
|
2022-09-05 13:26:30 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-01-26 12:51:57 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-09-05 13:26:30 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "databricks";
|
|
|
|
repo = "databricks-sql-python";
|
2022-12-30 19:13:04 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-01-26 12:51:57 +00:00
|
|
|
hash = "sha256-EMLUXGeVGIXFeaMvaJ+crivRZtOt7W/LCycIO2gwqXA=";
|
2022-09-05 13:26:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'thrift = "^0.13.0"' 'thrift = ">=0.13.0,<1.0.0"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
thrift
|
|
|
|
pandas
|
|
|
|
pyarrow
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-05 13:26:30 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-01-26 12:51:57 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests/unit"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"databricks"
|
|
|
|
];
|
2022-09-05 13:26:30 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Databricks SQL Connector for Python";
|
2022-09-27 12:27:48 +00:00
|
|
|
homepage = "https://docs.databricks.com/dev-tools/python-sql-connector.html";
|
2023-01-26 12:51:57 +00:00
|
|
|
changelog = "https://github.com/databricks/databricks-sql-python/blob/v${version}/CHANGELOG.md";
|
2022-09-05 13:26:30 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ harvidsen ];
|
|
|
|
};
|
|
|
|
}
|