cli-helpers 2.15.1__tar.gz → 2.15.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/AUTHORS +1 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/CHANGELOG +8 -0
- {cli_helpers-2.15.1/cli_helpers.egg-info → cli_helpers-2.15.2}/PKG-INFO +1 -1
- cli_helpers-2.15.2/cli_helpers/__init__.py +1 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/vertical_table_adapter.py +9 -3
- {cli_helpers-2.15.1 → cli_helpers-2.15.2/cli_helpers.egg-info}/PKG-INFO +1 -1
- cli_helpers-2.15.2/requirements-dev.txt +10 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_vertical_table_adapter.py +32 -0
- cli_helpers-2.15.1/cli_helpers/__init__.py +0 -1
- cli_helpers-2.15.1/requirements-dev.txt +0 -10
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/.github/workflows/codeql.yml +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/.gitignore +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/.travis/install.sh +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/.travis.yml +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/CONTRIBUTING.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/LICENSE +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/MANIFEST.in +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/README.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/appveyor.yml +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/compat.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/config.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/json_output_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/output_formatter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/preprocessors.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/tabulate_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/utils.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers.egg-info/SOURCES.txt +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers.egg-info/dependency_links.txt +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers.egg-info/requires.txt +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers.egg-info/top_level.txt +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/Makefile +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/api.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/authors.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/changelog.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/conf.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/contributing.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/index.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/license.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/docs/source/quickstart.rst +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/release.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/setup.cfg +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/setup.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tasks.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/__init__.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/compat.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/config_data/configrc +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/config_data/configspecrc +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/config_data/invalid_configrc +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/config_data/invalid_configspecrc +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_json_output_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_output_formatter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_preprocessors.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_tabulate_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/test_cli_helpers.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/test_config.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/test_utils.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/utils.py +0 -0
- {cli_helpers-2.15.1 → cli_helpers-2.15.2}/tox.ini +0 -0
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Version 2.15.1
|
|
4
4
|
|
|
5
|
+
(released on 2026-10-15)
|
|
6
|
+
|
|
7
|
+
- Align vertical table headers containing wide or combining characters.
|
|
8
|
+
- Target Python 3.11 in pre-commit configuration.
|
|
9
|
+
- Update `pytest` to 9.1.1, and other dev requirements.
|
|
10
|
+
|
|
11
|
+
## Version 2.15.1
|
|
12
|
+
|
|
5
13
|
(released on 2026-07-25)
|
|
6
14
|
|
|
7
15
|
- Better handle empty headers in vertical table output.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.15.2"
|
{cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/vertical_table_adapter.py
RENAMED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
from __future__ import unicode_literals
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from wcwidth import wcswidth
|
|
7
|
+
|
|
8
|
+
from cli_helpers.utils import filter_dict_by_key, strip_ansi
|
|
7
9
|
from .preprocessors import convert_to_string, override_missing_value, style_output
|
|
8
10
|
|
|
9
11
|
supported_formats = ("vertical",)
|
|
@@ -54,8 +56,12 @@ def vertical_table(
|
|
|
54
56
|
"""
|
|
55
57
|
if data and not headers:
|
|
56
58
|
headers = [" " * len(x) for x in data[0]]
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
header_widths = [wcswidth(strip_ansi(x)) for x in headers]
|
|
60
|
+
header_len = max(header_widths or [0])
|
|
61
|
+
padded_headers = [
|
|
62
|
+
header + " " * (header_len - width)
|
|
63
|
+
for header, width in zip(headers, header_widths)
|
|
64
|
+
]
|
|
59
65
|
formatted_rows = [_format_row(padded_headers, row) for row in data]
|
|
60
66
|
|
|
61
67
|
output = []
|
{cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_vertical_table_adapter.py
RENAMED
|
@@ -3,10 +3,42 @@
|
|
|
3
3
|
|
|
4
4
|
from textwrap import dedent
|
|
5
5
|
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
6
8
|
from cli_helpers.compat import text_type
|
|
9
|
+
from cli_helpers.utils import strip_ansi
|
|
10
|
+
from cli_helpers.tabular_output import TabularOutputFormatter
|
|
7
11
|
from cli_helpers.tabular_output import vertical_table_adapter
|
|
8
12
|
|
|
9
13
|
|
|
14
|
+
@pytest.mark.parametrize(
|
|
15
|
+
"headers, expected",
|
|
16
|
+
[
|
|
17
|
+
(["name", "age"], ["name | Alice", "age | 30"]),
|
|
18
|
+
(["名前", "age"], ["名前 | Alice", "age | 30"]),
|
|
19
|
+
(["e\u0301", "id"], ["e\u0301 | Alice", "id | 30"]),
|
|
20
|
+
],
|
|
21
|
+
)
|
|
22
|
+
def test_vertical_table_header_display_width(headers, expected):
|
|
23
|
+
formatter = TabularOutputFormatter("vertical")
|
|
24
|
+
output = list(formatter.format_output([["Alice", 30]], headers))
|
|
25
|
+
assert output[0].splitlines()[1:] == expected
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_vertical_table_styled_header_display_width():
|
|
29
|
+
Style = pytest.importorskip("pygments.style").Style
|
|
30
|
+
Token = pytest.importorskip("pygments.token").Token
|
|
31
|
+
|
|
32
|
+
class HeaderStyle(Style):
|
|
33
|
+
styles = {Token.Output.Header: "bold"}
|
|
34
|
+
|
|
35
|
+
formatter = TabularOutputFormatter("vertical")
|
|
36
|
+
output = list(
|
|
37
|
+
formatter.format_output([["Alice", 30]], ["名前", "age"], style=HeaderStyle)
|
|
38
|
+
)
|
|
39
|
+
assert strip_ansi(output[0]).splitlines()[1:] == ["名前 | Alice", "age | 30"]
|
|
40
|
+
|
|
41
|
+
|
|
10
42
|
def test_vertical_table():
|
|
11
43
|
"""Test the default settings for vertical_table()."""
|
|
12
44
|
results = [("hello", text_type(123)), ("world", text_type(456))]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.15.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.1 → cli_helpers-2.15.2}/cli_helpers/tabular_output/delimited_output_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.1 → cli_helpers-2.15.2}/tests/tabular_output/test_delimited_output_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|