diff --git a/pkgs/development/python-modules/elasticsearch/default.nix b/pkgs/development/python-modules/elasticsearch/default.nix index bca2a363f3c4..f2e5a4b599a6 100644 --- a/pkgs/development/python-modules/elasticsearch/default.nix +++ b/pkgs/development/python-modules/elasticsearch/default.nix @@ -1,15 +1,20 @@ -{ buildPythonPackage +{ lib +, aiohttp +, buildPythonPackage +, certifi +, elastic-transport , fetchPypi -, setuptools -, urllib3, requests -, nosexcover, mock -, lib +, pythonOlder +, requests +, urllib3 }: -buildPythonPackage (rec { +buildPythonPackage rec { pname = "elasticsearch"; version = "8.11.0"; - pyproject = true; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; @@ -17,14 +22,30 @@ buildPythonPackage (rec { }; nativeBuildInputs = [ - setuptools + elastic-transport + ]; + + propagatedBuildInputs = [ + urllib3 + certifi + ]; + + passthru.optional-dependencies = { + requests = [ + requests + ]; + async = [ + aiohttp + ]; + }; + + pythonImportsCheck = [ + "elasticsearch" ]; # Check is disabled because running them destroy the content of the local cluster! # https://github.com/elasticsearch/elasticsearch-py/tree/master/test_elasticsearch doCheck = false; - propagatedBuildInputs = [ urllib3 requests ]; - buildInputs = [ nosexcover mock ]; meta = with lib; { description = "Official low-level client for Elasticsearch"; @@ -33,4 +54,4 @@ buildPythonPackage (rec { license = licenses.asl20; maintainers = with maintainers; [ desiderius ]; }; -}) +}