14
0

- Add patch correct-version.patch, version in the tarball does not match.

- Add patch remove-future-requirement.patch, drop requirement of future
- Switch to pyproject and autosetup macros
- Clean up python 2 leftovers
- Do not install testdata
- Stop using greedy globs in %files

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-textfsm?expand=0&rev=23
This commit is contained in:
2023-09-05 01:15:03 +00:00
committed by Git OBS Bridge
parent 09b9dab84d
commit a7d94c22fa
4 changed files with 55 additions and 13 deletions

10
correct-version.patch Normal file
View File

@@ -0,0 +1,10 @@
Index: textfsm-1.1.3/textfsm/__init__.py
===================================================================
--- textfsm-1.1.3.orig/textfsm/__init__.py
+++ textfsm-1.1.3/textfsm/__init__.py
@@ -10,4 +10,4 @@ for each input entity.
"""
from textfsm.parser import *
-__version__ = '1.1.2'
+__version__ = '1.1.3'

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Sep 5 01:14:13 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch correct-version.patch, version in the tarball does not match.
- Add patch remove-future-requirement.patch, drop requirement of future
- Switch to pyproject and autosetup macros
- Clean up python 2 leftovers
- Do not install testdata
- Stop using greedy globs in %files
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jul 6 12:19:23 UTC 2023 - ecsos <ecsos@opensuse.org> Thu Jul 6 12:19:23 UTC 2023 - ecsos <ecsos@opensuse.org>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-textfsm # spec file for package python-textfsm
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,28 +16,26 @@
# #
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
Name: python-textfsm Name: python-textfsm
Version: 1.1.3 Version: 1.1.3
Release: 0 Release: 0
Summary: Python module for parsing semi-structured text into python tables Summary: Python module for parsing semi-structured text into python tables
License: Apache-2.0 License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/google/textfsm URL: https://github.com/google/textfsm
Source: https://github.com/google/textfsm/archive/v%{version}.tar.gz#/textfsm-%{version}.tar.gz Source: https://github.com/google/textfsm/archive/v%{version}.tar.gz#/textfsm-%{version}.tar.gz
BuildRequires: %{python_module future} # PATCH-FIX-OPENSUSE https://github.com/google/textfsm/issues/118
Patch0: correct-version.patch
# PATCH-FIX-UPSTREAM gh#google/textfsm#116
Patch1: remove-future-requirement.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six} BuildRequires: %{python_module six}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-future
Requires: python-six Requires: python-six
%ifpython2
Requires: python-future
%endif
BuildArch: noarch BuildArch: noarch
%python_subpackages %python_subpackages
@@ -48,17 +46,19 @@ information returned from the command line interface (CLI) of networking
devices. devices.
%prep %prep
%setup -q -n textfsm-%{version} %autosetup -p1 -n textfsm-%{version}
# drop shebang # drop shebang
sed -i -e '/^#!\//, 1d' textfsm/*.py sed -i -e '/^#!\//, 1d' textfsm/*.py
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
# don't install broken textfsm wrapper binary # don't install broken textfsm wrapper binary
%python_expand rm -f %{buildroot}%{_bindir}/textfsm %python_expand rm -f %{buildroot}%{_bindir}/textfsm
# or the testdata
%python_expand rm -r %{buildroot}%{$python_sitelib}/testdata
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
@@ -67,6 +67,7 @@ sed -i -e '/^#!\//, 1d' textfsm/*.py
%files %{python_files} %files %{python_files}
%license COPYING %license COPYING
%doc README.md %doc README.md
%{python_sitelib}/* %{python_sitelib}/textfsm
%{python_sitelib}/textfsm-%{version}.dist-info
%changelog %changelog

View File

@@ -0,0 +1,21 @@
From b47bcfd36a753d330be0a9f4202b68dd3a549fc9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?=
<frenzy.madness@gmail.com>
Date: Mon, 14 Aug 2023 11:43:50 +0200
Subject: [PATCH] Remove future from dependencies
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index e9ff894..8fccbbb 100755
--- a/setup.py
+++ b/setup.py
@@ -53,5 +53,5 @@
},
include_package_data=True,
package_data={'textfsm': ['../testdata/*']},
- install_requires=['six', 'future'],
+ install_requires=['six'],
)