Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-peewee for openSUSE:Factory 
checked in at 2025-02-20 17:39:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-peewee (Old)
 and      /work/SRC/openSUSE:Factory/.python-peewee.new.1873 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-peewee"

Thu Feb 20 17:39:47 2025 rev:33 rq:1247409 version:3.17.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-peewee/python-peewee.changes      
2024-11-14 16:08:21.501945455 +0100
+++ /work/SRC/openSUSE:Factory/.python-peewee.new.1873/python-peewee.changes    
2025-02-20 17:39:51.555453028 +0100
@@ -1,0 +2,7 @@
+Thu Feb 20 11:21:04 UTC 2025 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Update to 3.17.9
+  * Fix incorrect handling of fk constraint name in migrator.
+  * Fix test-only issue that can occur in Python 3.14a4.
+
+-------------------------------------------------------------------

Old:
----
  peewee-3.17.8.tar.gz

New:
----
  peewee-3.17.9.tar.gz

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

Other differences:
------------------
++++++ python-peewee.spec ++++++
--- /var/tmp/diff_new_pack.lPeF5J/_old  2025-02-20 17:39:52.591496301 +0100
+++ /var/tmp/diff_new_pack.lPeF5J/_new  2025-02-20 17:39:52.595496468 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-peewee
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-peewee
-Version:        3.17.8
+Version:        3.17.9
 Release:        0
 Summary:        An expressive ORM that supports multiple SQL backends
 License:        MIT

++++++ peewee-3.17.8.tar.gz -> peewee-3.17.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/peewee-3.17.8/.github/workflows/tests.yaml 
new/peewee-3.17.9/.github/workflows/tests.yaml
--- old/peewee-3.17.8/.github/workflows/tests.yaml      2024-11-12 
17:58:25.000000000 +0100
+++ new/peewee-3.17.9/.github/workflows/tests.yaml      2025-02-05 
17:29:11.000000000 +0100
@@ -52,6 +52,7 @@
           PGHOST: 127.0.0.1
           PGPASSWORD: peewee
         run: |
+          sudo apt-get install libsqlite3-dev
           pip install setuptools psycopg2-binary cython pymysql 'apsw' 
mysql-connector sqlcipher3-binary 'psycopg[binary]' pysqlite3
           python setup.py build_ext -i
           psql peewee_test -c 'CREATE EXTENSION hstore;'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/peewee-3.17.8/peewee.py new/peewee-3.17.9/peewee.py
--- old/peewee-3.17.8/peewee.py 2024-11-12 17:58:25.000000000 +0100
+++ new/peewee-3.17.9/peewee.py 2025-02-05 17:29:11.000000000 +0100
@@ -74,7 +74,7 @@
         mysql = None
 
 
-__version__ = '3.17.8'
+__version__ = '3.17.9'
 __all__ = [
     'AnyField',
     'AsIs',
@@ -5564,6 +5564,12 @@
             return self.rel_field.get_modifiers()
         return super(ForeignKeyField, self).get_modifiers()
 
+    def get_constraint_name(self):
+        return self.constraint_name or 'fk_%s_%s_refs_%s' % (
+            self.model._meta.table_name,
+            self.column_name,
+            self.rel_model._meta.table_name)
+
     def adapt(self, value):
         return self.rel_field.adapt(value)
 
@@ -5613,10 +5619,14 @@
                 setattr(self.rel_model, self.backref,
                         self.backref_accessor_class(self))
 
-    def foreign_key_constraint(self):
+    def foreign_key_constraint(self, explicit_name=False):
         parts = []
-        if self.constraint_name:
-            parts.extend((SQL('CONSTRAINT'), Entity(self.constraint_name)))
+        if self.constraint_name or explicit_name:
+            name = self.get_constraint_name()
+            parts.extend([
+                SQL('CONSTRAINT'),
+                Entity(_truncate_constraint_name(name))])
+
         parts.extend([
             SQL('FOREIGN KEY'),
             EnclosedNodeList((self,)),
@@ -6145,17 +6155,12 @@
             self.database.execute(seq_ctx)
 
     def _create_foreign_key(self, field):
-        name = 'fk_%s_%s_refs_%s' % (field.model._meta.table_name,
-                                     field.column_name,
-                                     field.rel_model._meta.table_name)
         return (self
                 ._create_context()
                 .literal('ALTER TABLE ')
                 .sql(field.model)
-                .literal(' ADD CONSTRAINT ')
-                .sql(Entity(_truncate_constraint_name(name)))
-                .literal(' ')
-                .sql(field.foreign_key_constraint()))
+                .literal(' ADD ')
+                .sql(field.foreign_key_constraint(True)))
 
     def create_foreign_key(self, field):
         self.database.execute(self._create_foreign_key(field))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/peewee-3.17.8/playhouse/migrate.py 
new/peewee-3.17.9/playhouse/migrate.py
--- old/peewee-3.17.8/playhouse/migrate.py      2024-11-12 17:58:25.000000000 
+0100
+++ new/peewee-3.17.9/playhouse/migrate.py      2025-02-05 17:29:11.000000000 
+0100
@@ -286,8 +286,11 @@
 
     @operation
     def add_foreign_key_constraint(self, table, column_name, rel, rel_column,
-                                   on_delete=None, on_update=None):
-        constraint = 'fk_%s_%s_refs_%s' % (table, column_name, rel)
+                                   on_delete=None, on_update=None,
+                                   constraint_name=None):
+        constraint = constraint_name or 'fk_%s_%s_refs_%s' % (table,
+                                                              column_name,
+                                                              rel)
         ctx = (self
                .make_context()
                .literal('ALTER TABLE ')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/peewee-3.17.8/tests/postgres.py 
new/peewee-3.17.9/tests/postgres.py
--- old/peewee-3.17.8/tests/postgres.py 2024-11-12 17:58:25.000000000 +0100
+++ new/peewee-3.17.9/tests/postgres.py 2025-02-05 17:29:11.000000000 +0100
@@ -929,14 +929,14 @@
                ('b4', 4),
                ('b7', 7))),
         ('c', ()))
-    ts = functools.partial(datetime.datetime, 2019, 1)
 
     def create_data(self):
+        ts = lambda d: datetime.datetime(2019, 1, d)
         with self.database.atomic():
             for username, tweets in self.test_data:
                 user = User.create(username=username)
                 for c, d in tweets:
-                    Tweet.create(user=user, content=c, timestamp=self.ts(d))
+                    Tweet.create(user=user, content=c, timestamp=ts(d))
 
     @requires_models(User, Tweet)
     def test_lateral_top_n(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/peewee-3.17.8/tests/schema.py 
new/peewee-3.17.9/tests/schema.py
--- old/peewee-3.17.8/tests/schema.py   2024-11-12 17:58:25.000000000 +0100
+++ new/peewee-3.17.9/tests/schema.py   2025-02-05 17:29:11.000000000 +0100
@@ -539,6 +539,14 @@
             ('CREATE INDEX "tm_named_constraints_fk_id" '
              'ON "tm_named_constraints" ("fk_id")')])
 
+        sql, params = (TMNamedConstraints
+                       ._schema
+                       ._create_foreign_key(TMNamedConstraints.fk)
+                       .query())
+        self.assertEqual(sql, (
+            'ALTER TABLE "tm_named_constraints" ADD CONSTRAINT "tmc_fk" '
+            'FOREIGN KEY ("fk_id") REFERENCES "tm_named_constraints" ("id")'))
+
     def test_index_name_truncation(self):
         class LongIndex(TestModel):
             a123456789012345678901234567890 = CharField()

Reply via email to