cli-helpers 2.15.2__tar.gz → 2.15.3__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.2 → cli_helpers-2.15.3}/AUTHORS +1 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/CHANGELOG +7 -1
- {cli_helpers-2.15.2/cli_helpers.egg-info → cli_helpers-2.15.3}/PKG-INFO +1 -1
- cli_helpers-2.15.3/cli_helpers/__init__.py +1 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/output_formatter.py +0 -2
- {cli_helpers-2.15.2 → cli_helpers-2.15.3/cli_helpers.egg-info}/PKG-INFO +1 -1
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_output_formatter.py +44 -0
- cli_helpers-2.15.2/cli_helpers/__init__.py +0 -1
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/.github/workflows/codeql.yml +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/.gitignore +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/.travis/install.sh +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/.travis.yml +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/CONTRIBUTING.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/LICENSE +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/MANIFEST.in +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/README.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/appveyor.yml +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/compat.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/config.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/json_output_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/preprocessors.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/tabulate_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/vertical_table_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/utils.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers.egg-info/SOURCES.txt +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers.egg-info/dependency_links.txt +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers.egg-info/requires.txt +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers.egg-info/top_level.txt +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/Makefile +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/api.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/authors.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/changelog.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/conf.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/contributing.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/index.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/license.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/docs/source/quickstart.rst +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/release.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/requirements-dev.txt +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/setup.cfg +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/setup.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tasks.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/__init__.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/compat.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/config_data/configrc +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/config_data/configspecrc +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/config_data/invalid_configrc +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/config_data/invalid_configspecrc +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_json_output_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_preprocessors.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_tabulate_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_vertical_table_adapter.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/test_cli_helpers.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/test_config.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/test_utils.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/utils.py +0 -0
- {cli_helpers-2.15.2 → cli_helpers-2.15.3}/tox.ini +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.15.3"
|
|
@@ -19,7 +19,6 @@ from . import (
|
|
|
19
19
|
tsv_output_adapter,
|
|
20
20
|
json_output_adapter,
|
|
21
21
|
)
|
|
22
|
-
from decimal import Decimal
|
|
23
22
|
|
|
24
23
|
import itertools
|
|
25
24
|
|
|
@@ -31,7 +30,6 @@ TYPES = {
|
|
|
31
30
|
bool: 1,
|
|
32
31
|
int: 2,
|
|
33
32
|
float: 3,
|
|
34
|
-
Decimal: 3,
|
|
35
33
|
binary_type: 4,
|
|
36
34
|
text_type: 5,
|
|
37
35
|
}
|
|
@@ -348,3 +348,47 @@ def test_all_text_type(extra_kwargs):
|
|
|
348
348
|
iter(data), headers, format_name=format_name, **extra_kwargs
|
|
349
349
|
):
|
|
350
350
|
assert isinstance(row, text_type), "not unicode for {}".format(format_name)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
@pytest.mark.parametrize(
|
|
354
|
+
"column",
|
|
355
|
+
[
|
|
356
|
+
[1.2, 10.34],
|
|
357
|
+
[Decimal("1.2"), Decimal("10.34")],
|
|
358
|
+
[1, 1.2, Decimal("10.34"), None],
|
|
359
|
+
],
|
|
360
|
+
)
|
|
361
|
+
def test_inferred_float_column_type(column):
|
|
362
|
+
formatter = TabularOutputFormatter()
|
|
363
|
+
assert formatter._get_column_type(column) is float
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
@pytest.mark.parametrize("number_type", [float, Decimal])
|
|
367
|
+
def test_format_numbers_with_inferred_types(number_type):
|
|
368
|
+
from cli_helpers.tabular_output.preprocessors import format_numbers
|
|
369
|
+
|
|
370
|
+
formatter = TabularOutputFormatter(format_name="psql")
|
|
371
|
+
output = "\n".join(
|
|
372
|
+
formatter.format_output(
|
|
373
|
+
iter([(number_type("123456.78"), number_type("2.5"))]),
|
|
374
|
+
["f", "n"],
|
|
375
|
+
preprocessors=(format_numbers,),
|
|
376
|
+
float_format=",.2f",
|
|
377
|
+
disable_numparse=True,
|
|
378
|
+
)
|
|
379
|
+
)
|
|
380
|
+
assert "123,456.78" in output
|
|
381
|
+
assert "2.50" in output
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
@pytest.mark.parametrize("number_type", [float, Decimal])
|
|
385
|
+
def test_align_decimals_with_inferred_types(number_type):
|
|
386
|
+
from cli_helpers.tabular_output.preprocessors import align_decimals
|
|
387
|
+
|
|
388
|
+
formatter = TabularOutputFormatter()
|
|
389
|
+
data = [(number_type("1.2"),), (number_type("10.34"),)]
|
|
390
|
+
result, headers = align_decimals(
|
|
391
|
+
data, ["n"], column_types=formatter._get_column_types(data)
|
|
392
|
+
)
|
|
393
|
+
assert list(result) == [[" 1.2"], ["10.34"]]
|
|
394
|
+
assert headers == ["n"]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.15.2"
|
|
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.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/delimited_output_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.2 → cli_helpers-2.15.3}/cli_helpers/tabular_output/vertical_table_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
|
{cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_delimited_output_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.2 → cli_helpers-2.15.3}/tests/tabular_output/test_vertical_table_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|