diff --git a/changelog.rst b/changelog.rst index 81fbefe78..99f63deb7 100644 --- a/changelog.rst +++ b/changelog.rst @@ -6,6 +6,13 @@ Features: * Add a ``\service`` prompt token for connections made using ``service=...`` or ``PGSERVICE``. For example, set ``prompt = '\service> '``. +Internal: +--------- +* Require ``cli_helpers >= 2.15.2``. That release aligns vertical (expanded) + output by display width, so a header of wide characters like ``配列`` lines + up; ``test_format_array_output_expanded`` had the old misalignment written + down and fails with it. + 4.7.1 (2026-09-20) ================== diff --git a/pyproject.toml b/pyproject.toml index 1f21e60ea..71ee953ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ "psycopg-binary >= 3.0.14; sys_platform == 'win32'", "sqlparse >=0.3.0,<0.7", "configobj >= 5.0.6", - "cli_helpers[styles] >= 2.4.0", + "cli_helpers[styles] >= 2.15.2", # setproctitle is used to mask the password when running `ps` in command line. # But this is not necessary in Windows since the password is never shown in the # task manager. Also setproctitle is a hard dependency to install in Windows, diff --git a/tests/test_main.py b/tests/test_main.py index decae97b1..44dafd6d3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -191,15 +191,16 @@ def test_format_array_output_expanded(executor): SELECT '{}', NULL, array[NULL] """ results = run(executor, statement, expanded=True) + # 配列 is two wide characters: its padding counts display width (cli_helpers 2.15.2+). expected = [ "-[ RECORD 1 ]-------------------------", "bigint_array | {1,2,3}", "nested_numeric_array | {{1,2},{3,4}}", - "配列 | {å,魚,текст}", + "配列 | {å,魚,текст}", "-[ RECORD 2 ]-------------------------", "bigint_array | {}", "nested_numeric_array | ", - "配列 | {}", + "配列 | {}", "SELECT 2", ] assert "\n".join(results) == "\n".join(expected)