Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-ZODB for openSUSE:Factory 
checked in at 2026-04-28 11:56:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ZODB (Old)
 and      /work/SRC/openSUSE:Factory/.python-ZODB.new.11940 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ZODB"

Tue Apr 28 11:56:19 2026 rev:19 rq:1349442 version:6.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ZODB/python-ZODB.changes  2026-04-13 
23:19:16.253075125 +0200
+++ /work/SRC/openSUSE:Factory/.python-ZODB.new.11940/python-ZODB.changes       
2026-04-28 12:00:12.783094446 +0200
@@ -1,0 +2,8 @@
+Sun Apr 26 21:11:53 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 6.3:
+  * Add class_factory parameter to DB.__init__() and class-
+    factory option to ZConfig database configuration. See issue
+    #420.
+
+-------------------------------------------------------------------

Old:
----
  zodb-6.2.tar.gz

New:
----
  zodb-6.3.tar.gz

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

Other differences:
------------------
++++++ python-ZODB.spec ++++++
--- /var/tmp/diff_new_pack.DeHkmh/_old  2026-04-28 12:00:14.431163676 +0200
+++ /var/tmp/diff_new_pack.DeHkmh/_new  2026-04-28 12:00:14.435163843 +0200
@@ -19,7 +19,7 @@
 
 %bcond_without libalternatives
 Name:           python-ZODB
-Version:        6.2
+Version:        6.3
 Release:        0
 Summary:        Zope Object Database: object database and persistence
 License:        ZPL-2.1

++++++ zodb-6.2.tar.gz -> zodb-6.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/.pre-commit-config.yaml 
new/zodb-6.3/.pre-commit-config.yaml
--- old/zodb-6.2/.pre-commit-config.yaml        2026-01-23 14:09:39.000000000 
+0100
+++ new/zodb-6.3/.pre-commit-config.yaml        2026-04-14 08:04:55.000000000 
+0200
@@ -3,7 +3,7 @@
 minimum_pre_commit_version: '3.6'
 repos:
   - repo: https://github.com/pycqa/isort
-    rev: "7.0.0"
+    rev: "8.0.1"
     hooks:
     - id: isort
   - repo: https://github.com/hhatto/autopep8
@@ -20,6 +20,7 @@
     rev: 0.4.3
     hooks:
     - id: teyit
+      language_version: python3.13
       exclude: docs/articles/old-guide
   - repo: https://github.com/PyCQA/flake8
     rev: "7.3.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/CHANGES.rst new/zodb-6.3/CHANGES.rst
--- old/zodb-6.2/CHANGES.rst    2026-01-23 14:28:16.000000000 +0100
+++ new/zodb-6.3/CHANGES.rst    2026-04-14 08:05:40.000000000 +0200
@@ -2,6 +2,14 @@
  Change History
 ================
 
+6.3 (2026-04-14)
+----------------
+
+- Add ``class_factory`` parameter to ``DB.__init__()`` and
+  ``class-factory`` option to ZConfig database configuration.
+  See `issue #420 <https://github.com/zopefoundation/ZODB/issues/420>`_.
+
+
 6.2 (2026-01-23)
 ================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/PKG-INFO new/zodb-6.3/PKG-INFO
--- old/zodb-6.2/PKG-INFO       2026-01-23 14:35:17.004584000 +0100
+++ new/zodb-6.3/PKG-INFO       2026-04-14 08:15:14.587961700 +0200
@@ -1,6 +1,7 @@
 Metadata-Version: 2.4
 Name: ZODB
-Version: 6.2
+Version: 6.3
+Summary: ZODB, a Python object-oriented database
 Author-email: Jim Fulton <[email protected]>
 Maintainer-email: Plone Foundation and contributors <[email protected]>
 License-Expression: ZPL-2.1
@@ -100,6 +101,14 @@
  Change History
 ================
 
+6.3 (2026-04-14)
+----------------
+
+- Add ``class_factory`` parameter to ``DB.__init__()`` and
+  ``class-factory`` option to ZConfig database configuration.
+  See `issue #420 <https://github.com/zopefoundation/ZODB/issues/420>`_.
+
+
 6.2 (2026-01-23)
 ================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/pyproject.toml new/zodb-6.3/pyproject.toml
--- old/zodb-6.2/pyproject.toml 2026-01-23 14:28:25.000000000 +0100
+++ new/zodb-6.3/pyproject.toml 2026-04-14 08:05:48.000000000 +0200
@@ -7,10 +7,10 @@
 ]
 build-backend = "setuptools.build_meta"
 
-
 [project]
 name = "ZODB"
-version = "6.2"
+description = "ZODB, a Python object-oriented database"
+version = "6.3"
 license = "ZPL-2.1"
 classifiers = [
     "Intended Audience :: Developers",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/src/ZODB/DB.py new/zodb-6.3/src/ZODB/DB.py
--- old/zodb-6.2/src/ZODB/DB.py 2025-10-01 09:21:17.000000000 +0200
+++ new/zodb-6.3/src/ZODB/DB.py 2026-04-14 08:04:52.000000000 +0200
@@ -360,6 +360,7 @@
                  databases=None,
                  xrefs=True,
                  large_record_size=1 << 24,
+                 class_factory=None,
                  **storage_args):
         """Create an object database.
 
@@ -407,6 +408,13 @@
         :param int large_record_size: When object records are saved
              that are larger than this, a warning is issued,
              suggesting that blobs should be used instead.
+        :param callable class_factory: A callable
+             ``class_factory(connection, module_name, global_name)``
+             used to resolve persistent object classes during
+             deserialization. If not provided, the default
+            ``DB.classFactory`` method is used; it wraps
+             :func:`ZODB.broken.find_global` to provide this
+             three-argument interface.
         :param storage_args: Extra keywork arguments passed to a
              storage constructor if a path name or None is passed as
              the storage argument.
@@ -465,6 +473,9 @@
 
         self.large_record_size = large_record_size
 
+        if class_factory is not None:
+            self.classFactory = class_factory
+
         # Make sure we have a root:
         with self.transaction('initial database creation') as conn:
             try:
@@ -847,7 +858,6 @@
         self._activity_monitor = am
 
     def classFactory(self, connection, modulename, globalname):
-        # Zope will rebind this method to arbitrary user code at runtime.
         return find_global(modulename, globalname)
 
     def setCacheSize(self, size):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/src/ZODB/component.xml 
new/zodb-6.3/src/ZODB/component.xml
--- old/zodb-6.2/src/ZODB/component.xml 2021-11-02 09:52:39.000000000 +0100
+++ new/zodb-6.3/src/ZODB/component.xml 2026-04-14 08:04:52.000000000 +0200
@@ -324,6 +324,16 @@
         currently possible) are disallowed.
       </description>
     </key>
+    <key name="class-factory" datatype=".importable_name">
+      <description>
+        A callable used to resolve persistent object classes during
+        deserialization. The database-level class factory is called as
+        ``class_factory(connection, module_name, global_name)``.
+        Specify a Python dotted-path name.
+        If not provided, the database uses its default class factory,
+        which delegates to ``ZODB.broken.find_global``.
+      </description>
+    </key>
 
   </sectiontype>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/src/ZODB/config.py 
new/zodb-6.3/src/ZODB/config.py
--- old/zodb-6.2/src/ZODB/config.py     2023-08-01 11:34:54.000000000 +0200
+++ new/zodb-6.3/src/ZODB/config.py     2026-04-14 08:04:52.000000000 +0200
@@ -13,6 +13,7 @@
 ##############################################################################
 """Open database and storage from a configuration."""
 import os
+import traceback
 from io import StringIO
 
 import ZConfig
@@ -20,6 +21,30 @@
 import ZODB
 
 
+def importable_name(name):
+    # A datatype that converts a Python dotted-path-name to an object
+    try:
+        components = name.split('.')
+        start = components[0]
+        g = globals()
+        package = __import__(start, g, g)
+        modulenames = [start]
+        for component in components[1:]:
+            modulenames.append(component)
+            try:
+                package = getattr(package, component)
+            except AttributeError:
+                n = '.'.join(modulenames)
+                package = __import__(n, g, g, component)
+        return package
+    except ImportError:
+        IO = StringIO()
+        traceback.print_exc(file=IO)
+        raise ValueError(
+            f'The object named by {name!r} could not be imported\n'
+            f'{IO.getvalue()}')
+
+
 db_schema_path = os.path.join(ZODB.__path__[0], "config.xml")
 _db_schema = None
 
@@ -150,6 +175,7 @@
         _option('pool_timeout')
         _option('allow_implicit_cross_references', 'xrefs')
         _option('large_record_size')
+        _option('class_factory')
 
         try:
             return ZODB.DB(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/src/ZODB/tests/testConfig.py 
new/zodb-6.3/src/ZODB/tests/testConfig.py
--- old/zodb-6.2/src/ZODB/tests/testConfig.py   2023-08-01 11:34:54.000000000 
+0200
+++ new/zodb-6.3/src/ZODB/tests/testConfig.py   2026-04-14 08:04:52.000000000 
+0200
@@ -128,6 +128,56 @@
     """
 
 
+def dummy_class_factory(connection, module_name, global_name):
+    """Helper function for database_class_factory_config
+    """
+
+
+def database_class_factory_config():
+    r"""The class-factory option sets the class factory used for
+    deserializing persistent objects.
+
+    Without it, the default DB.classFactory method is used:
+
+    >>> db = ZODB.config.databaseFromString(
+    ...    "<zodb>\n<mappingstorage>\n</mappingstorage>\n</zodb>\n")
+    >>> import types
+    >>> isinstance(db.classFactory, types.MethodType)
+    True
+    >>> db.close()
+
+    With a dotted name, the specified callable is used:
+
+    >>> db = ZODB.config.databaseFromString(
+    ...    "<zodb>\nclass-factory ZODB.tests.testConfig.dummy_class_factory\n"
+    ...    "<mappingstorage>\n</mappingstorage>\n</zodb>\n")
+    >>> db.classFactory is dummy_class_factory
+    True
+
+    The factory is available to connections, including the one
+    pooled during __init__:
+
+    >>> conn = db.open()
+    >>> conn._reader._factory is dummy_class_factory
+    True
+    >>> conn.close()
+    >>> db.close()
+
+    When the class factory is set to a non-existent callable, a detailed
+    error is raised:
+    >>> db = ZODB.config.databaseFromString(
+    ...    "<zodb>\n"
+    ...     "class-factory ZODB.tests.testConfig.non_existent_class_factory\n"
+    ...    "<mappingstorage>\n</mappingstorage>\n</zodb>\n"
+    ... )  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
+    Traceback (most recent call last):
+    ...
+    ZConfig.DataConversionError: The object named by 
'ZODB.tests.testConfig.non_existent_class_factory' could not be imported
+    Traceback (most recent call last):
+    ...
+    """  # noqa: E501
+
+
 def multi_atabases():
     r"""If there are multiple codb sections -> multidatabase
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/src/ZODB/tests/testDB.py 
new/zodb-6.3/src/ZODB/tests/testDB.py
--- old/zodb-6.2/src/ZODB/tests/testDB.py       2025-10-01 09:21:17.000000000 
+0200
+++ new/zodb-6.3/src/ZODB/tests/testDB.py       2026-04-14 08:04:52.000000000 
+0200
@@ -324,6 +324,38 @@
     """
 
 
+def class_factory_parameter():
+    """The class_factory parameter lets you set a custom class resolver
+    at construction time, before any connection is created.
+
+    >>> from ZODB.broken import find_global
+    >>> calls = []
+    >>> def my_factory(conn, module, name):
+    ...     calls.append((module, name))
+    ...     return find_global(module, name)
+
+    >>> db = ZODB.DB(None, class_factory=my_factory)
+    >>> db.classFactory is my_factory
+    True
+
+    The connection pooled during __init__ has the custom factory:
+
+    >>> conn = db.open()
+    >>> conn._reader._factory is my_factory
+    True
+    >>> conn.close()
+
+    Reused connections also have the custom factory:
+
+    >>> conn2 = db.open()
+    >>> conn2._reader._factory is my_factory
+    True
+    >>> conn2.close()
+
+    >>> db.close()
+    """
+
+
 def open_convenience():
     """Often, we just want to open a single connection.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zodb-6.2/src/ZODB.egg-info/PKG-INFO 
new/zodb-6.3/src/ZODB.egg-info/PKG-INFO
--- old/zodb-6.2/src/ZODB.egg-info/PKG-INFO     2026-01-23 14:35:16.000000000 
+0100
+++ new/zodb-6.3/src/ZODB.egg-info/PKG-INFO     2026-04-14 08:15:14.000000000 
+0200
@@ -1,6 +1,7 @@
 Metadata-Version: 2.4
 Name: ZODB
-Version: 6.2
+Version: 6.3
+Summary: ZODB, a Python object-oriented database
 Author-email: Jim Fulton <[email protected]>
 Maintainer-email: Plone Foundation and contributors <[email protected]>
 License-Expression: ZPL-2.1
@@ -100,6 +101,14 @@
  Change History
 ================
 
+6.3 (2026-04-14)
+----------------
+
+- Add ``class_factory`` parameter to ``DB.__init__()`` and
+  ``class-factory`` option to ZConfig database configuration.
+  See `issue #420 <https://github.com/zopefoundation/ZODB/issues/420>`_.
+
+
 6.2 (2026-01-23)
 ================
 

Reply via email to