forked from pool/python-cli-helpers
- Update to 1.2.1:
* Work with new pygments - Remove merged patch: * pygments.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cli-helpers?expand=0&rev=6
This commit is contained in:
committed by
Git OBS Bridge
parent
977de85085
commit
e6fdac8bfb
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d211192b4d5a61de0020c516213ba67bbf1662ccd8c0624e6696dedb1a9d3e5d
|
||||
size 30843
|
||||
3
cli_helpers-1.2.1.tar.gz
Normal file
3
cli_helpers-1.2.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:98db22eaa86827d99ee6af9f5f3923142d04df256425204530842b032849a165
|
||||
size 31718
|
||||
224
pygments.patch
224
pygments.patch
@@ -1,224 +0,0 @@
|
||||
From 19a0e9def85b6a8f066594ae25204338c28eeb04 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Roten <thomas@roten.us>
|
||||
Date: Sat, 25 May 2019 15:23:32 -0500
|
||||
Subject: [PATCH] Fix use of bold in Pygments tests.
|
||||
|
||||
---
|
||||
tests/tabular_output/test_preprocessors.py | 6 +--
|
||||
tests/tabular_output/test_tabulate_adapter.py | 42 +++++++++----------
|
||||
.../test_terminaltables_adapter.py | 42 +++++++++----------
|
||||
3 files changed, 45 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/tests/tabular_output/test_preprocessors.py b/tests/tabular_output/test_preprocessors.py
|
||||
index d79b744..44fc652 100644
|
||||
--- a/tests/tabular_output/test_preprocessors.py
|
||||
+++ b/tests/tabular_output/test_preprocessors.py
|
||||
@@ -161,7 +161,7 @@ class CliStyle(Style):
|
||||
headers = ['h1', 'h2']
|
||||
data = [['观音', '2'], ['Ποσειδῶν', 'b']]
|
||||
|
||||
- expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m']
|
||||
+ expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m']
|
||||
expected_data = [['\x1b[38;5;233;48;5;7m观音\x1b[39;49m',
|
||||
'\x1b[38;5;233;48;5;7m2\x1b[39;49m'],
|
||||
['\x1b[38;5;10mΠοσειδῶν\x1b[39m', '\x1b[38;5;10mb\x1b[39m']]
|
||||
@@ -183,7 +183,7 @@ class CliStyle(Style):
|
||||
headers = ['h1', 'h2']
|
||||
data = [['观音\nLine2', 'Ποσειδῶν']]
|
||||
|
||||
- expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m']
|
||||
+ expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m']
|
||||
expected_data = [
|
||||
['\x1b[38;5;233;48;5;7m观音\x1b[39;49m\n\x1b[38;5;233;48;5;7m'
|
||||
'Line2\x1b[39;49m',
|
||||
@@ -207,7 +207,7 @@ class CliStyle(Style):
|
||||
headers = ['h1', 'h2']
|
||||
data = [['1', '2'], ['a', 'b']]
|
||||
|
||||
- expected_headers = ['\x1b[31;01mh1\x1b[39;00m', '\x1b[31;01mh2\x1b[39;00m']
|
||||
+ expected_headers = ['\x1b[91;01mh1\x1b[39;00m', '\x1b[91;01mh2\x1b[39;00m']
|
||||
expected_data = [['\x1b[38;5;233;48;5;7m1\x1b[39;49m',
|
||||
'\x1b[38;5;233;48;5;7m2\x1b[39;49m'],
|
||||
['\x1b[38;5;10ma\x1b[39m', '\x1b[38;5;10mb\x1b[39m']]
|
||||
diff --git a/tests/tabular_output/test_tabulate_adapter.py b/tests/tabular_output/test_tabulate_adapter.py
|
||||
index d2ade12..e0dd5a8 100644
|
||||
--- a/tests/tabular_output/test_tabulate_adapter.py
|
||||
+++ b/tests/tabular_output/test_tabulate_adapter.py
|
||||
@@ -73,24 +73,24 @@ class CliStyle(Style):
|
||||
output = tabulate_adapter.adapter(iter(data), headers, table_format='psql')
|
||||
|
||||
assert "\n".join(output) == dedent('''\
|
||||
- \x1b[31;01m+\x1b[39;00m''' + (
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 10) +
|
||||
- '\x1b[31;01m+\x1b[39;00m' +
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 6)) +
|
||||
- '''\x1b[31;01m+\x1b[39;00m
|
||||
- \x1b[31;01m|\x1b[39;00m h1 \x1b[31;01m|\x1b[39;00m''' +
|
||||
- ''' h2 \x1b[31;01m|\x1b[39;00m
|
||||
- ''' + '\x1b[31;01m|\x1b[39;00m' + (
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 10) +
|
||||
- '\x1b[31;01m+\x1b[39;00m' +
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 6)) +
|
||||
- '''\x1b[31;01m|\x1b[39;00m
|
||||
- \x1b[31;01m|\x1b[39;00m 观音 \x1b[31;01m|\x1b[39;00m''' +
|
||||
- ''' 2 \x1b[31;01m|\x1b[39;00m
|
||||
- \x1b[31;01m|\x1b[39;00m Ποσειδῶν \x1b[31;01m|\x1b[39;00m''' +
|
||||
- ''' b \x1b[31;01m|\x1b[39;00m
|
||||
- ''' + '\x1b[31;01m+\x1b[39;00m' + (
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 10) +
|
||||
- '\x1b[31;01m+\x1b[39;00m' +
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 6)) +
|
||||
- '\x1b[31;01m+\x1b[39;00m')
|
||||
+ \x1b[91m+\x1b[39m''' + (
|
||||
+ ('\x1b[91m-\x1b[39m' * 10) +
|
||||
+ '\x1b[91m+\x1b[39m' +
|
||||
+ ('\x1b[91m-\x1b[39m' * 6)) +
|
||||
+ '''\x1b[91m+\x1b[39m
|
||||
+ \x1b[91m|\x1b[39m h1 \x1b[91m|\x1b[39m''' +
|
||||
+ ''' h2 \x1b[91m|\x1b[39m
|
||||
+ ''' + '\x1b[91m|\x1b[39m' + (
|
||||
+ ('\x1b[91m-\x1b[39m' * 10) +
|
||||
+ '\x1b[91m+\x1b[39m' +
|
||||
+ ('\x1b[91m-\x1b[39m' * 6)) +
|
||||
+ '''\x1b[91m|\x1b[39m
|
||||
+ \x1b[91m|\x1b[39m 观音 \x1b[91m|\x1b[39m''' +
|
||||
+ ''' 2 \x1b[91m|\x1b[39m
|
||||
+ \x1b[91m|\x1b[39m Ποσειδῶν \x1b[91m|\x1b[39m''' +
|
||||
+ ''' b \x1b[91m|\x1b[39m
|
||||
+ ''' + '\x1b[91m+\x1b[39m' + (
|
||||
+ ('\x1b[91m-\x1b[39m' * 10) +
|
||||
+ '\x1b[91m+\x1b[39m' +
|
||||
+ ('\x1b[91m-\x1b[39m' * 6)) +
|
||||
+ '\x1b[91m+\x1b[39m')
|
||||
diff --git a/tests/tabular_output/test_terminaltables_adapter.py b/tests/tabular_output/test_terminaltables_adapter.py
|
||||
index 8794129..f756327 100644
|
||||
--- a/tests/tabular_output/test_terminaltables_adapter.py
|
||||
+++ b/tests/tabular_output/test_terminaltables_adapter.py
|
||||
@@ -46,24 +46,24 @@ class CliStyle(Style):
|
||||
output = terminaltables_adapter.adapter(iter(data), headers, table_format='ascii')
|
||||
|
||||
assert "\n".join(output) == dedent('''\
|
||||
- \x1b[31;01m+\x1b[39;00m''' + (
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 10) +
|
||||
- '\x1b[31;01m+\x1b[39;00m' +
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 4)) +
|
||||
- '''\x1b[31;01m+\x1b[39;00m
|
||||
- \x1b[31;01m|\x1b[39;00m h1 \x1b[31;01m|\x1b[39;00m''' +
|
||||
- ''' h2 \x1b[31;01m|\x1b[39;00m
|
||||
- ''' + '\x1b[31;01m+\x1b[39;00m' + (
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 10) +
|
||||
- '\x1b[31;01m+\x1b[39;00m' +
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 4)) +
|
||||
- '''\x1b[31;01m+\x1b[39;00m
|
||||
- \x1b[31;01m|\x1b[39;00m 观音 \x1b[31;01m|\x1b[39;00m''' +
|
||||
- ''' 2 \x1b[31;01m|\x1b[39;00m
|
||||
- \x1b[31;01m|\x1b[39;00m Ποσειδῶν \x1b[31;01m|\x1b[39;00m''' +
|
||||
- ''' b \x1b[31;01m|\x1b[39;00m
|
||||
- ''' + '\x1b[31;01m+\x1b[39;00m' + (
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 10) +
|
||||
- '\x1b[31;01m+\x1b[39;00m' +
|
||||
- ('\x1b[31;01m-\x1b[39;00m' * 4)) +
|
||||
- '\x1b[31;01m+\x1b[39;00m')
|
||||
+ \x1b[91m+\x1b[39m''' + (
|
||||
+ ('\x1b[91m-\x1b[39m' * 10) +
|
||||
+ '\x1b[91m+\x1b[39m' +
|
||||
+ ('\x1b[91m-\x1b[39m' * 4)) +
|
||||
+ '''\x1b[91m+\x1b[39m
|
||||
+ \x1b[91m|\x1b[39m h1 \x1b[91m|\x1b[39m''' +
|
||||
+ ''' h2 \x1b[91m|\x1b[39m
|
||||
+ ''' + '\x1b[91m+\x1b[39m' + (
|
||||
+ ('\x1b[91m-\x1b[39m' * 10) +
|
||||
+ '\x1b[91m+\x1b[39m' +
|
||||
+ ('\x1b[91m-\x1b[39m' * 4)) +
|
||||
+ '''\x1b[91m+\x1b[39m
|
||||
+ \x1b[91m|\x1b[39m 观音 \x1b[91m|\x1b[39m''' +
|
||||
+ ''' 2 \x1b[91m|\x1b[39m
|
||||
+ \x1b[91m|\x1b[39m Ποσειδῶν \x1b[91m|\x1b[39m''' +
|
||||
+ ''' b \x1b[91m|\x1b[39m
|
||||
+ ''' + '\x1b[91m+\x1b[39m' + (
|
||||
+ ('\x1b[91m-\x1b[39m' * 10) +
|
||||
+ '\x1b[91m+\x1b[39m' +
|
||||
+ ('\x1b[91m-\x1b[39m' * 4)) +
|
||||
+ '\x1b[91m+\x1b[39m')
|
||||
From ccc7aaffca8fa6e2b2f167a9d0f13e4dafe75aee Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Roten <troten@kalkomey.com>
|
||||
Date: Fri, 24 May 2019 12:36:41 -0500
|
||||
Subject: [PATCH] Pin to Pygments >= 2.4.0 for tests.
|
||||
|
||||
---
|
||||
cli_helpers/tabular_output/preprocessors.py | 2 +-
|
||||
tests/tabular_output/test_preprocessors.py | 6 +++---
|
||||
tests/tabular_output/test_tabulate_adapter.py | 2 +-
|
||||
tests/tabular_output/test_terminaltables_adapter.py | 2 +-
|
||||
5 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/cli_helpers/tabular_output/preprocessors.py b/cli_helpers/tabular_output/preprocessors.py
|
||||
index 9bbbd39..8a1c91f 100644
|
||||
--- a/cli_helpers/tabular_output/preprocessors.py
|
||||
+++ b/cli_helpers/tabular_output/preprocessors.py
|
||||
@@ -193,7 +193,7 @@ def style_output(data, headers, style=None,
|
||||
class YourStyle(Style):
|
||||
default_style = ""
|
||||
styles = {
|
||||
- Token.Output.Header: 'bold #ansired',
|
||||
+ Token.Output.Header: 'bold ansibrightred',
|
||||
Token.Output.OddRow: 'bg:#eee #111',
|
||||
Token.Output.EvenRow: '#0f0'
|
||||
}
|
||||
diff --git a/tests/tabular_output/test_preprocessors.py b/tests/tabular_output/test_preprocessors.py
|
||||
index 4eb9165..d79b744 100644
|
||||
--- a/tests/tabular_output/test_preprocessors.py
|
||||
+++ b/tests/tabular_output/test_preprocessors.py
|
||||
@@ -154,7 +154,7 @@ def test_style_output():
|
||||
class CliStyle(Style):
|
||||
default_style = ""
|
||||
styles = {
|
||||
- Token.Output.Header: 'bold #ansired',
|
||||
+ Token.Output.Header: 'bold ansibrightred',
|
||||
Token.Output.OddRow: 'bg:#eee #111',
|
||||
Token.Output.EvenRow: '#0f0'
|
||||
}
|
||||
@@ -176,7 +176,7 @@ def test_style_output_with_newlines():
|
||||
class CliStyle(Style):
|
||||
default_style = ""
|
||||
styles = {
|
||||
- Token.Output.Header: 'bold #ansired',
|
||||
+ Token.Output.Header: 'bold ansibrightred',
|
||||
Token.Output.OddRow: 'bg:#eee #111',
|
||||
Token.Output.EvenRow: '#0f0'
|
||||
}
|
||||
@@ -200,7 +200,7 @@ def test_style_output_custom_tokens():
|
||||
class CliStyle(Style):
|
||||
default_style = ""
|
||||
styles = {
|
||||
- Token.Results.Headers: 'bold #ansired',
|
||||
+ Token.Results.Headers: 'bold ansibrightred',
|
||||
Token.Results.OddRows: 'bg:#eee #111',
|
||||
Token.Results.EvenRows: '#0f0'
|
||||
}
|
||||
diff --git a/tests/tabular_output/test_tabulate_adapter.py b/tests/tabular_output/test_tabulate_adapter.py
|
||||
index c289cba..d2ade12 100644
|
||||
--- a/tests/tabular_output/test_tabulate_adapter.py
|
||||
+++ b/tests/tabular_output/test_tabulate_adapter.py
|
||||
@@ -63,7 +63,7 @@ def test_style_output_table():
|
||||
class CliStyle(Style):
|
||||
default_style = ""
|
||||
styles = {
|
||||
- Token.Output.TableSeparator: '#ansired',
|
||||
+ Token.Output.TableSeparator: 'ansibrightred',
|
||||
}
|
||||
headers = ['h1', 'h2']
|
||||
data = [['观音', '2'], ['Ποσειδῶν', 'b']]
|
||||
diff --git a/tests/tabular_output/test_terminaltables_adapter.py b/tests/tabular_output/test_terminaltables_adapter.py
|
||||
index fc49b99..8794129 100644
|
||||
--- a/tests/tabular_output/test_terminaltables_adapter.py
|
||||
+++ b/tests/tabular_output/test_terminaltables_adapter.py
|
||||
@@ -36,7 +36,7 @@ def test_style_output_table():
|
||||
class CliStyle(Style):
|
||||
default_style = ""
|
||||
styles = {
|
||||
- Token.Output.TableSeparator: '#ansired',
|
||||
+ Token.Output.TableSeparator: 'ansibrightred',
|
||||
}
|
||||
headers = ['h1', 'h2']
|
||||
data = [['观音', '2'], ['Ποσειδῶν', 'b']]
|
||||
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 17 11:18:18 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Update to 1.2.1:
|
||||
* Work with new pygments
|
||||
- Remove merged patch:
|
||||
* pygments.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 28 10:47:19 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
||||
@@ -18,14 +18,13 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-cli-helpers
|
||||
Version: 1.2.0
|
||||
Version: 1.2.1
|
||||
Release: 0
|
||||
Summary: Helpers for building command-line apps
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/dbcli/cli_helpers
|
||||
Source: https://files.pythonhosted.org/packages/source/c/cli_helpers/cli_helpers-%{version}.tar.gz
|
||||
Patch0: pygments.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -68,7 +67,6 @@ other libraries.
|
||||
|
||||
%prep
|
||||
%setup -q -n cli_helpers-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
||||
Reference in New Issue
Block a user