1{ lib
2, buildPythonPackage
3, callPackage
4, fetchFromGitHub
5, cerberus
6, configparser
7, deepdiff
8, geoip2
9, jinja2
10, openpyxl
11, tabulate
12, yangson
13, pytestCheckHook
14, pyyaml
15}:
16
17let
18 ttp_templates = callPackage ./templates.nix { };
19in
20buildPythonPackage rec {
21 pname = "ttp";
22 version = "0.7.2";
23 format = "setuptools";
24
25 src = fetchFromGitHub {
26 owner = "dmulyalin";
27 repo = pname;
28 rev = version;
29 sha256 = "sha256-dYjE+EMfCVHLRAqT1KM7o8VEopJ/TwAEMphYXuj38Wk=";
30 };
31
32 propagatedBuildInputs = [
33 # https://github.com/dmulyalin/ttp/blob/master/docs/source/Installation.rst#additional-dependencies
34 cerberus
35 configparser
36 deepdiff
37 geoip2
38 jinja2
39 # n2g unpackaged
40 # netmiko unpackaged
41 # nornir unpackaged
42 openpyxl
43 tabulate
44 yangson
45 ];
46
47 pythonImportsCheck = [
48 "ttp"
49 ];
50
51 checkInputs = [
52 pytestCheckHook
53 pyyaml
54 ttp_templates
55 ];
56
57 disabledTestPaths = [
58 # missing package n2g
59 "test/pytest/test_N2G_formatter.py"
60 ];
61
62 disabledTests = [
63 # data structure mismatches
64 "test_yangson_validate"
65 "test_yangson_validate_yang_lib_in_output_tag_data"
66 "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file"
67 "test_yangson_validate_multiple_inputs_mode_per_template"
68 "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file_to_xml"
69 "test_yangson_validate_multiple_inputs_mode_per_template_to_xml"
70 "test_adding_data_from_files"
71 "test_lookup_include_csv"
72 "test_inputs_with_template_base_path"
73 "test_group_inputs"
74 "test_inputs_url_filters_extensions"
75 # ValueError: dictionary update sequence element #0 has length 1; 2 is required
76 "test_include_attribute_with_yaml_loader"
77 # TypeError: string indices must be integers
78 "test_lookup_include_yaml"
79 # Missing .xslx files *shrug*
80 "test_excel_formatter_update"
81 "test_excel_formatter_update_using_result_kwargs"
82 # missing package n2g
83 "test_n2g_formatter"
84 ];
85
86 pytestFlagsArray = [
87 "test/pytest"
88 ];
89
90 meta = with lib; {
91 description = "Template Text Parser";
92 homepage = "https://github.com/dmulyalin/ttp";
93 license = licenses.mit;
94 maintainers = with maintainers; [ hexa ];
95 };
96}