about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/ttp/default.nix
blob: 3df86d13cf3a07684c0b0a639d0052aa55c9b683 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{ lib
, buildPythonPackage
, cerberus
, configparser
, deepdiff
, fetchFromGitHub
, geoip2
, jinja2
, netmiko
, openpyxl
, pytestCheckHook
, poetry-core
, pyyaml
, tabulate
, ttp-templates
, yangson
}:

buildPythonPackage rec {
  pname = "ttp";
  version = "0.9.5";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "dmulyalin";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-IWqPFspERBVkjsTYTAkOTOrugq4fD65Q140G3SCEV0w=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    # https://github.com/dmulyalin/ttp/blob/master/docs/source/Installation.rst#additional-dependencies
    cerberus
    configparser
    deepdiff
    geoip2
    jinja2
    # n2g unpackaged
    netmiko
    # nornir unpackaged
    openpyxl
    tabulate
    yangson
  ];

  pythonImportsCheck = [
    "ttp"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pyyaml
    ttp-templates
  ];

  disabledTestPaths = [
    # missing package n2g
    "test/pytest/test_N2G_formatter.py"
    # missing test file
    "test/pytest/test_extend_tag.py"
    "test/pytest/test_ttp_parser_methods.py"
  ];

  disabledTests = [
    # data structure mismatches
    "test_yangson_validate"
    "test_yangson_validate_yang_lib_in_output_tag_data"
    "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file"
    "test_yangson_validate_multiple_inputs_mode_per_template"
    "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file_to_xml"
    "test_yangson_validate_multiple_inputs_mode_per_template_to_xml"
    "test_adding_data_from_files"
    "test_lookup_include_csv"
    "test_inputs_with_template_base_path"
    "test_group_inputs"
    "test_inputs_url_filters_extensions"
    # ValueError: dictionary update sequence element #0 has length 1; 2 is required
    "test_include_attribute_with_yaml_loader"
    # TypeError: string indices must be integers
    "test_lookup_include_yaml"
    # Missing .xslx files *shrug*
    "test_excel_formatter_update"
    "test_excel_formatter_update_using_result_kwargs"
    # missing package n2g
    "test_n2g_formatter"
    # missing test files
    "test_TTP_CACHE_FOLDER_env_variable_usage"
    # requires additional network setup
    "test_child_group_do_not_start_if_no_parent_started"
    # Assertion Error
    "test_in_threads_parsing"
    # missing env var
    "test_ttp_templates_dir_env_variable"
  ];

  pytestFlagsArray = [
    "test/pytest"
  ];

  meta = with lib; {
    changelog = "https://github.com/dmulyalin/ttp/releases/tag/${version}";
    description = "Template Text Parser";
    mainProgram = "ttp";
    homepage = "https://github.com/dmulyalin/ttp";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}