push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
# build-system
setuptools,
# dependencies
certifi,
python-dateutil,
requests,
six,
urllib3,
events,
# optional-dependencies
aiohttp,
# tests
botocore,
mock,
pytest-asyncio,
pytest-mock,
pytestCheckHook,
pyyaml,
pytz,
}:
buildPythonPackage rec {
pname = "opensearch-py";
version = "3.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "opensearch-project";
repo = "opensearch-py";
tag = "v${version}";
hash = "sha256-IAEh+rB26Zqv7j5g2YIRZRCAtFbBngoh+w8Z4e2bY+M=";
};
patches = [
# Remove delete event_loop fixture to fix test with pytest-asyncio 1.x
# reference: https://github.com/opensearch-project/opensearch-py/pull/936
./remove-delete-event-loop-fixture.patch
];
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
certifi
python-dateutil
requests
six
urllib3
events
];
optional-dependencies.async = [ aiohttp ];
nativeCheckInputs = [
botocore
mock
pytest-asyncio
pytest-mock
pytestCheckHook
pyyaml
pytz
]
++ optional-dependencies.async;
__darwinAllowLocalNetworking = true;
disabledTestPaths = [
# require network
"test_opensearchpy/test_async/test_connection.py"
"test_opensearchpy/test_async/test_server"
"test_opensearchpy/test_server"
"test_opensearchpy/test_server_secured"
];
disabledTests = [
# finds our ca-bundle, but expects something else (/path/to/clientcert/dir or None)
"test_ca_certs_ssl_cert_dir"
"test_no_ca_certs"
# Failing tests, issue opened at https://github.com/opensearch-project/opensearch-py/issues/849
"test_basicauth_in_request_session"
"test_callable_in_request_session"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Flaky tests: OSError: [Errno 48] Address already in use
"test_redirect_failure_when_allow_redirect_false"
"test_redirect_success_when_allow_redirect_true"
];
meta = {
description = "Python low-level client for OpenSearch";
homepage = "https://github.com/opensearch-project/opensearch-py";
changelog = "https://github.com/opensearch-project/opensearch-py/releases/tag/${src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ mcwitt ];
};
}

View File

@@ -0,0 +1,62 @@
From 2f9eeaad3f7bd38518b23a59659ccf02fff19577 Mon Sep 17 00:00:00 2001
From: florian <florian@harfanglab.fr>
Date: Thu, 28 Aug 2025 09:57:14 +0200
Subject: [PATCH] fix: remove delete event_loop fixture
Signed-off-by: florian <florian@harfanglab.fr>
---
.../test_async/test_transport.py | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/test_opensearchpy/test_async/test_transport.py b/test_opensearchpy/test_async/test_transport.py
index 51388dddb..34ae41b4e 100644
--- a/test_opensearchpy/test_async/test_transport.py
+++ b/test_opensearchpy/test_async/test_transport.py
@@ -439,7 +439,9 @@ async def test_sniff_on_fail_failing_does_not_prevent_retires(
assert 1 == len(conn_err.calls)
assert 1 == len(conn_data.calls)
- async def test_sniff_after_n_seconds(self, event_loop: Any) -> None:
+ async def test_sniff_after_n_seconds(self) -> None:
+ event_loop = asyncio.get_event_loop()
+
t: Any = AsyncTransport(
[{"data": CLUSTER_NODES}],
connection_class=DummyConnection,
@@ -493,9 +495,7 @@ async def test_transport_close_closes_all_pool_connections(self) -> None:
await t2.close()
assert all([conn.closed for conn in t2.connection_pool.connections])
- async def test_sniff_on_start_error_if_no_sniffed_hosts(
- self, event_loop: Any
- ) -> None:
+ async def test_sniff_on_start_error_if_no_sniffed_hosts(self) -> None:
t: Any = AsyncTransport(
[
{"data": ""},
@@ -512,9 +512,9 @@ async def test_sniff_on_start_error_if_no_sniffed_hosts(
await t._async_call()
assert str(e.value) == "TransportError(N/A, 'Unable to sniff hosts.')"
- async def test_sniff_on_start_waits_for_sniff_to_complete(
- self, event_loop: Any
- ) -> None:
+ async def test_sniff_on_start_waits_for_sniff_to_complete(self) -> None:
+ event_loop = asyncio.get_event_loop()
+
t: Any = AsyncTransport(
[
{"delay": 1, "data": ""},
@@ -550,9 +550,9 @@ async def test_sniff_on_start_waits_for_sniff_to_complete(
# and then resolved immediately after.
assert 1 <= duration < 2
- async def test_sniff_on_start_close_unlocks_async_calls(
- self, event_loop: Any
- ) -> None:
+ async def test_sniff_on_start_close_unlocks_async_calls(self) -> None:
+ event_loop = asyncio.get_event_loop()
+
t: Any = AsyncTransport(
[
{"delay": 10, "data": CLUSTER_NODES},