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