python310Packages.ttp: use ttp-templates from modules

This commit is contained in:
Fabian Affolter 2022-05-19 09:36:18 +02:00
parent 728b20db85
commit e1016a44b5
3 changed files with 17 additions and 62 deletions

View File

@ -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";

View File

@ -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 = [

View File

@ -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 ];
};
}