Merge pull request #226256 from cpcloud/nixpkgs-pydruid

python3Packages.pydruid: init at 0.6.5
This commit is contained in:
Martin Weinelt 2023-04-17 17:06:58 +02:00 committed by GitHub
commit c9fde5c86e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,68 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
# required dependencies
, requests
, setuptools
# optional dependencies
, pandas
, tornado
, sqlalchemy
# test dependencies
, pycurl
, pytestCheckHook
}:
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"],' ""
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
requests
];
nativeCheckInputs = [
pytestCheckHook
pycurl
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
pythonImportsCheck = [
"pydruid"
];
passthru = {
optional-dependencies = {
pandas = [ pandas ];
async = [ tornado ];
sqlalchemy = [ sqlalchemy ];
# druid has a `cli` extra, but it doesn't work with nixpkgs pygments
};
};
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 ];
};
}

View file

@ -8200,6 +8200,8 @@ self: super: with self; {
pydroid-ipcam = callPackage ../development/python-modules/pydroid-ipcam { };
pydruid = callPackage ../development/python-modules/pydruid { };
pydsdl = callPackage ../development/python-modules/pydsdl { };
pydub = callPackage ../development/python-modules/pydub { };