14
0

Accepting request 720151 from devel:languages:python

- version update to 1.1.0
  * Per 'http://python-future.org/automatic_conversion.html' py2 & py3 compatibility.
  * Make sure test fails if there is more than one list entry.
  * Fix deprecated warning for invalid escapes.
  * Support utf-8 in template files
  * Add utf-8 characters to a test example
  * Unicode example in template input.
  * Switch to utf-8 strings and remove unnecessary conversions.
  * Remove legacy lint checks
  * Migrate StringIO and remove unneeded import six.
  * Remove unnecessary explicit unicast declaration.
  * oll back changes to 'open'.
  * Cosmetic linting.
  * Package 'future' needed for importing builtins.
  * Add tests and testdata to distribution.
  * Use correct install_requires stanza for dependencies.
  * Include testdata files in binarty dist for tyesting.
- deleted patches
  - textfsm_test_do_not_relay_on_dic_order.patch (upstreamed)

OBS-URL: https://build.opensuse.org/request/show/720151
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-textfsm?expand=0&rev=2
This commit is contained in:
2019-08-05 08:36:30 +00:00
committed by Git OBS Bridge
5 changed files with 35 additions and 51 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:280a980330e6e83010bb29225091b4094d594a83f174142c5657beda7edf3300
size 51409

View File

@@ -1,3 +1,26 @@
-------------------------------------------------------------------
Wed Jul 31 13:48:06 UTC 2019 - pgajdos@suse.com
- version update to 1.1.0
* Per 'http://python-future.org/automatic_conversion.html' py2 & py3 compatibility.
* Make sure test fails if there is more than one list entry.
* Fix deprecated warning for invalid escapes.
* Support utf-8 in template files
* Add utf-8 characters to a test example
* Unicode example in template input.
* Switch to utf-8 strings and remove unnecessary conversions.
* Remove legacy lint checks
* Migrate StringIO and remove unneeded import six.
* Remove unnecessary explicit unicast declaration.
* oll back changes to 'open'.
* Cosmetic linting.
* Package 'future' needed for importing builtins.
* Add tests and testdata to distribution.
* Use correct install_requires stanza for dependencies.
* Include testdata files in binarty dist for tyesting.
- deleted patches
- textfsm_test_do_not_relay_on_dic_order.patch (upstreamed)
-------------------------------------------------------------------
Fri Jul 20 11:49:46 UTC 2018 - tchvatal@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-textfsm
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,26 +12,28 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-textfsm
Version: 0.4.1
Version: 1.1.0
Release: 0
Summary: Python module for parsing semi-structured text into python tables
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/google/textfsm
Source: https://github.com/google/textfsm/archive/0.4.1.tar.gz
# PATCH-FIX-UPSTREAM textfsm_test_do_not_relay_on_dic_order.patch https://github.com/google/textfsm/pull/33
Patch0: textfsm_test_do_not_relay_on_dic_order.patch
Source: https://github.com/google/textfsm/archive/v%{version}.tar.gz
BuildRequires: %{python_module future}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-future
Requires: python-six
Conflicts: python-texttable
BuildArch: noarch
@@ -48,7 +50,6 @@ devices.
%prep
%setup -q -n textfsm-%{version}
%patch0 -p1
%build
%python_build
@@ -58,11 +59,7 @@ devices.
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_exec clitable_test.py
%python_exec copyable_regex_object_test.py
%python_exec terminal_test.py
%python_exec textfsm_test.py
%python_exec texttable_test.py
%pytest
%files %{python_files}
%license COPYING

View File

@@ -1,36 +0,0 @@
From 0a1b2a33a4e8ef0484c9f8051ff0b69874ca05e1 Mon Sep 17 00:00:00 2001
From: Alberto Planas <aplanas@gmail.com>
Date: Mon, 2 Jul 2018 14:51:21 +0200
Subject: [PATCH] textfsm_test: do not relay on dic order
The test `testNestedMatching` compares a list of dictionaries with
a string. In Python 2 (and some versions of Python 3) the order
of a dictionary is not guaranteed, and this makes the test to fail.
This patch compares the raw result with the raw list, and assetEqual
takes care of the ordering.
---
textfsm_test.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/textfsm_test.py b/textfsm_test.py
index c4f7f2c..e92a17b 100755
--- a/textfsm_test.py
+++ b/textfsm_test.py
@@ -628,10 +628,12 @@ def testNestedMatching(self):
data = " Bob: 32 NC\n Alice: 27 NY\n Jeff: 45 CA\nJulia\n\n" # Julia should be parsed as "name" separately
result = t.ParseText(data)
self.assertEqual(
- str(result), (
- "[[[{'name': 'Bob', 'age': '32', 'state': 'NC'}, "
- "{'name': 'Alice', 'age': '27', 'state': 'NY'}, "
- "{'name': 'Jeff', 'age': '45', 'state': 'CA'}], 'Julia']]"
+ result, (
+ [[[
+ {'name': 'Bob', 'age': '32', 'state': 'NC'},
+ {'name': 'Alice', 'age': '27', 'state': 'NY'},
+ {'name': 'Jeff', 'age': '45', 'state': 'CA'}
+ ], 'Julia']]
))
def testNestedNameConflict(self):

3
v1.1.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b750de2986ef78696e686b510a96aa23206a575580daf2b1eb7e17525ed33045
size 51104