From e1016a44b53f20e43059a5997bdca11827488e4b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 19 May 2022 09:36:18 +0200 Subject: [PATCH] python310Packages.ttp: use ttp-templates from modules --- .../python-modules/ttp-templates/default.nix | 28 +++++------------ .../python-modules/ttp/default.nix | 20 ++++++------ .../python-modules/ttp/templates.nix | 31 ------------------- 3 files changed, 17 insertions(+), 62 deletions(-) delete mode 100644 pkgs/development/python-modules/ttp/templates.nix diff --git a/pkgs/development/python-modules/ttp-templates/default.nix b/pkgs/development/python-modules/ttp-templates/default.nix index 46db94782be5..45548ee21c2b 100644 --- a/pkgs/development/python-modules/ttp-templates/default.nix +++ b/pkgs/development/python-modules/ttp-templates/default.nix @@ -1,11 +1,7 @@ { lib , buildPythonPackage , fetchFromGitHub -, netmiko -, pytestCheckHook -, python , pythonOlder -, ttp }: buildPythonPackage rec { @@ -22,24 +18,14 @@ buildPythonPackage rec { hash = "sha256-Qx+z/srYgD67FjXzYrc8xtA99n8shWK7yWj/r/ETN2U="; }; - propagatedBuildInputs = [ - ttp - ]; + postPatch = '' + # Drop circular dependency on ttp + substituteInPlace setup.py \ + --replace '"ttp>=0.6.0"' "" + ''; - checkInputs = [ - netmiko - pytestCheckHook - ]; - - pythonImportsCheck = [ - "ttp_templates" - ]; - - pytestFlagsArray = [ - # The other tests requires data which is no part of the source - "test/test_ttp_templates_methods.py" - "test/test_yang_openconfig_lldp.py" - ]; + # Circular dependency on ttp + doCheck = false; meta = with lib; { description = "Template Text Parser Templates collections"; diff --git a/pkgs/development/python-modules/ttp/default.nix b/pkgs/development/python-modules/ttp/default.nix index 2157af318110..a484ed9f76ac 100644 --- a/pkgs/development/python-modules/ttp/default.nix +++ b/pkgs/development/python-modules/ttp/default.nix @@ -1,22 +1,20 @@ { lib , buildPythonPackage -, callPackage -, fetchFromGitHub , cerberus , configparser , deepdiff +, fetchFromGitHub , geoip2 , jinja2 +, netmiko , openpyxl -, tabulate -, yangson , pytestCheckHook , pyyaml +, tabulate +, ttp-templates +, yangson }: -let - ttp_templates = callPackage ./templates.nix { }; -in buildPythonPackage rec { pname = "ttp"; version = "0.8.4"; @@ -26,7 +24,7 @@ buildPythonPackage rec { owner = "dmulyalin"; repo = pname; rev = version; - sha256 = "sha256-vuKlddqm8KirqAJyvBPfRb5Nw9zo4Fl1bwbfVMhmH9g="; + hash = "sha256-vuKlddqm8KirqAJyvBPfRb5Nw9zo4Fl1bwbfVMhmH9g="; }; propagatedBuildInputs = [ @@ -37,7 +35,7 @@ buildPythonPackage rec { geoip2 jinja2 # n2g unpackaged - # netmiko unpackaged + netmiko # nornir unpackaged openpyxl tabulate @@ -51,7 +49,7 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook pyyaml - ttp_templates + ttp-templates ]; disabledTestPaths = [ @@ -87,6 +85,8 @@ buildPythonPackage rec { "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" ]; pytestFlagsArray = [ diff --git a/pkgs/development/python-modules/ttp/templates.nix b/pkgs/development/python-modules/ttp/templates.nix deleted file mode 100644 index 835548d07842..000000000000 --- a/pkgs/development/python-modules/ttp/templates.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ 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 ]; - }; -}