Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-cyclopts for openSUSE:Factory
checked in at 2026-08-06 16:21:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cyclopts (Old)
and /work/SRC/openSUSE:Factory/.python-cyclopts.new.16738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cyclopts"
Thu Aug 6 16:21:53 2026 rev:10 rq:1369633 version:4.22.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cyclopts/python-cyclopts.changes
2026-08-03 17:17:11.058482969 +0200
+++
/work/SRC/openSUSE:Factory/.python-cyclopts.new.16738/python-cyclopts.changes
2026-08-06 16:23:55.204038819 +0200
@@ -1,0 +2,9 @@
+Wed Aug 5 05:33:56 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 4.22.5:
+ * Fix a TypeError raised when an abstract collection parameter is
+ given no values
+ * Support the Collection, Container and Reversible type hints
+ * Add --empty-* flags for abstract collection hints
+
+-------------------------------------------------------------------
Old:
----
cyclopts-4.22.4.tar.gz
New:
----
cyclopts-4.22.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-cyclopts.spec ++++++
--- /var/tmp/diff_new_pack.EaR9h1/_old 2026-08-06 16:23:56.256075560 +0200
+++ /var/tmp/diff_new_pack.EaR9h1/_new 2026-08-06 16:23:56.260075700 +0200
@@ -17,7 +17,7 @@
Name: python-cyclopts
-Version: 4.22.4
+Version: 4.22.5
Release: 0
Summary: Intuitive, easy CLIs based on python type hints
License: Apache-2.0
++++++ cyclopts-4.22.4.tar.gz -> cyclopts-4.22.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cyclopts-4.22.4/PKG-INFO new/cyclopts-4.22.5/PKG-INFO
--- old/cyclopts-4.22.4/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
+++ new/cyclopts-4.22.5/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.4
Name: cyclopts
-Version: 4.22.4
+Version: 4.22.5
Summary: Intuitive, easy CLIs based on type hints.
Project-URL: Homepage, https://github.com/BrianPugh/cyclopts
Project-URL: Repository, https://github.com/BrianPugh/cyclopts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cyclopts-4.22.4/cyclopts/_convert.py
new/cyclopts-4.22.5/cyclopts/_convert.py
--- old/cyclopts-4.22.4/cyclopts/_convert.py 2020-02-02 01:00:00.000000000
+0100
+++ new/cyclopts-4.22.5/cyclopts/_convert.py 2020-02-02 01:00:00.000000000
+0100
@@ -63,6 +63,8 @@
# Mapping from abstract collection types to their concrete implementations.
# Used to convert abstract types like collections.abc.Set to concrete types
like set.
+# ``Iterator``/``Generator`` are intentionally absent: ``list`` is not a valid
+# instance of either, so there is no concrete stand-in that satisfies the hint.
_abstract_to_concrete_type_mapping: dict[type, type] = {
Iterable: list,
typing.Sequence: list,
@@ -70,6 +72,9 @@
collections.abc.Set: set,
collections.abc.MutableSet: set,
collections.abc.MutableSequence: list,
+ collections.abc.Collection: list,
+ collections.abc.Container: list,
+ collections.abc.Reversible: list,
collections.abc.Mapping: dict,
collections.abc.MutableMapping: dict,
}
@@ -77,6 +82,19 @@
NestedCliArgs = dict[str, Union[Sequence[str], "NestedCliArgs"]]
+def create_empty_instance(hint: Any) -> Any:
+ """Create an empty instance of ``hint``'s container type.
+
+ Abstract collections (e.g. ``collections.abc.Sequence[int]``) cannot be
+ instantiated, so they are first normalized to the same concrete type that
+ :func:`convert` would produce (e.g. ``list``).
+ """
+ type_ = get_origin(hint) or hint
+ if type_ in _abstract_to_concrete_type_mapping:
+ type_ = _abstract_to_concrete_type_mapping[type_]
+ return type_()
+
+
def _bool(s: str) -> bool:
s = s.lower()
if s in {"no", "n", "0", "false", "f"}:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cyclopts-4.22.4/cyclopts/_version.py
new/cyclopts-4.22.5/cyclopts/_version.py
--- old/cyclopts-4.22.4/cyclopts/_version.py 2020-02-02 01:00:00.000000000
+0100
+++ new/cyclopts-4.22.5/cyclopts/_version.py 2020-02-02 01:00:00.000000000
+0100
@@ -18,7 +18,7 @@
commit_id: str | None
__commit_id__: str | None
-__version__ = version = '4.22.4'
-__version_tuple__ = version_tuple = (4, 22, 4)
+__version__ = version = '4.22.5'
+__version_tuple__ = version_tuple = (4, 22, 5)
__commit_id__ = commit_id = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cyclopts-4.22.4/cyclopts/argument/_argument.py
new/cyclopts-4.22.5/cyclopts/argument/_argument.py
--- old/cyclopts-4.22.4/cyclopts/argument/_argument.py 2020-02-02
01:00:00.000000000 +0100
+++ new/cyclopts-4.22.5/cyclopts/argument/_argument.py 2020-02-02
01:00:00.000000000 +0100
@@ -15,6 +15,7 @@
from cyclopts._convert import (
_validate_json_extra_keys,
convert,
+ create_empty_instance,
instantiate_from_dict,
token_count,
)
@@ -592,8 +593,7 @@
elif is_nonetype(hint) or hint is None:
implicit_value = None
else:
- hint = resolve_optional(hint)
- implicit_value = (get_origin(hint) or hint)()
+ implicit_value =
create_empty_instance(resolve_optional(hint))
if trailing:
if trailing[0] == delimiter:
trailing = trailing[1:]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cyclopts-4.22.4/cyclopts/bind.py
new/cyclopts-4.22.5/cyclopts/bind.py
--- old/cyclopts-4.22.4/cyclopts/bind.py 2020-02-02 01:00:00.000000000
+0100
+++ new/cyclopts-4.22.5/cyclopts/bind.py 2020-02-02 01:00:00.000000000
+0100
@@ -6,9 +6,9 @@
from collections.abc import Callable, Iterable, Sequence
from contextlib import suppress
from functools import partial
-from typing import TYPE_CHECKING, Any, NamedTuple, get_origin
+from typing import TYPE_CHECKING, Any, NamedTuple
-from cyclopts._convert import _bool
+from cyclopts._convert import _bool, create_empty_instance
from cyclopts.annotations import resolve_optional
from cyclopts.argument import Argument, ArgumentCollection
from cyclopts.exceptions import (
@@ -351,8 +351,17 @@
actual_count=0,
)
# Allow empty iterables (e.g., --urls with no values
behaves like --empty-urls)
- hint = resolve_optional(match.argument.hint)
- empty_container = (get_origin(hint) or hint)()
+ try:
+ empty_container =
create_empty_instance(resolve_optional(match.argument.hint))
+ except TypeError as e:
+ # ``n_tokens=-1`` sets ``consume_all`` for any
type, so the hint
+ # here isn't necessarily a constructible container.
+ raise CoercionError(
+ msg=e.args[0] if e.args else None,
+ argument=match.argument,
+ target_type=match.argument.hint,
+ token=CliToken(keyword=match.matched_token),
+ ) from e
match.argument.append(
CliToken(keyword=match.matched_token,
implicit_value=empty_container, keys=match.keys)
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cyclopts-4.22.4/cyclopts/parameter.py
new/cyclopts-4.22.5/cyclopts/parameter.py
--- old/cyclopts-4.22.4/cyclopts/parameter.py 2020-02-02 01:00:00.000000000
+0100
+++ new/cyclopts-4.22.5/cyclopts/parameter.py 2020-02-02 01:00:00.000000000
+0100
@@ -22,6 +22,7 @@
from typing_extensions import Self
import cyclopts._env_var
+from cyclopts._convert import _abstract_to_concrete_type_mapping
from cyclopts.annotations import (
ITERABLE_TYPES,
NoneType,
@@ -58,7 +59,23 @@
T = TypeVar("T")
-_NEGATIVE_FLAG_TYPES = frozenset([bool, None, NoneType, *ITERABLE_TYPES,
*ITERATIVE_BOOL_IMPLICIT_VALUE])
+# Abstract collections get the same negative flag as the concrete type they
resolve to,
+# so e.g. ``Sequence[int]`` and ``MutableSequence[int]`` both offer
``--empty-*``.
+# Mappings are excluded for free: ``dict`` is not in ``ITERABLE_TYPES``.
+_ABSTRACT_NEGATIVE_FLAG_TYPES = frozenset(
+ abstract for abstract, concrete in
_abstract_to_concrete_type_mapping.items() if concrete in ITERABLE_TYPES
+)
+
+_NEGATIVE_FLAG_TYPES = frozenset(
+ [
+ bool,
+ None,
+ NoneType,
+ *ITERABLE_TYPES,
+ *_ABSTRACT_NEGATIVE_FLAG_TYPES,
+ *ITERATIVE_BOOL_IMPLICIT_VALUE,
+ ]
+)
def _not_hyphen_validator(instance, attribute, values):