python3Packages.{valkey,limits}: fix broken tests on Darwin (#422850)

This commit is contained in:
Martin Weinelt 2025-07-06 13:37:49 +02:00 committed by GitHub
commit 0cb87f17f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 19 deletions

View File

@ -27,11 +27,9 @@
buildPythonPackage rec {
pname = "limits";
version = "5.2.0";
version = "5.4.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "alisaifee";
repo = "limits";
@ -39,10 +37,10 @@ buildPythonPackage rec {
# Upstream uses versioneer, which relies on git attributes substitution.
# This leads to non-reproducible archives on github. Remove the substituted
# file here, and recreate it later based on our version info.
hash = "sha256-EHLqkd5Muazr52/oYaLklFVvF+AzJWGbFaaIG+T0ulE=";
postFetch = ''
rm "$out/limits/_version.py"
'';
hash = "sha256-0D44XaSZtebMnn9mqXbaE7FB7usdu/eZ/4UE3Ye0oyA=";
};
patches = [
@ -102,15 +100,19 @@ buildPythonPackage rec {
pytestFlagsArray = [ "--benchmark-disable" ];
disabledTests = [ "test_moving_window_memcached" ];
disabledTests = [
"test_moving_window_memcached"
# Flaky: compares time to magic value
"test_sliding_window_counter_previous_window"
];
pythonImportsCheck = [ "limits" ];
meta = with lib; {
meta = {
description = "Rate limiting using various strategies and storage backends such as redis & memcached";
homepage = "https://github.com/alisaifee/limits";
changelog = "https://github.com/alisaifee/limits/releases/tag/${src.tag}";
license = licenses.mit;
maintainers = [ ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ sarahec ];
};
}

View File

@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
@ -32,8 +33,6 @@ buildPythonPackage rec {
version = "6.1.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "valkey-io";
repo = "valkey-py";
@ -78,19 +77,32 @@ buildPythonPackage rec {
pytestFlagsArray = [ "-m 'not onlycluster and not ssl'" ];
disabledTests = [
# valkey.sentinel.MasterNotFoundError: No master found for 'valkey-py-test'
"test_get_from_cache"
"test_cache_decode_response"
# Expects another valkey instance on port 6380 *shrug*
"test_psync"
disabledTests =
[
# valkey.sentinel.MasterNotFoundError: No master found for 'valkey-py-test'
"test_get_from_cache"
"test_cache_decode_response"
# Expects another valkey instance on port 6380 *shrug*
"test_psync"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# OSError: AF_UNIX path too long
"test_uds_connect"
"test_network_connection_failure"
];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# AttributeError: Can't get local object 'TestMultiprocessing.test_valkey_client.<locals>.target'
"tests/test_multiprocessing.py"
];
meta = with lib; {
__darwinAllowLocalNetworking = true;
meta = {
description = "Python client for Redis key-value store";
homepage = "https://github.com/valkey-io/valkey-py";
changelog = "https://github.com/valkey-io/valkey-py/releases/tag/${src.tag}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ hexa ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ hexa ];
};
}