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-12-04 15:25:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cyclopts (Old)
 and      /work/SRC/openSUSE:Factory/.python-cyclopts.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-cyclopts"

Fri Dec  4 15:25:21 2026 rev:32 rq:1402876 version:5.7.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cyclopts/python-cyclopts.changes  
2026-11-26 15:53:51.605904420 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-cyclopts.new.1340718/python-cyclopts.changes 
    2026-12-04 15:27:15.709382154 +0100
@@ -1,0 +2,14 @@
+Thu Dec  3 16:57:29 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 5.7.1:
+  * 5.6.0: apply builtin coercion rules (hex ints,
+    durations, ISO dates) to subclasses of int, datetime
+    and timedelta; report invalid Decimal/Fraction, unknown
+    time zones and bad slices as CoercionError.
+  * 5.7.0: parse datetime.time and UTC offsets into
+    datetime.timezone; negative fractions read as values.
+  * 5.7.1: treat typing.LiteralString as str;
+    validators.Path matches multi-part extensions like
+    tar.gz.
+
+-------------------------------------------------------------------

Old:
----
  cyclopts-5.5.3.tar.gz

New:
----
  cyclopts-5.7.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-cyclopts.spec ++++++
--- /var/tmp/diff_new_pack.PvlZmt/_old  2026-12-04 15:27:16.269405700 +0100
+++ /var/tmp/diff_new_pack.PvlZmt/_new  2026-12-04 15:27:16.272405826 +0100
@@ -18,7 +18,7 @@
 
 %bcond_without libalternatives
 Name:           python-cyclopts
-Version:        5.5.3
+Version:        5.7.1
 Release:        0
 Summary:        Intuitive, easy CLIs based on python type hints
 License:        Apache-2.0
@@ -68,7 +68,7 @@
 %pre
 %python_libalternatives_reset_alternative cyclopts
 
-%files %python_files
+%files %{python_files}
 %doc README.md
 %license LICENSE
 %python_alternative %{_bindir}/cyclopts

++++++ cyclopts-5.5.3.tar.gz -> cyclopts-5.7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/PKG-INFO new/cyclopts-5.7.1/PKG-INFO
--- old/cyclopts-5.5.3/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
+++ new/cyclopts-5.7.1/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.5
 Name: cyclopts
-Version: 5.5.3
+Version: 5.7.1
 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-5.5.3/cyclopts/_convert.py 
new/cyclopts-5.7.1/cyclopts/_convert.py
--- old/cyclopts-5.5.3/cyclopts/_convert.py     2020-02-02 01:00:00.000000000 
+0100
+++ new/cyclopts-5.7.1/cyclopts/_convert.py     2020-02-02 01:00:00.000000000 
+0100
@@ -4,10 +4,11 @@
 import re
 import sys
 import typing
+from collections import deque
 from collections.abc import Callable, Iterable, Mapping, Sequence
-from datetime import date, datetime, timedelta
+from datetime import date, datetime, time, timedelta, timezone
 from enum import Enum, Flag
-from functools import partial, reduce
+from functools import lru_cache, partial, reduce
 from typing import (
     TYPE_CHECKING,
     Annotated,
@@ -58,6 +59,7 @@
 _NULLABLE_TYPES: tuple[Any, ...] = (NoneType, Any)
 
 _implicit_iterable_type_mapping: dict[type, type] = {
+    deque: deque[str],
     frozenset: frozenset[str],
     list: list[str],
     set: set[str],
@@ -65,11 +67,12 @@
     dict: dict[str, str],
 }
 
-# Mapping from abstract collection types to their concrete implementations.
-# Used to convert abstract types like collections.abc.Set to concrete types 
like set.
+# Mapping from types that can't be instantiated at runtime to their concrete 
stand-ins,
+# e.g. abstract collections like collections.abc.Set become 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] = {
+_abstract_to_concrete_type_mapping: dict[Any, type] = {
+    typing.LiteralString: str,
     Iterable: list,
     typing.Sequence: list,
     Sequence: list,
@@ -98,7 +101,7 @@
     return type_()
 
 
-def _bool(s: str) -> bool:
+def _bool(type_: type[bool], s: str) -> bool:
     s = s.lower()
     if s in {"no", "n", "0", "false", "f"}:
         return False
@@ -109,53 +112,54 @@
         raise CoercionError(target_type=bool)
 
 
-def _none(s: str) -> None:
+def _none(type_: Any, s: str) -> None:
     """Convert 'none' or 'null' strings (case-insensitive) to None."""
     if s.lower() in {"none", "null"}:
         return None
     raise CoercionError(target_type=NoneType)
 
 
-def _int(s: str) -> int:
+def _int(type_: type[int], s: str) -> int:
     s = s.lower()
     # Detect the base prefix past an optional leading sign; ``int(s, base)``
     # handles the sign itself, so negative/explicitly-positive values like
     # "-0xff" parse the same way "-255" already does.
     unsigned = s[1:] if s[:1] in ("+", "-") else s
     if unsigned.startswith("0x"):
-        return int(s, 16)
+        value = int(s, 16)
     elif unsigned.startswith("0o"):
-        return int(s, 8)
+        value = int(s, 8)
     elif unsigned.startswith("0b"):
-        return int(s, 2)
+        value = int(s, 2)
     elif "." in s:
         # Casting to a float first allows for things like "30.0"
         # We handle this conditionally because very large integers can lose
         # meaningful precision when cast to a float.
-        return int(round(float(s)))
+        value = int(round(float(s)))
     else:
-        return int(s)
+        value = int(s)
+    return type_(value)
 
 
-def _bytes(s: str) -> bytes:
-    return bytes(s, encoding="utf8")
+def _bytes(type_: type[bytes], s: str) -> bytes:
+    return type_(s.encode("utf8"))
 
 
-def _bytearray(s: str) -> bytearray:
-    return bytearray(_bytes(s))
+def _bytearray(type_: type[bytearray], s: str) -> bytearray:
+    return type_(s.encode("utf8"))
 
 
-def _date(s: str) -> date:
+def _date(type_: type[date], s: str) -> date:
     """Parse a date string.
 
     Returns
     -------
     datetime.date
     """
-    return date.fromisoformat(s)
+    return type_.fromisoformat(s)
 
 
-def _datetime(s: str) -> datetime:
+def _datetime(type_: type[datetime], s: str) -> datetime:
     """Parse a datetime string.
 
     Returns
@@ -163,20 +167,65 @@
     datetime.datetime
     """
     try:
-        return datetime.fromisoformat(s)
+        return type_.fromisoformat(s)
     except ValueError:
         # fromisoformat() rejects surrounding whitespace; strip it and 
normalize the
         # date/time separator to 'T' before retrying.
-        return datetime.fromisoformat(s.strip().replace(" ", "T", 1))
+        return type_.fromisoformat(s.strip().replace(" ", "T", 1))
 
 
-def _timedelta(s: str) -> timedelta:
+def _time(type_: type[time], s: str) -> time:
+    """Parse a time of day string.
+
+    Returns
+    -------
+    datetime.time
+    """
+    return type_.fromisoformat(s)
+
+
+# Separators must be consistent ("+HH:MM:SS" or "+HHMMSS"); the fraction is 
capped at microsecond precision.
+_UTC_OFFSET_RE = re.compile(
+    r"(?P<sign>[+-])(?P<hours>\d{2})"
+    
r"(?:(?P<sep>:?)(?P<minutes>\d{2})(?:(?P=sep)(?P<seconds>\d{2})(?:\.(?P<fraction>\d{1,6}))?)?)?",
+    re.ASCII,
+)
+
+
+def _timezone(type_: type[timezone], s: str) -> timezone:
+    """Parse a UTC offset such as ``+02:00``, ``-0530`` or ``Z``, or ``UTC``.
+
+    Returns
+    -------
+    datetime.timezone
+    """
+    s = s.strip()
+    if s.upper() in ("UTC", "Z"):
+        return type_.utc
+    match = _UTC_OFFSET_RE.fullmatch(s)
+    if match is None:
+        raise ValueError(f'Unable to interpret "{s}" as a UTC offset.')
+    hours, minutes, seconds = (int(match[name] or 0) for name in ("hours", 
"minutes", "seconds"))
+    if minutes > 59 or seconds > 59:
+        raise ValueError(f'Unable to interpret "{s}" as a UTC offset.')
+    microseconds = int((match["fraction"] or "").ljust(6, "0"))
+    offset = timedelta(hours=hours, minutes=minutes, seconds=seconds, 
microseconds=microseconds)
+    # timezone() itself rejects offsets of 24 hours or more.
+    return type_(-offset if match["sign"] == "-" else offset)
+
+
+def _timedelta(type_: type[timedelta], s: str) -> timedelta:
     """Parse a timedelta string."""
     s = s.strip()
     negative = False
     if s.startswith("-"):
         negative = True
         s = s[1:]
+    elif s.startswith("+"):
+        # An explicit "+" is accepted for symmetry with "-", matching how
+        # _int() treats a leading sign. A second sign still fails below,
+        # because the remaining text no longer reassembles into s.
+        s = s[1:]
 
     matches = re.findall(r"((\d+\.\d+|\d+)([smhdwMy]))", s)
 
@@ -208,10 +257,10 @@
 
     if negative:
         seconds = -seconds
-    return timedelta(seconds=seconds)
+    return type_(seconds=seconds)
 
 
-def _slice(s: str) -> slice:
+def _slice(type_: type[slice], s: str) -> slice:
     """Parse a string in slice notation.
 
     Examples: ``0:3``, ``:10``, ``0:100:5``, ``-10:``. Empty fields map to 
:obj:`None`.
@@ -223,9 +272,20 @@
     parts = s.split(":")
     if 2 <= len(parts) <= 3:
         try:
-            return slice(*(int(part) if part.strip() else None for part in 
parts))
+            result = slice(*(int(part) if part.strip() else None for part in 
parts))
         except ValueError:
             pass
+        else:
+            if result.step == 0:
+                # slice() accepts a zero step, but every use of the result
+                # raises "slice step cannot be zero". Reject it here so the
+                # failure surfaces as a coercion error at parse time rather
+                # than from inside the command.
+                raise CoercionError(
+                    target_type=slice,
+                    msg=f'Unable to interpret "{s}" as a slice; the step 
cannot be zero.',
+                )
+            return result
     raise CoercionError(
         target_type=slice,
         msg=f'Unable to interpret "{s}" as a slice; expected "start:stop" or 
"start:stop:step" with integer or empty fields (e.g. "0:3", ":10", "0:100:5").',
@@ -288,7 +348,25 @@
     )
 
 
-# For types that need more logic than just invoking their type
+def _zoneinfo(type_: Any, s: str):
+    try:
+        return type_(s)
+    except LookupError as e:
+        # ``ZoneInfoNotFoundError`` subclasses ``KeyError``; bad input is 
reported via ``ValueError``.
+        raise ValueError(str(e)) from e
+
+
+def _any(type_: Any, s: str) -> Any:
+    return s if type_ is Any else type_(s)
+
+
+def _construct(type_: Any, s: str) -> Any:
+    """Fallback converter for types without a ``_converters`` entry: call the 
type with the string."""
+    return type_(s)
+
+
+# For types that need more logic than just invoking their type.
+# Each converter takes ``(type_, s)``; ``type_`` may be a subclass of the key, 
which the converter must build.
 _converters: dict[Any, Callable] = {
     bool: _bool,
     int: _int,
@@ -296,13 +374,26 @@
     bytearray: _bytearray,
     date: _date,
     datetime: _datetime,
+    time: _time,
+    timezone: _timezone,
     timedelta: _timedelta,
     NoneType: _none,
     slice: _slice,
-    Any: str,
+    Any: _any,
+    # Keyed by ``"module.qualname"`` to avoid importing the module at cyclopts 
import time.
+    "zoneinfo.ZoneInfo": _zoneinfo,
 }
 
 
+@lru_cache(maxsize=1024)
+def _get_converter(type_: Any) -> Callable[[Any, str], Any]:
+    for base in getattr(type_, "__mro__", (type_,)):
+        for key in (base, f"{getattr(base, '__module__', '')}.{getattr(base, 
'__qualname__', '')}"):
+            if (converter := _converters.get(key)) is not None:
+                return converter
+    return _construct
+
+
 def _convert_tuple(
     type_: type[Any],
     *tokens: "Token",
@@ -836,7 +927,7 @@
                         # ``CoercionError`` appends the pydantic reason from 
``__cause__``.
                         raise CoercionError(token=token, target_type=type_) 
from e
                 elif converter is None:
-                    out = _converters.get(type_, type_)(token.value)  # 
pyright: ignore[reportOptionalCall]
+                    out = _get_converter(type_)(type_, token.value)
                 elif converter_needs_token:
                     out = converter(type_, token)  # pyright: 
ignore[reportArgumentType]
                 else:
@@ -847,7 +938,7 @@
                 if e.token is None:
                     e.token = token
                 raise
-            except (ValueError, OverflowError):
+            except (ValueError, ArithmeticError):
                 raise CoercionError(token=token, target_type=type_) from None
         else:
             # Convert it into a user-supplied class.
@@ -1326,7 +1417,7 @@
         return 1, False
     token = upcoming_tokens[0]
     try:
-        _bool(token.value)
+        _bool(bool, token.value)
     except CoercionError:
         pass
     else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/cyclopts/_version.py 
new/cyclopts-5.7.1/cyclopts/_version.py
--- old/cyclopts-5.5.3/cyclopts/_version.py     2020-02-02 01:00:00.000000000 
+0100
+++ new/cyclopts-5.7.1/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 = '5.5.3'
-__version_tuple__ = version_tuple = (5, 5, 3)
+__version__ = version = '5.7.1'
+__version_tuple__ = version_tuple = (5, 7, 1)
 
 __commit_id__ = commit_id = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/cyclopts/annotations.py 
new/cyclopts-5.7.1/cyclopts/annotations.py
--- old/cyclopts-5.5.3/cyclopts/annotations.py  2020-02-02 01:00:00.000000000 
+0100
+++ new/cyclopts-5.7.1/cyclopts/annotations.py  2020-02-02 01:00:00.000000000 
+0100
@@ -1,6 +1,7 @@
 import inspect
 import sys
 import typing
+from collections import deque
 from collections.abc import (
     Callable,
     Collection,
@@ -32,6 +33,7 @@
     Iterable,
     typing.Sequence,
     Sequence,
+    deque,
     frozenset,
     list,
     set,
@@ -49,6 +51,7 @@
     MutableSequence,
     Set,
     MutableSet,
+    deque,
     frozenset,
     list,
     set,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/cyclopts/argument/_argument.py 
new/cyclopts-5.7.1/cyclopts/argument/_argument.py
--- old/cyclopts-5.5.3/cyclopts/argument/_argument.py   2020-02-02 
01:00:00.000000000 +0100
+++ new/cyclopts-5.7.1/cyclopts/argument/_argument.py   2020-02-02 
01:00:00.000000000 +0100
@@ -500,7 +500,7 @@
         if not _accepts_timedelta(self.hint):
             return False
         try:
-            _timedelta(token)
+            _timedelta(timedelta, token)
         except ValueError:
             return False
         except OverflowError:
@@ -1047,7 +1047,7 @@
 
             if self._enum_flag_type and member in (None, self._enum_flag_type):
                 out |= enum_flag_from_dict(self._enum_flag_type, data, 
self.parameter.name_transform)
-                if not out:
+                if not out and not data:
                     out = UNSET
             elif instantiate:
                 # Use resolved_hint to get the actual class type (Optional 
stripped)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/cyclopts/bind.py 
new/cyclopts-5.7.1/cyclopts/bind.py
--- old/cyclopts-5.5.3/cyclopts/bind.py 2020-02-02 01:00:00.000000000 +0100
+++ new/cyclopts-5.7.1/cyclopts/bind.py 2020-02-02 01:00:00.000000000 +0100
@@ -10,7 +10,7 @@
 from typing import TYPE_CHECKING, Any, NamedTuple, get_args
 
 from cyclopts._convert import _bool, _none, create_empty_instance
-from cyclopts.annotations import is_nonetype, is_union
+from cyclopts.annotations import NoneType, is_nonetype, is_union
 from cyclopts.argument import Argument, ArgumentCollection
 from cyclopts.argument._collection import earlier_source_filter, 
expand_json_objects
 from cyclopts.exceptions import (
@@ -639,7 +639,7 @@
     ):
         return False
     try:
-        _none(value)
+        _none(NoneType, value)
     except CoercionError:
         return False
     return True
@@ -893,7 +893,7 @@
                     
match.argument.append(CliToken(keyword=match.matched_token, 
implicit_value=None))
                 elif cli_values:
                     try:
-                        coerced_value = _bool(cli_values[-1])
+                        coerced_value = _bool(bool, cli_values[-1])
                     except CoercionError as e:
                         if e.token is None:
                             e.token = CliToken(keyword=match.matched_token, 
value=cli_values[-1])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/cyclopts/utils.py 
new/cyclopts-5.7.1/cyclopts/utils.py
--- old/cyclopts-5.5.3/cyclopts/utils.py        2020-02-02 01:00:00.000000000 
+0100
+++ new/cyclopts-5.7.1/cyclopts/utils.py        2020-02-02 01:00:00.000000000 
+0100
@@ -281,12 +281,15 @@
             # ``complex`` cannot parse base-prefixed integers (e.g. ``-0xFF``, 
``-0b101``).
             int(token, 0)
             return False
+        if re.fullmatch(r"-\d+(_\d+)*/\d+(_\d+)*", token):
+            # A negative fraction, e.g. ``-1/2``.
+            return False
         # Lazy imports to avoid a circular import (exceptions/_convert import 
utils).
         from cyclopts._convert import _slice
         from cyclopts.exceptions import CoercionError
 
         with suppress(CoercionError):
-            _slice(token)
+            _slice(slice, token)
             return False
     return token.startswith("-")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.3/cyclopts/validators/_path.py 
new/cyclopts-5.7.1/cyclopts/validators/_path.py
--- old/cyclopts-5.5.3/cyclopts/validators/_path.py     2020-02-02 
01:00:00.000000000 +0100
+++ new/cyclopts-5.7.1/cyclopts/validators/_path.py     2020-02-02 
01:00:00.000000000 +0100
@@ -1,3 +1,4 @@
+import errno
 import pathlib
 from collections.abc import Iterable, Sequence
 from typing import Any
@@ -12,6 +13,22 @@
     return tuple(e.lower().lstrip(".") for e in to_tuple_converter(value))
 
 
+def _has_extension(path: pathlib.Path, ext: Sequence[str]) -> bool:
+    # Match against the full name so multi-part extensions work; like 
``Path.suffix``, require a non-empty stem.
+    name = path.name.lower()
+    return any(len(name) > len(e) + 1 and name.endswith("." + e) for e in ext)
+
+
+def _exists(path: pathlib.Path) -> bool:
+    try:
+        return path.exists()
+    except OSError as e:
+        if e.errno == errno.ENAMETOOLONG:
+            # A name that is too long for the file system cannot exist.
+            return False
+        raise
+
+
 @frozen(kw_only=True)
 class Path:
     """Assertions on properties of :class:`pathlib.Path`.
@@ -87,6 +104,7 @@
     """
     Supplied path must have this extension (case insensitive).
     May or may not include the ".".
+    A multi-part extension (``"<a>.<b>"``) is matched against the end of the 
file name.
     """
 
     def __attrs_post_init__(self):
@@ -102,14 +120,14 @@
             if not isinstance(path, pathlib.Path):
                 return
 
-            if self.ext and path.suffix.lower().lstrip(".") not in self.ext:
+            if self.ext and not _has_extension(path, self.ext):
                 if len(self.ext) == 1:
                     raise ValueError(f'"{path}" must have extension 
"{self.ext[0]}".')
                 else:
                     pretty_ext = "{" + ", ".join(f'"{x}"' for x in self.ext) + 
"}"
                     raise ValueError(f'"{path}" does not match one of 
supported extensions {pretty_ext}.')
 
-            if path.exists():
+            if _exists(path):
                 if not self.file_okay and path.is_file():
                     if self.dir_okay:
                         raise ValueError(f'Only directory is allowed, but 
"{path}" is a file.')

Reply via email to