From 7f94c15581c890e87527d18534c68315ca20c9e3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 29 Apr 2023 17:14:18 +0200 Subject: [PATCH 1/4] python310Packages.elasticsearch: add changelog to meta --- pkgs/development/python-modules/elasticsearch/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/elasticsearch/default.nix b/pkgs/development/python-modules/elasticsearch/default.nix index 33e91ebc22c1..b8c25ce5ac31 100644 --- a/pkgs/development/python-modules/elasticsearch/default.nix +++ b/pkgs/development/python-modules/elasticsearch/default.nix @@ -23,6 +23,7 @@ buildPythonPackage (rec { meta = with lib; { description = "Official low-level client for Elasticsearch"; homepage = "https://github.com/elasticsearch/elasticsearch-py"; + changelog = "https://github.com/elastic/elasticsearch-py/releases/tag/v${version}"; license = licenses.asl20; maintainers = with maintainers; [ desiderius ]; }; From 5b0c59780758474d900d6a01619386b16dda61de Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 29 Apr 2023 19:43:55 +0200 Subject: [PATCH 2/4] python310Packages.elastic-transport: init at 8.4.0 --- .../elastic-transport/default.nix | 72 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 74 insertions(+) create mode 100644 pkgs/development/python-modules/elastic-transport/default.nix diff --git a/pkgs/development/python-modules/elastic-transport/default.nix b/pkgs/development/python-modules/elastic-transport/default.nix new file mode 100644 index 000000000000..0c0ba62ce3a2 --- /dev/null +++ b/pkgs/development/python-modules/elastic-transport/default.nix @@ -0,0 +1,72 @@ +{ lib +, aiohttp +, buildPythonPackage +, certifi +, fetchFromGitHub +, mock +, pytest-asyncio +, pytest-httpserver +, pytestCheckHook +, pythonOlder +, requests +, trustme +, urllib3 +}: + +buildPythonPackage rec { + pname = "elastic-transport"; + version = "8.4.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "elastic"; + repo = "elastic-transport-python"; + rev = "refs/tags/v${version}"; + hash = "sha256-rZdl2gjY5Yg2Ls777tj12pPATMn//xVvEM4wkrZ3qUY="; + }; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace " --cov-report=term-missing --cov=elastic_transport" "" + ''; + + propagatedBuildInputs = [ + urllib3 + certifi + ]; + + nativeCheckInputs = [ + aiohttp + mock + pytest-asyncio + pytest-httpserver + pytestCheckHook + requests + trustme + ]; + + pythonImportsCheck = [ + "elastic_transport" + ]; + + disabledTests = [ + # Tests require network access + "fingerprint" + "ssl" + "test_custom_headers" + "test_custom_user_agent" + "test_default_headers" + "test_head" + "tls" + ]; + + meta = with lib; { + description = "Transport classes and utilities shared among Python Elastic client libraries"; + homepage = "https://github.com/elasticsearch/elastic-transport-python"; + changelog = "https://github.com/elastic/elastic-transport-python/releases/tag/v${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3911f78be3f3..548035762094 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3046,6 +3046,8 @@ self: super: with self; { elastic-apm = callPackage ../development/python-modules/elastic-apm { }; + elastic-transport = callPackage ../development/python-modules/elastic-transport { }; + elasticsearch = callPackage ../development/python-modules/elasticsearch { }; elasticsearch-dsl = callPackage ../development/python-modules/elasticsearch-dsl { }; From c135b649f6b59c4c4b435b9b8636c92b7905f40a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 29 Apr 2023 23:31:33 +0200 Subject: [PATCH 3/4] python310Packages.elastisearch8: init at 8.7.0 --- .../python-modules/elasticsearch8/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/elasticsearch8/default.nix diff --git a/pkgs/development/python-modules/elasticsearch8/default.nix b/pkgs/development/python-modules/elasticsearch8/default.nix new file mode 100644 index 000000000000..ead2f6b07ee6 --- /dev/null +++ b/pkgs/development/python-modules/elasticsearch8/default.nix @@ -0,0 +1,52 @@ +{ lib +, aiohttp +, buildPythonPackage +, elastic-transport +, fetchPypi +, pythonOlder +, requests +, urllib3 +}: + +buildPythonPackage rec { + pname = "elasticsearch8"; + version = "8.7.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-mRy48OYsm+0M1/D+abs83RiqN8wQr/Z6SZUY4TNg190="; + }; + + nativeBuildInputs = [ + elastic-transport + ]; + + propagatedBuildInputs = [ + requests + ]; + + passthru.optional-dependencies = { + async = [ + aiohttp + ]; + }; + + # Check is disabled because running them destroy the content of the local cluster! + # https://github.com/elasticsearch/elasticsearch-py/tree/main/test_elasticsearch + doCheck = false; + + pythonImportsCheck = [ + "elasticsearch8" + ]; + + meta = with lib; { + description = "Official low-level client for Elasticsearch"; + homepage = "https://github.com/elasticsearch/elasticsearch-py"; + changelog = "https://github.com/elastic/elasticsearch-py/releases/tag/v${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 548035762094..240d3c98d48e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3050,6 +3050,8 @@ self: super: with self; { elasticsearch = callPackage ../development/python-modules/elasticsearch { }; + elasticsearch8 = callPackage ../development/python-modules/elasticsearch8 { }; + elasticsearch-dsl = callPackage ../development/python-modules/elasticsearch-dsl { }; elasticsearchdsl = self.elasticsearch-dsl; From 5ac17eba79230342b03e4c4868551dcf1f0bd3d3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 29 Apr 2023 23:42:23 +0200 Subject: [PATCH 4/4] python310Packages.es-client: init at 8.7.0 --- .../python-modules/es-client/default.nix | 74 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/es-client/default.nix diff --git a/pkgs/development/python-modules/es-client/default.nix b/pkgs/development/python-modules/es-client/default.nix new file mode 100644 index 000000000000..5e43edc6da6b --- /dev/null +++ b/pkgs/development/python-modules/es-client/default.nix @@ -0,0 +1,74 @@ +{ lib +, buildPythonPackage +, certifi +, click +, elastic-transport +, elasticsearch8 +, fetchFromGitHub +, hatchling +, mock +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, pyyaml +, requests +, six +, voluptuous +}: + +buildPythonPackage rec { + pname = "es-client"; + version = "8.7.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "untergeek"; + repo = "es_client"; + rev = "refs/tags/v${version}"; + hash = "sha256-DJIo0yFJGR9gw5UJnmgnBFZx0uXUEW3rWT49jhfnXkQ="; + }; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + certifi + click + elastic-transport + elasticsearch8 + pyyaml + six + voluptuous + ]; + + nativeCheckInputs = [ + mock + pytest-asyncio + pytestCheckHook + requests + ]; + + pythonImportsCheck = [ + "es_client" + ]; + + disabledTests = [ + # Tests require network access + "test_bad_version_raises" + "test_client_info" + "test_multiple_hosts_raises" + "test_non_dict_passed" + "test_skip_version_check" + ]; + + meta = with lib; { + description = "Module for building Elasticsearch client objects"; + homepage = "https://github.com/untergeek/es_client"; + changelog = "https://github.com/untergeek/es_client/releases/tag/v${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 240d3c98d48e..445867a11a49 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3156,6 +3156,8 @@ self: super: with self; { eradicate = callPackage ../development/python-modules/eradicate { }; + es-client = callPackage ../development/python-modules/es-client { }; + espeak-phonemizer = callPackage ../development/python-modules/espeak-phonemizer { }; esphome-dashboard-api = callPackage ../development/python-modules/esphome-dashboard-api { };