Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-shtab for openSUSE:Factory checked in at 2026-01-28 15:06:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-shtab (Old) and /work/SRC/openSUSE:Factory/.python-shtab.new.1928 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-shtab" Wed Jan 28 15:06:55 2026 rev:3 rq:1329567 version:1.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-shtab/python-shtab.changes 2025-05-30 17:26:29.574150504 +0200 +++ /work/SRC/openSUSE:Factory/.python-shtab.new.1928/python-shtab.changes 2026-01-28 15:07:37.591197976 +0100 @@ -1,0 +2,12 @@ +Tue Jan 27 21:36:08 UTC 2026 - Dirk Müller <[email protected]> + +- update to 1.8.0: + * fix `bash` error on optional `nargs="?"` + * fix `zsh` duplicate default remainder & swapped + one_or_more/remainder + * misc minor docs updates + * add own/example CLI file output + * misc framework updates + * test support for Python 3.14 + +------------------------------------------------------------------- Old: ---- shtab-1.7.2.tar.gz New: ---- shtab-1.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-shtab.spec ++++++ --- /var/tmp/diff_new_pack.fuHxOj/_old 2026-01-28 15:07:38.303227552 +0100 +++ /var/tmp/diff_new_pack.fuHxOj/_new 2026-01-28 15:07:38.303227552 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-shtab # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-shtab -Version: 1.7.2 +Version: 1.8.0 Release: 0 Summary: Automagic shell tab completion for Python CLI applications License: Apache-2.0 ++++++ shtab-1.7.2.tar.gz -> shtab-1.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/.github/workflows/test.yml new/shtab-1.8.0/.github/workflows/test.yml --- old/shtab-1.7.2/.github/workflows/test.yml 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/.github/workflows/test.yml 2025-11-18 11:57:23.000000000 +0100 @@ -8,10 +8,10 @@ test: if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association) name: Test py${{ matrix.python }} - runs-on: ubuntu-${{ matrix.python == 3.7 && '22.04' || 'latest' }} + runs-on: ubuntu-latest strategy: matrix: - python: [3.7, 3.12] + python: [3.9, 3.13] steps: - uses: actions/checkout@v4 with: {fetch-depth: 0} @@ -41,6 +41,7 @@ uses: casperdcl/deploy-pypi@v2 with: build: true + requirements: 'build twine packaging>=24.2' # https://github.com/pypa/twine/issues/1216 upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') name: Release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/.pre-commit-config.yaml new/shtab-1.8.0/.pre-commit-config.yaml --- old/shtab-1.7.2/.pre-commit-config.yaml 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/.pre-commit-config.yaml 2025-11-18 11:57:23.000000000 +0100 @@ -27,7 +27,7 @@ types: [text] exclude: ^(.pre-commit-config.yaml|.github/workflows/test.yml)$ - repo: https://github.com/PyCQA/flake8 - rev: 7.2.0 + rev: 7.3.0 hooks: - id: flake8 args: [-j8] @@ -40,7 +40,7 @@ - flake8-pyproject - flake8-string-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.16.1 hooks: - id: mypy additional_dependencies: [types-setuptools] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/CONTRIBUTING.md new/shtab-1.8.0/CONTRIBUTING.md --- old/shtab-1.7.2/CONTRIBUTING.md 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/CONTRIBUTING.md 2025-11-18 11:57:23.000000000 +0100 @@ -30,10 +30,10 @@ Given that the number of completions a program may need would likely be less than a million, the focus is on readability rather than premature speed -optimisations. The generated code itself, on the other had, should be fast. +optimisations. The generated code itself, on the other hand, should be fast. -Helper functions such as `replace_format` allows use of curly braces `{}` in -string snippets without clashing between Python's `str.format` and shell +Helper functions such as `replace_format` allow use of curly braces `{}` in +string snippets without clashes between Python's `str.format` and shell parameter expansion. The generated shell code itself is also meant to be readable. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/LICENCE new/shtab-1.8.0/LICENCE --- old/shtab-1.7.2/LICENCE 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/LICENCE 2025-11-18 11:57:23.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright 2020-2023 Casper da Costa-Luis +Copyright 2020-2025 Casper da Costa-Luis Licensed under the Apache Licence, Version 2.0 (the "Licence"); you may not use this project except in compliance with the Licence. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/PKG-INFO new/shtab-1.8.0/PKG-INFO --- old/shtab-1.7.2/PKG-INFO 2025-04-12 22:27:53.589287800 +0200 +++ new/shtab-1.8.0/PKG-INFO 2025-11-18 11:57:34.039341000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 2.4 Name: shtab -Version: 1.7.2 +Version: 1.8.0 Summary: Automagic shell tab completion for Python CLI applications Author-email: Casper da Costa-Luis <[email protected]> Maintainer-email: Iterative <[email protected]> -License: Apache-2.0 +License-Expression: Apache-2.0 Project-URL: documentation, https://docs.iterative.ai/shtab Project-URL: repository, https://github.com/iterative/shtab Project-URL: changelog, https://github.com/iterative/shtab/releases @@ -18,7 +18,6 @@ Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Other Audience Classifier: Intended Audience :: System Administrators -Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: MacOS Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX @@ -30,12 +29,11 @@ Classifier: Programming Language :: Other Scripting Engines Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation Classifier: Programming Language :: Python :: Implementation :: IronPython @@ -58,7 +56,7 @@ Classifier: Topic :: System :: System Shells Classifier: Topic :: Terminals Classifier: Topic :: Utilities -Requires-Python: >=3.7 +Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENCE Provides-Extra: dev diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/docs/index.md new/shtab-1.8.0/docs/index.md --- old/shtab-1.7.2/docs/index.md 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/docs/index.md 2025-11-18 11:57:23.000000000 +0100 @@ -98,7 +98,6 @@ - [argcomplete](https://pypi.org/project/argcomplete) - executes the underlying script *every* time `<TAB>` is pressed (slow and has side-effects) - - only provides `bash` completion - [pyzshcomplete](https://pypi.org/project/pyzshcomplete) - executes the underlying script *every* time `<TAB>` is pressed (slow and has side-effects) - only provides `zsh` completion @@ -110,7 +109,7 @@ Please do open [issues][GH-issue] & [pull requests][GH-pr]! Some ideas: -- support `fish` +- support `fish` ([#174](https://github.com/iterative/shtab/pull/174)) - support `powershell` See diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/docs/use.md new/shtab-1.8.0/docs/use.md --- old/shtab-1.7.2/docs/use.md 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/docs/use.md 2025-11-18 11:57:23.000000000 +0100 @@ -74,7 +74,7 @@ ```sh mkdir -p ~/.zsh/completions fpath=($fpath ~/.zsh/completions) # must be before `compinit` lines - shtab --shell=zsh shtab.main.get_main_parser > ~/.zsh/completions/_shtab + shtab --shell=zsh shtab.main.get_main_parser -o ~/.zsh/completions/_shtab ``` === "tcsh" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/pyproject.toml new/shtab-1.8.0/pyproject.toml --- old/shtab-1.7.2/pyproject.toml 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/pyproject.toml 2025-11-18 11:57:23.000000000 +0100 @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] +requires = ["setuptools>=77", "setuptools_scm[toml]>=3.4"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] @@ -24,9 +24,9 @@ maintainers = [{name = "Iterative", email = "[email protected]"}] description = "Automagic shell tab completion for Python CLI applications" readme = "README.rst" -requires-python = ">=3.7" +requires-python = ">=3.9" keywords = ["tab", "complete", "completion", "shell", "bash", "zsh", "argparse"] -license = {text = "Apache-2.0"} +license = "Apache-2.0" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -37,7 +37,6 @@ "Intended Audience :: End Users/Desktop", "Intended Audience :: Other Audience", "Intended Audience :: System Administrators", - "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", @@ -49,12 +48,11 @@ "Programming Language :: Other Scripting Engines", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation", "Programming Language :: Python :: Implementation :: IronPython", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/shtab/__init__.py new/shtab-1.8.0/shtab/__init__.py --- old/shtab-1.7.2/shtab/__init__.py 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/shtab/__init__.py 2025-11-18 11:57:23.000000000 +0100 @@ -421,6 +421,7 @@ if [[ "$current_action_nargs" != "*" ]] && \\ [[ "$current_action_nargs" != "+" ]] && \\ + [[ "$current_action_nargs" != "?" ]] && \\ [[ "$current_action_nargs" != *"..." ]] && \\ (( $word_index + 1 - $current_action_args_start_index - $pos_only >= \\ $current_action_nargs )); then @@ -605,10 +606,17 @@ return f"""\ {prefix}() {{ - local context state line curcontext="$curcontext" one_or_more='(-)*' remainder='(*)' + local context state line \ +curcontext="$curcontext" one_or_more='(*)' remainder='(-)*' default='*::: :->{name}' - if ((${{{prefix}_options[(I)${{(q)one_or_more}}*]}} + ${{{prefix}_options[(I)${{(q)remainder}}*]}} == 0)); then # noqa: E501 - {prefix}_options+=(': :{prefix}_commands' '*::: :->{name}') + # Add default positional/remainder specs only if none exist, and only once per session + if (( ! {prefix}_defaults_added )); then + if (( ${{{prefix}_options[(I)${{(q)one_or_more}}*]}} +\ + ${{{prefix}_options[(I)${{(q)remainder}}*]}} +\ + ${{{prefix}_options[(I)${{(q)default}}]}} == 0 )); then + {prefix}_options+=(': :{prefix}_commands' '*::: :->{name}') + fi + {prefix}_defaults_added=1 fi _arguments -C -s ${prefix}_options @@ -630,6 +638,9 @@ {prefix}_options=( {arguments} ) + +# guard to ensure default positional specs are added only once per session +{prefix}_defaults_added=0 """ def command_list(prefix, options): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/shtab/_dist_ver.py new/shtab-1.8.0/shtab/_dist_ver.py --- old/shtab-1.7.2/shtab/_dist_ver.py 2025-04-12 22:27:53.000000000 +0200 +++ new/shtab-1.8.0/shtab/_dist_ver.py 2025-11-18 11:57:33.000000000 +0100 @@ -1 +1 @@ -__version__ = '1.7.2' +__version__ = '1.8.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/shtab/main.py new/shtab-1.8.0/shtab/main.py --- old/shtab-1.7.2/shtab/main.py 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/shtab/main.py 2025-11-18 11:57:23.000000000 +0100 @@ -2,7 +2,9 @@ import logging import os import sys +from contextlib import contextmanager from importlib import import_module +from pathlib import Path from . import SUPPORTED_SHELLS, __version__, add_argument_to, complete @@ -14,6 +16,8 @@ parser.add_argument("parser", help="importable parser (or function returning parser)") parser.add_argument("--version", action="version", version="%(prog)s " + __version__) parser.add_argument("-s", "--shell", default=SUPPORTED_SHELLS[0], choices=SUPPORTED_SHELLS) + parser.add_argument("-o", "--output", default='-', help="output file (- for stdout)", + type=Path) parser.add_argument("--prefix", help="prepended to generated functions to avoid clashes") parser.add_argument("--preamble", help="prepended to generated script") parser.add_argument("--prog", help="custom program name (overrides `parser.prog`)") @@ -52,6 +56,16 @@ other_parser = other_parser() if args.prog: other_parser.prog = args.prog - print( - complete(other_parser, shell=args.shell, root_prefix=args.prefix - or args.parser.split(".", 1)[0], preamble=args.preamble)) + + @contextmanager + def _open(out_path): + if str(out_path) in ("-", "stdout"): + yield sys.stdout + else: + with out_path.open('w') as fd: + yield fd + + with _open(args.output) as fd: + print( + complete(other_parser, shell=args.shell, root_prefix=args.prefix + or args.parser.split(".", 1)[0], preamble=args.preamble), file=fd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/shtab.egg-info/PKG-INFO new/shtab-1.8.0/shtab.egg-info/PKG-INFO --- old/shtab-1.7.2/shtab.egg-info/PKG-INFO 2025-04-12 22:27:53.000000000 +0200 +++ new/shtab-1.8.0/shtab.egg-info/PKG-INFO 2025-11-18 11:57:34.000000000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 2.4 Name: shtab -Version: 1.7.2 +Version: 1.8.0 Summary: Automagic shell tab completion for Python CLI applications Author-email: Casper da Costa-Luis <[email protected]> Maintainer-email: Iterative <[email protected]> -License: Apache-2.0 +License-Expression: Apache-2.0 Project-URL: documentation, https://docs.iterative.ai/shtab Project-URL: repository, https://github.com/iterative/shtab Project-URL: changelog, https://github.com/iterative/shtab/releases @@ -18,7 +18,6 @@ Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Other Audience Classifier: Intended Audience :: System Administrators -Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: MacOS Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX @@ -30,12 +29,11 @@ Classifier: Programming Language :: Other Scripting Engines Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation Classifier: Programming Language :: Python :: Implementation :: IronPython @@ -58,7 +56,7 @@ Classifier: Topic :: System :: System Shells Classifier: Topic :: Terminals Classifier: Topic :: Utilities -Requires-Python: >=3.7 +Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENCE Provides-Extra: dev diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/shtab-1.7.2/tests/test_shtab.py new/shtab-1.8.0/tests/test_shtab.py --- old/shtab-1.7.2/tests/test_shtab.py 2025-04-12 22:27:38.000000000 +0200 +++ new/shtab-1.8.0/tests/test_shtab.py 2025-11-18 11:57:23.000000000 +0100 @@ -82,6 +82,31 @@ assert not caplog.record_tuples [email protected]('output', ["-", "stdout", "test.txt"]) +@fix_shell +def test_main_output_path(shell, caplog, capsys, change_dir, output): + assert not capsys.readouterr().out + with caplog.at_level(logging.INFO): + try: + main(["-s", shell, "shtab.main.get_main_parser", "-o", output]) + except SystemExit: + pass + + captured = capsys.readouterr() + assert not captured.err + expected = { + "bash": "complete -o filenames -F _shtab_shtab shtab", "zsh": "_shtab_shtab_commands()", + "tcsh": "complete shtab"} + + if output in ("-", "stdout"): + assert expected[shell] in captured.out + else: + assert not captured.out + assert expected[shell] in (change_dir / output).read_text() + + assert not caplog.record_tuples + + @fix_shell def test_prog_override(shell, caplog, capsys): with caplog.at_level(logging.INFO): @@ -108,6 +133,8 @@ elif shell == "zsh": assert script_py == [ "#compdef script.py", "_describe 'script.py commands' _commands", + 'local context state line curcontext="$curcontext" ' + "one_or_more='(*)' remainder='(-)*' default='*::: :->script.py'", "_shtab_shtab_options+=(': :_shtab_shtab_commands' '*::: :->script.py')", "script.py)", "compdef _shtab_shtab -N script.py"] elif shell == "tcsh":
