From 3c9cf0d0b621d30eefd4c6b62c7458852b705046 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 04:17:10 +0200 Subject: [PATCH] python3Packages.ttp: init at 0.6.0 --- .../python-modules/ttp/default.nix | 93 +++++++++++++++++++ .../python-modules/ttp/templates.nix | 31 +++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 126 insertions(+) create mode 100644 pkgs/development/python-modules/ttp/default.nix create mode 100644 pkgs/development/python-modules/ttp/templates.nix diff --git a/pkgs/development/python-modules/ttp/default.nix b/pkgs/development/python-modules/ttp/default.nix new file mode 100644 index 000000000000..1ebad5322005 --- /dev/null +++ b/pkgs/development/python-modules/ttp/default.nix @@ -0,0 +1,93 @@ +{ lib +, buildPythonPackage +, callPackage +, fetchFromGitHub +, cerberus +, configparser +, deepdiff +, geoip2 +, jinja2 +, openpyxl +, tabulate +, yangson +, pytestCheckHook +, pyyaml +}: + +let + ttp_templates = callPackage ./templates.nix { }; +in +buildPythonPackage rec { + pname = "ttp"; + version = "0.6.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "dmulyalin"; + repo = pname; + rev = version; + sha256 = "08pglwmnhdrsj9rgys1zclhq1h597izb0jq7waahpdabfg25v2sw"; + }; + + propagatedBuildInputs = [ + # https://github.com/dmulyalin/ttp/blob/master/docs/source/Installation.rst#additional-dependencies + cerberus + configparser + deepdiff + geoip2 + jinja2 + # n2g unpackaged + # netmiko unpackaged + # nornir unpackaged + openpyxl + tabulate + yangson + ]; + + pythonImportsCheck = [ + "ttp" + ]; + + checkInputs = [ + pytestCheckHook + pyyaml + ttp_templates + ]; + + disabledTestPaths = [ + # missing package n2g + "test/pytest/test_N2G_formatter.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 package n2g + "test_n2g_formatter" + ]; + + pytestFlagsArray = [ + "test/pytest" + ]; + + meta = with lib; { + description = "Template Text Parser"; + homepage = "https://github.com/dmulyalin/ttp"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/development/python-modules/ttp/templates.nix b/pkgs/development/python-modules/ttp/templates.nix new file mode 100644 index 000000000000..835548d07842 --- /dev/null +++ b/pkgs/development/python-modules/ttp/templates.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "ttp-templates"; + version = "0.1.1"; + format = "setuptools"; + + src = fetchPypi { + pname = "ttp_templates"; + inherit version; + sha256 = "0vg7k733i8jqnfz8mpq8kzr2l7b7drk29zkzik91029f6w7li007"; + }; + + # drop circular dependency on ttp + postPatch = '' + substituteInPlace setup.py --replace '"ttp>=0.6.0"' "" + ''; + + # circular dependency on ttp + doCheck = false; + + meta = with lib; { + description = "Template Text Parser Templates"; + homepage = "https://github.com/dmulyalin/ttp_templates"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9c010a43ce35..af8bb8e06ba6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8273,6 +8273,8 @@ in { trytond = callPackage ../development/python-modules/trytond { }; + ttp = callPackage ../development/python-modules/ttp { }; + tunigo = callPackage ../development/python-modules/tunigo { }; tubeup = callPackage ../development/python-modules/tubeup { };