Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-lazy-imports for
openSUSE:Factory checked in at 2026-03-11 20:57:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-lazy-imports (Old)
and /work/SRC/openSUSE:Factory/.python-lazy-imports.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-lazy-imports"
Wed Mar 11 20:57:27 2026 rev:2 rq:1338310 version:1.2.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-lazy-imports/python-lazy-imports.changes
2025-09-09 20:31:30.424417313 +0200
+++
/work/SRC/openSUSE:Factory/.python-lazy-imports.new.8177/python-lazy-imports.changes
2026-03-11 20:59:44.188848207 +0100
@@ -1,0 +2,7 @@
+Mon Dec 29 10:21:26 UTC 2025 - Elisei Roca <[email protected]>
+
+- Update to version 1.2.0:
+ * Bump python to 3.10 and modernize
+ * Add support for Python 3.14
+
+-------------------------------------------------------------------
Old:
----
python-lazy-imports-1.0.1.tar.gz
New:
----
python-lazy-imports-1.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-lazy-imports.spec ++++++
--- /var/tmp/diff_new_pack.gEMyPv/_old 2026-03-11 20:59:45.340895652 +0100
+++ /var/tmp/diff_new_pack.gEMyPv/_new 2026-03-11 20:59:45.344895816 +0100
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-lazy-imports
-Version: 1.0.1
+Version: 1.2.0
Release: 0
Summary: Tool to support lazy imports
License: Apache-2.0
++++++ python-lazy-imports-1.0.1.tar.gz -> python-lazy-imports-1.2.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/.github/workflows/release.yml
new/lazy-imports-1.2.0/.github/workflows/release.yml
--- old/lazy-imports-1.0.1/.github/workflows/release.yml 2025-08-09
09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/.github/workflows/release.yml 2025-12-28
14:31:51.000000000 +0100
@@ -8,8 +8,8 @@
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
+ - uses: actions/checkout@v6
+ - uses: actions/setup-python@v6
with:
python-version: "3.x"
@@ -20,7 +20,7 @@
- run: |
python setup.py sdist bdist_wheel
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v6
with:
name: dist
path: dist/
@@ -34,7 +34,7 @@
id-token: write
steps:
- - uses: actions/download-artifact@v4
+ - uses: actions/download-artifact@v7
with:
name: dist
path: dist/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lazy-imports-1.0.1/.github/workflows/static_checks.yml
new/lazy-imports-1.2.0/.github/workflows/static_checks.yml
--- old/lazy-imports-1.0.1/.github/workflows/static_checks.yml 2025-08-09
09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/.github/workflows/static_checks.yml 2025-12-28
14:31:51.000000000 +0100
@@ -19,15 +19,15 @@
strategy:
matrix:
python-version:
- - "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
+ - "3.14"
steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
+ - uses: actions/checkout@v6
+ - uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
@@ -37,7 +37,7 @@
pip install --progress-bar off -U .[checking,testing]
- run: pydocstyle --count ${{ env.src }} ${{ env.other-src }}
- - run: black ${{ env.src }} ${{ env.test-src }} ${{ env.other-src }}
--check --diff
+ - run: black ${{ env.src }} ${{ env.test-src }} ${{ env.other-src }}
--check --diff --target-version py310
- run: flake8 ${{ env.src }} ${{ env.other-src }}
- run: isort ${{ env.src }} ${{ env.test-src }} ${{ env.other-src }}
--check --diff
- run: mdformat --check *.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/CHANGELOG.md
new/lazy-imports-1.2.0/CHANGELOG.md
--- old/lazy-imports-1.0.1/CHANGELOG.md 2025-08-09 09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/CHANGELOG.md 2025-12-28 14:31:51.000000000 +0100
@@ -1,5 +1,13 @@
# Changelog
+## 1.2.0
+
+Bump python to 3.10 and modernize.
+
+## 1.1.0
+
+Adds support for Python 3.14.
+
## 1.0.1
### Bug Fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/CONTRIBUTING.md
new/lazy-imports-1.2.0/CONTRIBUTING.md
--- old/lazy-imports-1.0.1/CONTRIBUTING.md 2025-08-09 09:10:08.000000000
+0200
+++ new/lazy-imports-1.2.0/CONTRIBUTING.md 2025-12-28 14:31:51.000000000
+0100
@@ -2,15 +2,17 @@
## Table of Contents
-- [Code of Conduct](#code-of-conduct)
-- [Reporting Bugs and Issues](#reporting-bugs-and-issues)
-- [Engaging in our Project](#engaging-in-our-project)
-- [Pull Request Checklist](#pull-request-checklist)
-- [Contributing Code](#contributing-code)
-- [Contributing Documentation](#contributing-documentation)
-- [Testing, linting and formatting](#testing-linting-and-formatting)
-- [Style Guidelines](#style-guidelines)
-- [Code Owners](#code-owners)
+- [Contributing](#contributing)
+ - [Table of Contents](#table-of-contents)
+ - [Code of Conduct](#code-of-conduct)
+ - [Reporting Bugs and Issues](#reporting-bugs-and-issues)
+ - [Engaging in our Project](#engaging-in-our-project)
+ - [Pull Request Checklist](#pull-request-checklist)
+ - [Contributing Code](#contributing-code)
+ - [Contributing Documentation](#contributing-documentation)
+ - [Testing, linting and formatting](#testing-linting-and-formatting)
+ - [Style Guidelines](#style-guidelines)
+ - [Code Owners](#code-owners)
## Code of Conduct
@@ -110,7 +112,7 @@
You will probably want to install it in "editable mode" if you are developing
locally.
```bash
-$ pip install -e .[testing,checking]
+$ pip install -e '.[testing,checking]'
```
Unit tests can then be run as follows:
@@ -133,7 +135,7 @@
## Style Guidelines
-- The code must be compatible with Python 3.9 and higher.
+- The code must be compatible with Python 3.10 and higher.
- Max line length is 119
- Docstrings
- Use the [Google docstring
format](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/Makefile
new/lazy-imports-1.2.0/Makefile
--- old/lazy-imports-1.0.1/Makefile 2025-08-09 09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/Makefile 2025-12-28 14:31:51.000000000 +0100
@@ -4,7 +4,7 @@
check:
pydocstyle --count $(src) $(other-src)
- black $(src) $(test-src) $(other-src) --check --diff
+ black $(src) $(test-src) $(other-src) --check --diff --target-version
py310
flake8 $(src) $(other-src)
isort $(src) $(test-src) $(other-src) --check --diff
mdformat --check *.md
@@ -12,7 +12,7 @@
pylint $(src)
format:
- black $(src) $(test-src) $(other-src)
+ black $(src) $(test-src) $(other-src) --target-version py310
isort $(src) $(test-src) $(other-src)
mdformat *.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/README.md
new/lazy-imports-1.2.0/README.md
--- old/lazy-imports-1.0.1/README.md 2025-08-09 09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/README.md 2025-12-28 14:31:51.000000000 +0100
@@ -12,7 +12,7 @@
[`lazy-imports`](https://pypi.org/project/lazy-imports/) is available on [the
Python Package Index (PyPI)](https://pypi.org/project/lazy-imports/).
-> [!WARNING]
+> [!IMPORTANT]
> Python's import system is highly complex and side effects are ubiquitous.
> Although employing lazy imports (in a sanely structured project) is quite
> safe, you should keep in mind that there are necessarily subtle differences
> between lazy and ordinary (eager) imports/modules.
@@ -21,6 +21,16 @@
> Still, we recommend to become acquainted with the basic functionality of
> lazy modules (such as understanding the roles of `__getattr__`, `__dir__`,
> and `__all__`).
> If you'd like to talk about it, feel free to open the
> [discussion](https://github.com/bachorp/lazy-imports/discussions) on Github.
+### Table of Contents
+
+- [`LazyModule`](#lazymodule)
+ - [Example 1](#example-1)
+ - [Example 2](#example-2)
+- [`try_import`](#try_import)
+- [`LazyImporter`](#lazyimporter)
+- [History](#history)
+- [Licensing](#licensing)
+
## [`LazyModule`](./lazy_imports/lazy_module.py)
### Example 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/TODO.txt
new/lazy-imports-1.2.0/TODO.txt
--- old/lazy-imports-1.0.1/TODO.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/lazy-imports-1.2.0/TODO.txt 2025-12-28 14:31:51.000000000 +0100
@@ -0,0 +1,4 @@
+Can be improved with later versions of Python:
+
+3.11+: assert_never, Exception.add_note, Self
+3.12+: type statement
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/lazy_imports/__init__.py
new/lazy-imports-1.2.0/lazy_imports/__init__.py
--- old/lazy-imports-1.0.1/lazy_imports/__init__.py 2025-08-09
09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/lazy_imports/__init__.py 2025-12-28
14:31:51.000000000 +0100
@@ -22,7 +22,7 @@
# Versioning follows the Semantic Versioning Specification https://semver.org/
and
# PEP 440 -- Version Identification and Dependency Specification:
https://www.python.org/dev/peps/pep-0440/ # noqa: E501
-__version__ = "1.0.1"
+__version__ = "1.2.0"
__all__ = [
# .lazy_module
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/lazy_imports/lazy_module.py
new/lazy-imports-1.2.0/lazy_imports/lazy_module.py
--- old/lazy-imports-1.0.1/lazy_imports/lazy_module.py 2025-08-09
09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/lazy_imports/lazy_module.py 2025-12-28
14:31:51.000000000 +0100
@@ -21,13 +21,9 @@
import warnings
from dataclasses import dataclass
from types import ModuleType
-from typing import Any, Iterable, Union
+from typing import Any, Iterable, TypeAlias
-# Can be improved with later versions of Python:
-# 3.10+: Union -> |, if/elif -> match, TypeAlias
-# 3.12+: type statement
-
if sys.version_info >= (3, 11):
from typing import assert_never
else:
@@ -37,25 +33,31 @@
value = repr(arg)
if len(value) > 100:
value = value[:100] + "..."
+
raise AssertionError(f"Expected code to be unreachable, but got:
{value}")
-Statement = Union[tuple[str, Any], ast.ImportFrom]
+Statement: TypeAlias = tuple[str, Any] | ast.ImportFrom
-def _parse(statement_or_code: Union[str, "Statement"]) ->
Iterable["Statement"]:
- if isinstance(statement_or_code, str):
- for stmt in ast.parse(statement_or_code).body:
- if isinstance(stmt, ast.ImportFrom):
- yield stmt
- elif isinstance(stmt, ast.Import):
- raise ValueError(f"statements of type
{ast.Import.__qualname__} are not supported")
- else:
- raise ValueError(
- f"expected parsed statement to be of type
{ast.ImportFrom.__qualname__} but got {type(stmt).__qualname__}" # noqa: E501
- )
- else:
- yield statement_or_code
+def _parse(statement_or_code: str | Statement) -> Iterable[Statement]:
+ match statement_or_code:
+ case str():
+ for stmt in ast.parse(statement_or_code).body:
+ match stmt:
+ case ast.ImportFrom():
+ yield stmt
+
+ case ast.Import():
+ raise ValueError(f"statements of type
{ast.Import.__qualname__} are not supported")
+
+ case _:
+ raise ValueError(
+ f"expected parsed statement to be of type
{ast.ImportFrom.__qualname__} but got {type(stmt).__qualname__}" # noqa: E501
+ )
+
+ case _:
+ yield statement_or_code
@dataclass
@@ -69,7 +71,7 @@
@dataclass
class _AttributeImport:
level: int
- module: Union[str, None]
+ module: str | None
name: str
def module_relatively(self) -> str: # noqa: D103; pylint:
disable=missing-function-docstring
@@ -79,8 +81,8 @@
return f"attribute {self.name!r} imported from module
{self.module_relatively()}"
-_Deferred = _AttributeImport
-_AttributeValue = Union[_Immediate, _Deferred]
+_Deferred: TypeAlias = _AttributeImport
+_AttributeValue: TypeAlias = _Immediate | _Deferred
@dataclass
@@ -89,20 +91,23 @@
value: _AttributeValue
-def _to_attributes(statement: "Statement") -> Iterable[_Attribute]:
- if isinstance(statement, tuple):
- yield _Attribute(name=statement[0],
value=_Immediate(value=statement[1]))
- elif isinstance(statement, ast.ImportFrom): # pyright:
ignore[reportUnnecessaryIsInstance]
- for name in statement.names:
- if name.name == "*":
- raise ValueError(f"cannot lazily perform a wildcard import
(from module {statement.module})")
-
- yield _Attribute(
- name=name.asname or name.name,
- value=_AttributeImport(module=statement.module,
name=name.name, level=statement.level),
- )
- else:
- assert_never(statement)
+def _to_attributes(statement: Statement) -> Iterable[_Attribute]:
+ match statement:
+ case tuple():
+ yield _Attribute(name=statement[0],
value=_Immediate(value=statement[1]))
+
+ case ast.ImportFrom():
+ for name in statement.names:
+ if name.name == "*":
+ raise ValueError(f"cannot lazily perform a wildcard import
(from module {statement.module})")
+
+ yield _Attribute(
+ name=name.asname or name.name,
+ value=_AttributeImport(module=statement.module,
name=name.name, level=statement.level),
+ )
+
+ case _:
+ assert_never(statement)
class ShadowingWarning(UserWarning):
@@ -127,9 +132,9 @@
def __init__(
self,
- *statement_or_code: Union[str, Union[ast.ImportFrom, tuple[str, Any]]],
+ *statement_or_code: str | ast.ImportFrom | tuple[str, Any],
name: str,
- doc: Union[str, None] = None,
+ doc: str | None = None,
auto_all: bool = True,
) -> None:
super().__init__(name, doc)
@@ -149,12 +154,15 @@
if hasattr(self, name):
raise ValueError(f"not allowed to override reserved attribute
{name!r} (with {value})")
- if isinstance(value, _Immediate):
- setattr(self, name, value.value)
- elif isinstance(value, _AttributeImport): # pyright:
ignore[reportUnnecessaryIsInstance]
- self.__deferred_attrs[name] = value
- else:
- assert_never(value)
+ match value:
+ case _Immediate():
+ setattr(self, name, value.value)
+
+ case _AttributeImport():
+ self.__deferred_attrs[name] = value
+
+ case _:
+ assert_never(value)
# NOTE: Explicit __all__ is required because otherwise potential
wildcard imports will use the actual
# attributes, ignoring __dir__.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/lazy_imports/try_import.py
new/lazy-imports-1.2.0/lazy_imports/try_import.py
--- old/lazy-imports-1.0.1/lazy_imports/try_import.py 2025-08-09
09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/lazy_imports/try_import.py 2025-12-28
14:31:51.000000000 +0100
@@ -22,7 +22,6 @@
"""
from types import TracebackType
-from typing import Optional, Tuple, Type
class _DeferredImportExceptionContextManager:
@@ -34,7 +33,7 @@
"""
def __init__(self) -> None:
- self._deferred: Optional[Tuple[Exception, str]] = None
+ self._deferred: tuple[Exception, str] | None = None
def __enter__(self) -> "_DeferredImportExceptionContextManager":
"""Enter the context manager.
@@ -47,10 +46,10 @@
def __exit__(
self,
- exc_type: Optional[Type[Exception]],
- exc_value: Optional[Exception],
- traceback: Optional[TracebackType],
- ) -> Optional[bool]:
+ exc_type: type[Exception] | None,
+ exc_value: Exception | None,
+ traceback: TracebackType | None,
+ ) -> bool | None:
"""Exit the context manager.
Args:
@@ -66,24 +65,25 @@
:obj:`True` will suppress any exceptions avoiding them from
propagating.
"""
- if isinstance(exc_value, (ImportError, SyntaxError)):
- if isinstance(exc_value, ImportError):
+ match exc_value:
+ case ImportError():
message = (
f"Tried to import '{exc_value.name}' but failed. Please
make sure that the package is "
f"installed correctly to use this feature. Actual error:
{exc_value}."
)
- elif isinstance(exc_value, SyntaxError): # type: ignore
[reportUnnecessaryIsInstance]
+
+ case SyntaxError():
message = (
f"Tried to import a package but failed due to a syntax
error in {exc_value.filename}. Please "
"make sure that the Python version is correct to use this
feature. Actual "
f"error: {exc_value}."
)
- else:
- assert False
- self._deferred = (exc_value, message)
- return True
- return None
+ case _:
+ return None
+
+ self._deferred = (exc_value, message)
+ return True
def is_successful(self) -> bool:
"""Return whether the context manager has caught any exceptions.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/lazy_imports/util.py
new/lazy-imports-1.2.0/lazy_imports/util.py
--- old/lazy-imports-1.0.1/lazy_imports/util.py 2025-08-09 09:10:08.000000000
+0200
+++ new/lazy-imports-1.2.0/lazy_imports/util.py 2025-12-28 14:31:51.000000000
+0100
@@ -19,14 +19,10 @@
import sys
from pathlib import Path
from types import ModuleType
-from typing import Any, Iterable, Union
+from typing import Any, Iterable
-# Can be improved with later versions of Python:
-# 3.10+: Union -> |
-
-
-def as_package(file: Union[Path, str]) -> Iterable[tuple[str, Any]]:
+def as_package(file: Path | str) -> Iterable[tuple[str, Any]]:
# noqa: D205
"""Creates the attributes `__file__` and `__path__` required for a module
to be a (regular) package.
This allows to import subpackages from the appropriate locations.
@@ -44,7 +40,7 @@
sys.modules[module.__name__] = module
-def module_source(name: str, package: Union[str, None]) -> str:
+def module_source(name: str, package: str | None) -> str:
"""Returns the source code of the module `name` without loading the module.
If `name` is relative, `package` must be supplied.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/lazy_imports/v0/lazy_imports.py
new/lazy-imports-1.2.0/lazy_imports/v0/lazy_imports.py
--- old/lazy-imports-1.0.1/lazy_imports/v0/lazy_imports.py 2025-08-09
09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/lazy_imports/v0/lazy_imports.py 2025-12-28
14:31:51.000000000 +0100
@@ -28,9 +28,6 @@
from typing import Any, Dict, List, Union
-# from warnings import warn
-
-
@dataclass
class Submodule:
"""Submodule.
@@ -86,11 +83,6 @@
import_structure: Dict[str, List[str]],
extra_objects: Union[Dict[str, Any], None] = None,
):
- # warn(
- # DeprecationWarning(
- # "LazyImporter is deprecated and will be removed in a future
version. Use LazyModule instead."
- # )
- # )
super().__init__(name)
self._exports: Dict[str, Export] = {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lazy-imports-1.0.1/setup.py
new/lazy-imports-1.2.0/setup.py
--- old/lazy-imports-1.0.1/setup.py 2025-08-09 09:10:08.000000000 +0200
+++ new/lazy-imports-1.2.0/setup.py 2025-12-28 14:31:51.000000000 +0100
@@ -15,7 +15,6 @@
"""Build script for setuptools."""
import os
-from typing import List
import setuptools
@@ -23,7 +22,7 @@
project_name = "lazy_imports"
source_code = "https://github.com/bachorp/lazy-imports"
keywords = "import imports lazy"
-install_requires: List[str] = []
+install_requires: list[str] = []
extras_require = {
"checking": [
"black",
@@ -68,7 +67,7 @@
"Source Code": source_code,
},
packages=["lazy_imports", "lazy_imports.v0"],
- python_requires=">=3.9",
+ python_requires=">=3.10",
install_requires=install_requires,
extras_require=extras_require,
keywords=keywords,
@@ -77,11 +76,11 @@
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
- "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.14",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",