2020-06-05 10:20:31 +00:00
#
# spec file for package python-ntc-templates
#
2025-01-10 05:29:03 +00:00
# Copyright (c) 2025 SUSE LLC
2020-06-05 10:20:31 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
2025-04-14 07:54:06 +00:00
%{?sle15_python_module_pythons}
2020-06-05 10:20:31 +00:00
Name : python-ntc-templates
2025-03-20 21:08:34 +00:00
Version : 7.8.0
2020-06-05 10:20:31 +00:00
Release : 0
Summary : Package to return structured data from the output of network devices
License : Apache-2.0
URL : https://github.com/networktocode/ntc-templates
2024-10-23 20:20:42 +00:00
Source : https://github.com/networktocode/ntc-templates/archive/v%{version} .tar.gz#/ntc-templates-%{version}.tar.gz
2021-08-20 14:35:50 +00:00
BuildRequires : %{python_module pip}
BuildRequires : %{python_module poetry-core}
2020-06-05 10:20:31 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
Requires : python-textfsm >= 1.1.0
Suggests : python-PyYAML
Suggests : python-black
Suggests : python-pytest
Suggests : python-ruamel.yaml
Suggests : python-yamllint
BuildArch : noarch
# SECTION test requirements
2024-10-23 20:20:42 +00:00
BuildRequires : %{python_module invoke}
2025-04-14 07:54:06 +00:00
BuildRequires : %{python_module PyYAML}
2021-10-13 12:19:36 +00:00
BuildRequires : %{python_module pytest >= 4.0.0}
2020-06-05 10:20:31 +00:00
BuildRequires : %{python_module ruamel.yaml}
2020-06-12 12:16:34 +00:00
BuildRequires : %{python_module textfsm >= 1.1.0}
2024-10-23 20:20:42 +00:00
BuildRequires : %{python_module toml}
2020-06-05 10:20:31 +00:00
# /SECTION
%python_subpackages
%description
2021-10-13 12:19:36 +00:00
TextFSM is a project built by Google that takes CLI string output and passes each line through a series of regular expressions until it finds a match. The regular expressions use named capture groups to build a text table out of the significant text. The names of the capture groups are used as column headers, and the captured values are stored as rows in the table.
2020-06-05 10:20:31 +00:00
%prep
%setup -q -n ntc-templates-%{version}
2021-10-13 12:19:36 +00:00
# rpmlintrc
chmod -x ntc_templates/templates/cisco*
2025-01-10 05:29:03 +00:00
# Correct version -- https://github.com/networktocode/ntc-templates/issues/1969
sed -i 's/6.0.0/%{version}/' pyproject.toml
2020-06-05 10:20:31 +00:00
%build
2021-08-20 14:35:50 +00:00
%pyproject_wheel
2020-06-05 10:20:31 +00:00
%install
2021-08-20 14:35:50 +00:00
%pyproject_install
2020-06-05 10:20:31 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
%check
2021-08-20 14:35:50 +00:00
# https://github.com/networktocode/ntc-templates/issues/743 (closed but still an open issue)
# -> skip tests: arista_eos_show_ip_access-lists, cisco_ios_show_access-list, cisco_nxos_show_ip_bgp_neighbors, cisco_nxos_show_ip_bgp_neighbors_with_policy_names
# https://github.com/networktocode/ntc-templates/issues/958
# -> skip tests: cisco_nxos_show_environment, cisco_nxos_show_environment2
%pytest -k 'not (arista_eos_show_ip_access-lists or cisco_ios_show_access-list or cisco_nxos_show_ip_bgp_neighbors or cisco_nxos_show_environment or cisco_nxos_show_environment2 or cisco_nxos_show_ip_bgp_neighbors_with_policy_names)'
2020-06-05 10:20:31 +00:00
%files %{python_files}
2020-06-12 12:16:34 +00:00
%license LICENSE
2023-09-04 10:43:20 +00:00
%doc README.md
2025-01-10 05:29:03 +00:00
%{python_sitelib} /ntc_templates
%{python_sitelib} /ntc_templates-%{version} .dist-info
2020-06-05 10:20:31 +00:00
%changelog