Skip to content

[Packaging] Support Python 3.13#31895

Merged
bebound merged 3 commits into
Azure:devfrom
bebound:support-3.13
Aug 20, 2025
Merged

[Packaging] Support Python 3.13#31895
bebound merged 3 commits into
Azure:devfrom
bebound:support-3.13

Merge branch 'dev' into support-3.13

e4f89f7
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Azure.azure-cli Full Test succeeded Aug 13, 2025 in 20m 53s

Build #20250813.7 had test failures

Details

Tests

  • Failed: 1 (0.01%, 1 new, 0 recurring)
  • Passed: 8,325 (85.74%)
  • Other: 1,384 (14.25%)
  • Total: 9,710

Annotations

Check failure on line 1 in test_defer_only_commands

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-cli Full Test

test_defer_only_commands

cmd_obj = <azure.cli.core.commands.AzCliCommand object at 0x7f7e28d262a0>
operation = <bound method VirtualMachineImageTemplatesOperations.get of <azure.mgmt.imagebuilder.operations._virtual_machine_image_templates_operations.VirtualMachineImageTemplatesOperations object at 0x7f7e28d269f0>>
args = ()
kwargs = {'image_template_name': 'template01', 'resource_group_name': 'img_defer_only_commands000001'}
_get_operation = <function cached_get.<locals>._get_operation at 0x7f7e28d2c0e0>
model_path = None
cache_obj = <azure.cli.core.commands.CacheObject object at 0x7f7e28d26c00>
message = "ImageTemplate 'template01' not found in cache. Retrieving from Azure..."

    def cached_get(cmd_obj, operation, *args, **kwargs):
    
        def _get_operation():
            result = None
            if args:
                result = operation(*args)
            elif kwargs is not None:
                result = operation(**kwargs)
            return result
    
        # early out if the command does not use the cache
        if not cmd_obj.command_kwargs.get('supports_local_cache', False):
            return _get_operation()
    
        # allow overriding model path, e.g. for extensions
        model_path = cmd_obj.command_kwargs.get('model_path', None)
    
        cache_obj = CacheObject(cmd_obj, None, operation, model_path=model_path)
        try:
            cache_obj.load(args, kwargs)
>           if _is_stale(cmd_obj.cli_ctx, cache_obj):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/azure-cli-core/azure/cli/core/commands/__init__.py:425: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/azure-cli-core/azure/cli/core/commands/__init__.py:401: in _is_stale
    time_cache = datetime.datetime.strptime(cache_obj.last_saved, '%Y-%m-%d %H:%M:%S.%f')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/_strptime.py:653: in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

data_string = '2025-08-13 06:17:09', format = '%Y-%m-%d %H:%M:%S.%f'

    def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
        """Return a 2-tuple consisting of a time struct and an int containing
        the number of microseconds based on the input string and the
        format string."""
    
        for index, arg in enumerate([data_string, format]):
            if not isinstance(arg, str):
                msg = "strptime() argument {} must be str, not {}"
                raise TypeError(msg.format(index, type(arg)))
    
        global _TimeRE_cache, _regex_cache
        with _cache_lock:
            locale_time = _TimeRE_cache.locale_time
            if (_getlang() != locale_time.lang or
                time.tzname != locale_time.tzname or
                time.daylight != locale_time.daylight):
                _TimeRE_cache = TimeRE()
                _regex_cache.clear()
                locale_time = _TimeRE_cache.locale_time
            if len(_regex_cache) > _CACHE_MAX_SIZE:
                _regex_cache.clear()
            format_regex = _regex_cache.get(format)
            if not format_regex:
                try:
                    format_regex = _TimeRE_cache.compile(format)
                # KeyError raised when a bad format is found; can be specified as
                # \\, in which case it was a stray % but with a space after it
                except KeyError as err:
                    bad_directive = err.args[0]
                    if bad_directive == "\\":
                        bad_directive = "%"
                    del err
                    raise ValueError("'%s' is a bad directive in format '%s'" %
                                        (bad_directive, format)) from None
                # IndexError only occurs when 
Raw output
cmd_obj = <azure.cli.core.commands.AzCliCommand object at 0x7f7e28d262a0>
operation = <bound method VirtualMachineImageTemplatesOperations.get of <azure.mgmt.imagebuilder.operations._virtual_machine_image_templates_operations.VirtualMachineImageTemplatesOperations object at 0x7f7e28d269f0>>
args = ()
kwargs = {'image_template_name': 'template01', 'resource_group_name': 'img_defer_only_commands000001'}
_get_operation = <function cached_get.<locals>._get_operation at 0x7f7e28d2c0e0>
model_path = None
cache_obj = <azure.cli.core.commands.CacheObject object at 0x7f7e28d26c00>
message = "ImageTemplate 'template01' not found in cache. Retrieving from Azure..."

    def cached_get(cmd_obj, operation, *args, **kwargs):
    
        def _get_operation():
            result = None
            if args:
                result = operation(*args)
            elif kwargs is not None:
                result = operation(**kwargs)
            return result
    
        # early out if the command does not use the cache
        if not cmd_obj.command_kwargs.get('supports_local_cache', False):
            return _get_operation()
    
        # allow overriding model path, e.g. for extensions
        model_path = cmd_obj.command_kwargs.get('model_path', None)
    
        cache_obj = CacheObject(cmd_obj, None, operation, model_path=model_path)
        try:
            cache_obj.load(args, kwargs)
>           if _is_stale(cmd_obj.cli_ctx, cache_obj):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/azure-cli-core/azure/cli/core/commands/__init__.py:425: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/azure-cli-core/azure/cli/core/commands/__init__.py:401: in _is_stale
    time_cache = datetime.datetime.strptime(cache_obj.last_saved, '%Y-%m-%d %H:%M:%S.%f')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/_strptime.py:653: in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

data_string = '2025-08-13 06:17:09', format = '%Y-%m-%d %H:%M:%S.%f'

    def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
        """Return a 2-tuple consisting of a time struct and an int containing
        the number of microseconds based on the input string and the
        format string."""
    
        for index, arg in enumerate([data_string, format]):
            if not isinstance(arg, str):
                msg = "strptime() argument {} must be str, not {}"
                raise TypeError(msg.format(index, type(arg)))
    
        global _TimeRE_cache, _regex_cache
        with _cache_lock:
            locale_time = _TimeRE_cache.locale_time
            if (_getlang() != locale_time.lang or
                time.tzname != locale_time.tzname or
                time.daylight != locale_time.daylight):
                _TimeRE_cache = TimeRE()
                _regex_cache.clear()
                locale_time = _TimeRE_cache.locale_time
            if len(_regex_cache) > _CACHE_MAX_SIZE:
                _regex_cache.clear()
            format_regex = _regex_cache.get(format)
            if not format_regex:
                try:
                    format_regex = _TimeRE_cache.compile(format)
                # KeyError raised when a bad format is found; can be specified as
                # \\, in which case it was a stray % but with a space after it
                except KeyError as err:
                    bad_directive = err.args[0]
                    if bad_directive == "\\":
                        bad_directive = "%"
                    del err
                    raise ValueError("'%s' is a bad directive in format '%s'" %
                                        (bad_directive, format)) from None
                # IndexError only occurs when