2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "py-radix-sr";
|
|
|
|
version = "1.0.1";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SEKOIA-IO";
|
|
|
|
repo = "py-radix";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-aHV+NvPR4Gyk6bEpCftgBylis9rU7BWLpBMatjP4QmE=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "name='py-radix'" "name='py-radix-sr'"
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
substituteInPlace tests/test_{compat,regression}.py \
|
|
|
|
--replace-fail assertEquals assertEqual \
|
|
|
|
--replace-warn assertNotEquals assertNotEqual
|
2023-08-04 22:07:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "radix" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# test does not complete on 3.12+
|
|
|
|
"test_000_check_incref"
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python radix tree for IPv4 and IPv6 prefix matching";
|
|
|
|
homepage = "https://github.com/SEKOIA-IO/py-radix";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with licenses; [
|
|
|
|
isc
|
|
|
|
bsdOriginal
|
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = teams.wdz.members;
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|