1{
2 lib,
3 buildPythonPackage,
4 cerberus,
5 configparser,
6 deepdiff,
7 fetchFromGitHub,
8 geoip2,
9 jinja2,
10 netmiko,
11 openpyxl,
12 pytestCheckHook,
13 poetry-core,
14 pyyaml,
15 tabulate,
16 ttp-templates,
17 yangson,
18}:
19
20buildPythonPackage rec {
21 pname = "ttp";
22 version = "0.9.5";
23 format = "pyproject";
24
25 src = fetchFromGitHub {
26 owner = "dmulyalin";
27 repo = pname;
28 rev = "refs/tags/${version}";
29 hash = "sha256-IWqPFspERBVkjsTYTAkOTOrugq4fD65Q140G3SCEV0w=";
30 };
31
32 nativeBuildInputs = [ poetry-core ];
33
34 propagatedBuildInputs = [
35 # https://github.com/dmulyalin/ttp/blob/master/docs/source/Installation.rst#additional-dependencies
36 cerberus
37 configparser
38 deepdiff
39 geoip2
40 jinja2
41 # n2g unpackaged
42 netmiko
43 # nornir unpackaged
44 openpyxl
45 tabulate
46 yangson
47 ];
48
49 pythonImportsCheck = [ "ttp" ];
50
51 nativeCheckInputs = [
52 pytestCheckHook
53 pyyaml
54 ttp-templates
55 ];
56
57 disabledTestPaths = [
58 # missing package n2g
59 "test/pytest/test_N2G_formatter.py"
60 # missing test file
61 "test/pytest/test_extend_tag.py"
62 "test/pytest/test_ttp_parser_methods.py"
63 ];
64
65 disabledTests = [
66 # data structure mismatches
67 "test_yangson_validate"
68 "test_yangson_validate_yang_lib_in_output_tag_data"
69 "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file"
70 "test_yangson_validate_multiple_inputs_mode_per_template"
71 "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file_to_xml"
72 "test_yangson_validate_multiple_inputs_mode_per_template_to_xml"
73 "test_adding_data_from_files"
74 "test_lookup_include_csv"
75 "test_inputs_with_template_base_path"
76 "test_group_inputs"
77 "test_inputs_url_filters_extensions"
78 # ValueError: dictionary update sequence element #0 has length 1; 2 is required
79 "test_include_attribute_with_yaml_loader"
80 # TypeError: string indices must be integers
81 "test_lookup_include_yaml"
82 # Missing .xslx files *shrug*
83 "test_excel_formatter_update"
84 "test_excel_formatter_update_using_result_kwargs"
85 # missing package n2g
86 "test_n2g_formatter"
87 # missing test files
88 "test_TTP_CACHE_FOLDER_env_variable_usage"
89 # requires additional network setup
90 "test_child_group_do_not_start_if_no_parent_started"
91 # Assertion Error
92 "test_in_threads_parsing"
93 # missing env var
94 "test_ttp_templates_dir_env_variable"
95 ];
96
97 pytestFlagsArray = [ "test/pytest" ];
98
99 meta = with lib; {
100 changelog = "https://github.com/dmulyalin/ttp/releases/tag/${version}";
101 description = "Template Text Parser";
102 mainProgram = "ttp";
103 homepage = "https://github.com/dmulyalin/ttp";
104 license = licenses.mit;
105 maintainers = with maintainers; [ ];
106 };
107}