From 07bdbb51d6886a003f692c0e7c2c6ad7dbb550b3 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 28 Aug 2021 12:38:27 +0100 Subject: [PATCH 1/2] fix zsh non-`str` choices - fixes #48 --- shtab/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shtab/__init__.py b/shtab/__init__.py index 4bbe448..650face 100644 --- a/shtab/__init__.py +++ b/shtab/__init__.py @@ -553,7 +553,7 @@ def format_optional(opt): else ( choice_type2fn[opt.choices[0].type] if isinstance(opt.choices[0], Choice) - else "({})".format(" ".join(opt.choices)) + else "({})".format(" ".join(map(str, opt.choices))) ) if opt.choices else "", @@ -570,7 +570,7 @@ def format_positional(opt): else ( choice_type2fn[opt.choices[0].type] if isinstance(opt.choices[0], Choice) - else "({})".format(" ".join(opt.choices)) + else "({})".format(" ".join(map(str, opt.choices))) ) if opt.choices else "", From f1402f33b77aa8b7b1120add0bc2b80a7fe796d8 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 1 Sep 2021 11:45:22 +0100 Subject: [PATCH 2/2] build: misc minor updates --- .gitignore | 8 ++++---- .pre-commit-config.yaml | 2 +- setup.cfg | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f60de49..e5af302 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,13 @@ *.py[cod] -/shtab/_dist_ver.py +__pycache__/ # Packages +/shtab/_dist_ver.py /*.egg*/ /build/ /dist/ # Unit test / coverage reports -/.coverage -/.pytest_cache/ +/.coverage* /coverage.xml -__pycache__/ +/.pytest_cache/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d77ba8..b05349d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,9 +22,9 @@ repos: name: Check TODO language: pygrep entry: TODO + args: [-i] types: [text] exclude: ^(.pre-commit-config.yaml|.github/workflows/test.yml)$ - args: [-i] - repo: https://gitlab.com/pycqa/flake8 rev: 3.9.2 hooks: diff --git a/setup.cfg b/setup.cfg index 9aab8a1..62d4c4e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -86,4 +86,7 @@ known_first_party=shtab [tool:pytest] timeout=5 -addopts=-v --tb=short -rxs -W=error --log-level=debug --durations=0 --cov=shtab --cov-report=term-missing --cov-report=xml +log_level=DEBUG +python_files=test_*.py +testpaths=tests +addopts=-v --tb=short -rxs -W=error --durations=0 --cov=shtab --cov-report=term-missing --cov-report=xml