Files
nixpkgs/pkgs/development/python-modules/librouteros/default.nix
2026-08-28 00:44:39 +02:00

61 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
hypothesis,
pytest-asyncio,
pytest-xdist,
pytestCheckHook,
uv-build,
stamina,
toml,
}:
buildPythonPackage (finalAttrs: {
pname = "librouteros";
version = "4.2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "luqasz";
repo = "librouteros";
tag = finalAttrs.version;
hash = "sha256-Xn/mXNfgC41MR12PpYgDwMfHyn9iyKt4tSbEWI340Dc=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "uv_build>=0.8.18,<0.12.0" "uv_build"
'';
build-system = [ uv-build ];
dependencies = [ toml ];
nativeCheckInputs = [
hypothesis
pytest-asyncio
pytest-xdist
pytestCheckHook
stamina
];
disabledTestPaths = [
# Disable tests which require QEMU to run
"tests/integration/test_config.py"
"tests/integration/test_general.py"
"tests/integration/test_generator.py"
"tests/integration/test_path.py"
];
pythonImportsCheck = [ "librouteros" ];
meta = {
description = "Python implementation of the MikroTik RouterOS API";
homepage = "https://librouteros.readthedocs.io/";
changelog = "https://github.com/luqasz/librouteros/blob/${finalAttrs.version}/CHANGELOG.rst";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ fab ];
};
})