1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytest-xdist,
6 pytest7CheckHook,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "librouteros";
13 version = "3.2.1";
14 pyproject = true;
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "luqasz";
20 repo = "librouteros";
21 rev = "refs/tags/${version}";
22 hash = "sha256-VwpZ1RY6Sul7xvWY7ZoOxZ7KgbRmKRwcVdF9e2b3f6Q=";
23 };
24
25 nativeBuildInputs = [ setuptools ];
26
27 nativeCheckInputs = [
28 pytest-xdist
29 pytest7CheckHook
30 ];
31
32 disabledTests = [
33 # Disable tests which require QEMU to run
34 "test_login"
35 "test_long_word"
36 "test_query"
37 "test_add_then_remove"
38 "test_add_then_update"
39 "test_generator_ditch"
40 # AttributeError: 'called_once_with' is not a valid assertion
41 "test_rawCmd_calls_writeSentence"
42 ];
43
44 pythonImportsCheck = [ "librouteros" ];
45
46 meta = with lib; {
47 description = "Python implementation of the MikroTik RouterOS API";
48 homepage = "https://librouteros.readthedocs.io/";
49 changelog = "https://github.com/luqasz/librouteros/blob/${version}/CHANGELOG.rst";
50 license = with licenses; [ gpl2Only ];
51 maintainers = with maintainers; [ fab ];
52 };
53}