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-11-17 17:18:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-cyclopts (Old)
 and      /work/SRC/openSUSE:Factory/.python-cyclopts.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-cyclopts"

Tue Nov 17 17:18:31 2026 rev:30 rq:1398003 version:5.5.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-cyclopts/python-cyclopts.changes  
2026-11-16 09:13:25.431259018 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-cyclopts.new.1251/python-cyclopts.changes    
    2026-11-17 17:20:21.531512194 +0100
@@ -1,0 +2,11 @@
+Mon Nov 16 20:32:25 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 5.5.2 (PyPI releases 2026-11-16, jumps over 5.5.1):
+  * Parse negative numbers as positionals when the command has
+    **kwargs; explicitly named options still win
+  * Reload a config file that goes missing and is restored
+    unchanged instead of returning the empty mapping
+  * Accept negative durations such as -1h30m as values for
+    timedelta parameters, positionally and after an option
+
+-------------------------------------------------------------------

Old:
----
  cyclopts-5.5.0.tar.gz

New:
----
  cyclopts-5.5.2.tar.gz

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

Other differences:
------------------
++++++ python-cyclopts.spec ++++++
--- /var/tmp/diff_new_pack.bJTwdQ/_old  2026-11-17 17:20:22.105536423 +0100
+++ /var/tmp/diff_new_pack.bJTwdQ/_new  2026-11-17 17:20:22.106536466 +0100
@@ -18,7 +18,7 @@
 
 %bcond_without libalternatives
 Name:           python-cyclopts
-Version:        5.5.0
+Version:        5.5.2
 Release:        0
 Summary:        Intuitive, easy CLIs based on python type hints
 License:        Apache-2.0

++++++ cyclopts-5.5.0.tar.gz -> cyclopts-5.5.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.0/PKG-INFO new/cyclopts-5.5.2/PKG-INFO
--- old/cyclopts-5.5.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
+++ new/cyclopts-5.5.2/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.5
 Name: cyclopts
-Version: 5.5.0
+Version: 5.5.2
 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.0/cyclopts/_version.py 
new/cyclopts-5.5.2/cyclopts/_version.py
--- old/cyclopts-5.5.0/cyclopts/_version.py     2020-02-02 01:00:00.000000000 
+0100
+++ new/cyclopts-5.5.2/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.0'
-__version_tuple__ = version_tuple = (5, 5, 0)
+__version__ = version = '5.5.2'
+__version_tuple__ = version_tuple = (5, 5, 2)
 
 __commit_id__ = commit_id = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.0/cyclopts/argument/_argument.py 
new/cyclopts-5.5.2/cyclopts/argument/_argument.py
--- old/cyclopts-5.5.0/cyclopts/argument/_argument.py   2020-02-02 
01:00:00.000000000 +0100
+++ new/cyclopts-5.5.2/cyclopts/argument/_argument.py   2020-02-02 
01:00:00.000000000 +0100
@@ -6,6 +6,7 @@
 import sys
 from collections.abc import Callable, Mapping, Sequence
 from contextlib import suppress
+from datetime import timedelta
 from functools import partial, reduce
 from typing import TYPE_CHECKING, Any, Literal, get_args, get_origin
 
@@ -13,6 +14,7 @@
 
 from cyclopts._convert import (
     _convert_entry,
+    _timedelta,
     _validate_json_extra_keys,
     create_empty_instance,
     instantiate_from_dict,
@@ -58,7 +60,7 @@
 )
 from cyclopts.parameter import ITERATIVE_BOOL_IMPLICIT_VALUE, Parameter
 from cyclopts.token import Token
-from cyclopts.utils import UNSET, grouper, is_builtin, is_class_and_subclass, 
parse_version
+from cyclopts.utils import UNSET, grouper, is_builtin, is_class_and_subclass, 
is_option_like, parse_version
 
 from .utils import (
     enum_flag_from_dict,
@@ -84,6 +86,11 @@
     return is_nonetype(hint)
 
 
+def _accepts_timedelta(hint: Any) -> bool:
+    hint = resolve(hint)
+    return is_class_and_subclass(hint, timedelta) or any(_accepts_timedelta(x) 
for x in get_args(hint))
+
+
 @define(kw_only=True)
 class Argument:
     """Encapsulates functionality and additional contextual information for 
parsing a parameter.
@@ -481,6 +488,25 @@
                 return False
         return True
 
+    def _is_option_like(self, token: str) -> bool:
+        """Whether ``token`` is an option rather than a value for this 
argument.
+
+        A negative duration (e.g. ``-1h30m``) is a value only where a 
:class:`~datetime.timedelta`
+        is accepted; elsewhere it could be combined short flags (e.g. ``-1d``).
+        """
+        return not self.parameter.allow_leading_hyphen and 
is_option_like(token) and not self._is_duration(token)
+
+    def _is_duration(self, token: str) -> bool:
+        if not _accepts_timedelta(self.hint):
+            return False
+        try:
+            _timedelta(token)
+        except ValueError:
+            return False
+        except OverflowError:
+            pass  # Out of range, but still a duration; conversion reports it.
+        return True
+
     def match(
         self,
         term: str | int,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.0/cyclopts/bind.py 
new/cyclopts-5.5.2/cyclopts/bind.py
--- old/cyclopts-5.5.0/cyclopts/bind.py 2020-02-02 01:00:00.000000000 +0100
+++ new/cyclopts-5.5.2/cyclopts/bind.py 2020-02-02 01:00:00.000000000 +0100
@@ -645,6 +645,29 @@
     return True
 
 
+def _match_option(argument_collection: ArgumentCollection, cli_option: str, 
token: str) -> _KeywordMatch:
+    """Match ``cli_option`` (the option part of ``token``) to its argument.
+
+    Raises
+    ------
+    ValueError
+        If nothing matches, or only ``**kwargs`` matches a negative number, 
slice, or
+        a negative duration that a positional parameter accepts.
+        ``**kwargs`` matches any hyphenated token, but such a token is a 
value, so
+        only an explicitly named option (e.g. ``-1``) claims it.
+    """
+    match = _KeywordMatch(cli_option, *argument_collection.match(cli_option))
+    if match.argument.field_info.kind is match.argument.field_info.VAR_KEYWORD 
and (
+        not is_option_like(token)
+        or (
+            not token.startswith("--")
+            and any(x.parse and x.field_info.is_positional and 
x._is_duration(token) for x in argument_collection)
+        )
+    ):
+        raise ValueError
+    return match
+
+
 def _parse_kw_and_flags(
     argument_collection: ArgumentCollection,
     tokens: Sequence[str],
@@ -747,7 +770,7 @@
         claimed_part: str = token
         partial_remainder: str | None = None
         try:
-            matches.append(_KeywordMatch(cli_option, 
*argument_collection.match(cli_option)))
+            matches.append(_match_option(argument_collection, cli_option, 
token))
         except ValueError:
             # Length has to be greater than 2 (hyphen + character) to be 
exploded.
             # Also exclude numeric values (e.g., -10, -3.14) from combined 
flag parsing.
@@ -763,7 +786,7 @@
                     test_flag = f"-{char}"
 
                     try:
-                        arg, keys, implicit = 
argument_collection.match(test_flag)
+                        _, arg, keys, implicit = 
_match_option(argument_collection, test_flag, token)
 
                         if implicit is not UNSET or arg.parameter.count:
                             # This is a flag (boolean or counting) - consume 
just this character
@@ -898,10 +921,7 @@
                 and not match.keys
                 and is_union(match.argument.resolved_hint)
                 and bool in get_args(match.argument.resolved_hint)
-                and (
-                    i + 1 >= len(tokens)
-                    or (not match.argument.parameter.allow_leading_hyphen and 
is_option_like(tokens[i + 1]))
-                )
+                and (i + 1 >= len(tokens) or 
match.argument._is_option_like(tokens[i + 1]))
             ):
                 # A union containing ``bool`` (e.g. ``bool | list[str]``) 
given no value acts as a flag.
                 match.argument.append(CliToken(keyword=match.matched_token, 
implicit_value=True))
@@ -961,7 +981,7 @@
                         # Then consume from the remaining tokens
                         for j in itertools.count(pre_extracted_count):
                             token = upcoming_tokens[j]
-                            if not 
match.argument.parameter.allow_leading_hyphen and is_option_like(token.value):
+                            if match.argument._is_option_like(token.value):
                                 break
                             consumed_tokens.append(token)
                             cli_values.append(token.value)
@@ -987,7 +1007,7 @@
                                 break
 
                             token = upcoming_tokens[idx]
-                            if not 
match.argument.parameter.allow_leading_hyphen and is_option_like(token.value):
+                            if match.argument._is_option_like(token.value):
                                 raise MissingArgumentError(
                                     argument=match.argument,
                                     tokens_so_far=cli_values,
@@ -1187,7 +1207,7 @@
                 # end-of-options delimiter, and ``force_positional`` marks 
tokens
                 # after it, which must not be treated as options.
                 token, force_positional = tokens_and_force_positional[0]
-                if not force_positional and not 
argument.parameter.allow_leading_hyphen and is_option_like(token):
+                if not force_positional and argument._is_option_like(token):
                     # It's more meaningful to interpret the token as an 
intended option,
                     # rather than an intended positional value for 
``argument``.
                     raise UnknownOptionError(token=CliToken(value=token), 
argument_collection=argument_collection)
@@ -1231,7 +1251,7 @@
                 )
 
             for index, (token_str, force_positional) in 
enumerate(tokens_and_force_positional[:tokens_per_element]):
-                if not force_positional and not 
argument.parameter.allow_leading_hyphen and is_option_like(token_str):
+                if not force_positional and 
argument._is_option_like(token_str):
                     raise UnknownOptionError(token=CliToken(value=token_str), 
argument_collection=argument_collection)
                 new_tokens.append(CliToken(value=token_str, index=index))
             tokens_and_force_positional = 
tokens_and_force_positional[tokens_per_element:]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cyclopts-5.5.0/cyclopts/config/_common.py 
new/cyclopts-5.5.2/cyclopts/config/_common.py
--- old/cyclopts-5.5.0/cyclopts/config/_common.py       2020-02-02 
01:00:00.000000000 +0100
+++ new/cyclopts-5.5.2/cyclopts/config/_common.py       2020-02-02 
01:00:00.000000000 +0100
@@ -197,6 +197,7 @@
             raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), 
str(self.path))
 
         self._config = {}
+        self._config_cache_key = None
         return self._config
 
     @property

Reply via email to