2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
2023-04-29 16:46:19 +00:00
|
|
|
# required dependencies
|
2024-06-05 15:53:02 +00:00
|
|
|
requests,
|
|
|
|
setuptools,
|
2023-04-29 16:46:19 +00:00
|
|
|
# optional dependencies
|
2024-06-05 15:53:02 +00:00
|
|
|
pandas,
|
|
|
|
tornado,
|
|
|
|
sqlalchemy,
|
2023-04-29 16:46:19 +00:00
|
|
|
# test dependencies
|
2024-06-05 15:53:02 +00:00
|
|
|
pycurl,
|
|
|
|
pytestCheckHook,
|
2023-04-29 16:46:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pydruid";
|
|
|
|
version = "0.6.5";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = pname;
|
|
|
|
owner = "druid-io";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-9+xomjSwWDVHkret/mqAZKWOPFRMvVB3CWtFPzrT81k=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# patch out the CLI because it doesn't work with newer versions of pygments
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace '"console_scripts": ["pydruid = pydruid.console:main"],' ""
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ requests ];
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pycurl
|
2024-10-04 16:56:33 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues optional-dependencies);
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pydruid" ];
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
|
|
|
pandas = [ pandas ];
|
|
|
|
async = [ tornado ];
|
|
|
|
sqlalchemy = [ sqlalchemy ];
|
|
|
|
# druid has a `cli` extra, but it doesn't work with nixpkgs pygments
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple API to create, execute, and analyze Druid queries";
|
|
|
|
homepage = "https://github.com/druid-io/pydruid";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|