Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-Flask-Migrate for
openSUSE:Factory checked in at 2024-01-21 23:08:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Flask-Migrate (Old)
and /work/SRC/openSUSE:Factory/.python-Flask-Migrate.new.16006 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Flask-Migrate"
Sun Jan 21 23:08:46 2024 rev:10 rq:1140100 version:4.0.5
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-Flask-Migrate/python-Flask-Migrate.changes
2023-05-21 19:09:48.814813671 +0200
+++
/work/SRC/openSUSE:Factory/.python-Flask-Migrate.new.16006/python-Flask-Migrate.changes
2024-01-21 23:09:07.619191059 +0100
@@ -1,0 +2,9 @@
+Sat Jan 20 12:25:20 UTC 2024 - Dirk Müller <[email protected]>
+
+- update to 4.0.5:
+ * Compatiblity fixes for Flask-SQLAlchemy >= 3.1
+ * Allow process_revision_directives option to be configurable
+ * Stop testing Python 3.7, as Flask-SQLAlchemy 3.1 stopped
+ supporting it
+
+-------------------------------------------------------------------
Old:
----
Flask-Migrate-4.0.4.tar.gz
New:
----
Flask-Migrate-4.0.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Flask-Migrate.spec ++++++
--- /var/tmp/diff_new_pack.OAJlki/_old 2024-01-21 23:09:08.103208702 +0100
+++ /var/tmp/diff_new_pack.OAJlki/_new 2024-01-21 23:09:08.103208702 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-Flask-Migrate
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 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-Flask-Migrate
-Version: 4.0.4
+Version: 4.0.5
Release: 0
Summary: SQLAlchemy database migrations for Flask applications using
Alembic
License: MIT
++++++ Flask-Migrate-4.0.4.tar.gz -> Flask-Migrate-4.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Migrate-4.0.4/PKG-INFO
new/Flask-Migrate-4.0.5/PKG-INFO
--- old/Flask-Migrate-4.0.4/PKG-INFO 2023-02-03 00:22:31.447146700 +0100
+++ new/Flask-Migrate-4.0.5/PKG-INFO 2023-09-12 13:21:18.328817000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Flask-Migrate
-Version: 4.0.4
+Version: 4.0.5
Summary: SQLAlchemy database migrations for Flask applications using Alembic.
Home-page: https://github.com/miguelgrinberg/flask-migrate
Author: Miguel Grinberg
@@ -15,6 +15,9 @@
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
+Requires-Dist: Flask>=0.9
+Requires-Dist: Flask-SQLAlchemy>=1.0
+Requires-Dist: alembic>=1.9.0
Flask-Migrate
=============
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Migrate-4.0.4/setup.cfg
new/Flask-Migrate-4.0.5/setup.cfg
--- old/Flask-Migrate-4.0.4/setup.cfg 2023-02-03 00:22:31.448525200 +0100
+++ new/Flask-Migrate-4.0.5/setup.cfg 2023-09-12 13:21:18.328817000 +0200
@@ -1,6 +1,6 @@
[metadata]
name = Flask-Migrate
-version = 4.0.4
+version = 4.0.5
author = Miguel Grinberg
author_email = [email protected]
license = MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Flask-Migrate-4.0.4/src/Flask_Migrate.egg-info/PKG-INFO
new/Flask-Migrate-4.0.5/src/Flask_Migrate.egg-info/PKG-INFO
--- old/Flask-Migrate-4.0.4/src/Flask_Migrate.egg-info/PKG-INFO 2023-02-03
00:22:31.000000000 +0100
+++ new/Flask-Migrate-4.0.5/src/Flask_Migrate.egg-info/PKG-INFO 2023-09-12
13:21:18.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Flask-Migrate
-Version: 4.0.4
+Version: 4.0.5
Summary: SQLAlchemy database migrations for Flask applications using Alembic.
Home-page: https://github.com/miguelgrinberg/flask-migrate
Author: Miguel Grinberg
@@ -15,6 +15,9 @@
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
+Requires-Dist: Flask>=0.9
+Requires-Dist: Flask-SQLAlchemy>=1.0
+Requires-Dist: alembic>=1.9.0
Flask-Migrate
=============
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Flask-Migrate-4.0.4/src/Flask_Migrate.egg-info/SOURCES.txt
new/Flask-Migrate-4.0.5/src/Flask_Migrate.egg-info/SOURCES.txt
--- old/Flask-Migrate-4.0.4/src/Flask_Migrate.egg-info/SOURCES.txt
2023-02-03 00:22:31.000000000 +0100
+++ new/Flask-Migrate-4.0.5/src/Flask_Migrate.egg-info/SOURCES.txt
2023-09-12 13:21:18.000000000 +0200
@@ -27,4 +27,7 @@
src/flask_migrate/templates/flask-multidb/README
src/flask_migrate/templates/flask-multidb/alembic.ini.mako
src/flask_migrate/templates/flask-multidb/env.py
-src/flask_migrate/templates/flask-multidb/script.py.mako
\ No newline at end of file
+src/flask_migrate/templates/flask-multidb/script.py.mako
+tests/test_custom_template.py
+tests/test_migrate.py
+tests/test_multidb_migrate.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Flask-Migrate-4.0.4/src/flask_migrate/templates/aioflask/env.py
new/Flask-Migrate-4.0.5/src/flask_migrate/templates/aioflask/env.py
--- old/Flask-Migrate-4.0.4/src/flask_migrate/templates/aioflask/env.py
2023-02-03 00:17:53.000000000 +0100
+++ new/Flask-Migrate-4.0.5/src/flask_migrate/templates/aioflask/env.py
2023-09-12 12:50:40.000000000 +0200
@@ -20,7 +20,7 @@
try:
# this works with Flask-SQLAlchemy<3 and Alchemical
return current_app.extensions['migrate'].db.get_engine()
- except TypeError:
+ except (TypeError, AttributeError):
# this works with Flask-SQLAlchemy>=3
return current_app.extensions['migrate'].db.engine
@@ -84,11 +84,14 @@
directives[:] = []
logger.info('No changes in schema detected.')
+ conf_args = current_app.extensions['migrate'].configure_args
+ if conf_args.get("process_revision_directives") is None:
+ conf_args["process_revision_directives"] = process_revision_directives
+
context.configure(
connection=connection,
target_metadata=get_metadata(),
- process_revision_directives=process_revision_directives,
- **current_app.extensions['migrate'].configure_args
+ **conf_args
)
with context.begin_transaction():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Flask-Migrate-4.0.4/src/flask_migrate/templates/aioflask-multidb/env.py
new/Flask-Migrate-4.0.5/src/flask_migrate/templates/aioflask-multidb/env.py
--- old/Flask-Migrate-4.0.4/src/flask_migrate/templates/aioflask-multidb/env.py
2023-02-03 00:09:46.000000000 +0100
+++ new/Flask-Migrate-4.0.5/src/flask_migrate/templates/aioflask-multidb/env.py
2023-09-12 12:50:40.000000000 +0200
@@ -23,7 +23,7 @@
try:
# this works with Flask-SQLAlchemy<3 and Alchemical
return current_app.extensions['migrate'].db.get_engine(bind=bind_key)
- except TypeError:
+ except (TypeError, AttributeError):
# this works with Flask-SQLAlchemy>=3
return current_app.extensions['migrate'].db.engines.get(bind_key)
@@ -131,6 +131,10 @@
directives[:] = []
logger.info('No changes in schema detected.')
+ conf_args = current_app.extensions['migrate'].configure_args
+ if conf_args.get("process_revision_directives") is None:
+ conf_args["process_revision_directives"] = process_revision_directives
+
for name, rec in engines.items():
rec['sync_connection'] = conn = rec['connection']._sync_connection()
if USE_TWOPHASE:
@@ -146,8 +150,7 @@
upgrade_token="%s_upgrades" % name,
downgrade_token="%s_downgrades" % name,
target_metadata=get_metadata(name),
- process_revision_directives=process_revision_directives,
- **current_app.extensions['migrate'].configure_args
+ **conf_args
)
context.run_migrations(engine_name=name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Flask-Migrate-4.0.4/src/flask_migrate/templates/flask/env.py
new/Flask-Migrate-4.0.5/src/flask_migrate/templates/flask/env.py
--- old/Flask-Migrate-4.0.4/src/flask_migrate/templates/flask/env.py
2023-02-03 00:17:42.000000000 +0100
+++ new/Flask-Migrate-4.0.5/src/flask_migrate/templates/flask/env.py
2023-09-12 12:50:40.000000000 +0200
@@ -19,7 +19,7 @@
try:
# this works with Flask-SQLAlchemy<3 and Alchemical
return current_app.extensions['migrate'].db.get_engine()
- except TypeError:
+ except (TypeError, AttributeError):
# this works with Flask-SQLAlchemy>=3
return current_app.extensions['migrate'].db.engine
@@ -90,14 +90,17 @@
directives[:] = []
logger.info('No changes in schema detected.')
+ conf_args = current_app.extensions['migrate'].configure_args
+ if conf_args.get("process_revision_directives") is None:
+ conf_args["process_revision_directives"] = process_revision_directives
+
connectable = get_engine()
with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=get_metadata(),
- process_revision_directives=process_revision_directives,
- **current_app.extensions['migrate'].configure_args
+ **conf_args
)
with context.begin_transaction():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Flask-Migrate-4.0.4/src/flask_migrate/templates/flask-multidb/env.py
new/Flask-Migrate-4.0.5/src/flask_migrate/templates/flask-multidb/env.py
--- old/Flask-Migrate-4.0.4/src/flask_migrate/templates/flask-multidb/env.py
2023-02-03 00:11:27.000000000 +0100
+++ new/Flask-Migrate-4.0.5/src/flask_migrate/templates/flask-multidb/env.py
2023-09-12 12:50:40.000000000 +0200
@@ -22,7 +22,7 @@
try:
# this works with Flask-SQLAlchemy<3 and Alchemical
return current_app.extensions['migrate'].db.get_engine(bind=bind_key)
- except TypeError:
+ except (TypeError, AttributeError):
# this works with Flask-SQLAlchemy>=3
return current_app.extensions['migrate'].db.engines.get(bind_key)
@@ -136,6 +136,10 @@
directives[:] = []
logger.info('No changes in schema detected.')
+ conf_args = current_app.extensions['migrate'].configure_args
+ if conf_args.get("process_revision_directives") is None:
+ conf_args["process_revision_directives"] = process_revision_directives
+
# for the direct-to-DB use case, start a transaction on all
# engines, then run all migrations, then commit all transactions.
engines = {
@@ -162,8 +166,7 @@
upgrade_token="%s_upgrades" % name,
downgrade_token="%s_downgrades" % name,
target_metadata=get_metadata(name),
- process_revision_directives=process_revision_directives,
- **current_app.extensions['migrate'].configure_args
+ **conf_args
)
context.run_migrations(engine_name=name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Migrate-4.0.4/tests/test_custom_template.py
new/Flask-Migrate-4.0.5/tests/test_custom_template.py
--- old/Flask-Migrate-4.0.4/tests/test_custom_template.py 1970-01-01
01:00:00.000000000 +0100
+++ new/Flask-Migrate-4.0.5/tests/test_custom_template.py 2023-08-21
20:48:53.000000000 +0200
@@ -0,0 +1,77 @@
+import os
+import shutil
+import unittest
+import subprocess
+import shlex
+
+
+def run_cmd(app, cmd):
+ """Run a command and return a tuple with (stdout, stderr, exit_code)"""
+ os.environ['FLASK_APP'] = app
+ process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = process.communicate()
+ print('\n$ ' + cmd)
+ print(stdout.decode('utf-8'))
+ print(stderr.decode('utf-8'))
+ return stdout, stderr, process.wait()
+
+
+class TestMigrate(unittest.TestCase):
+ def setUp(self):
+ os.chdir(os.path.split(os.path.abspath(__file__))[0])
+ try:
+ os.remove('app.db')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('migrations')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('temp_folder')
+ except OSError:
+ pass
+
+ def tearDown(self):
+ try:
+ os.remove('app.db')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('migrations')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('temp_folder')
+ except OSError:
+ pass
+
+ def test_alembic_version(self):
+ from flask_migrate import alembic_version
+ self.assertEqual(len(alembic_version), 3)
+ for v in alembic_version:
+ self.assertTrue(isinstance(v, int))
+
+ def test_migrate_upgrade(self):
+ (o, e, s) = run_cmd('app.py', 'flask db init -t ./custom_template')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app.py', 'flask db migrate')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app.py', 'flask db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app import app, db, User
+ with app.app_context():
+ db.engine.dispose()
+ db.session.add(User(name='test'))
+ db.session.commit()
+
+ with open('migrations/README', 'rt') as f:
+ assert f.readline().strip() == 'Custom template.'
+ with open('migrations/alembic.ini', 'rt') as f:
+ assert f.readline().strip() == '# Custom template'
+ with open('migrations/env.py', 'rt') as f:
+ assert f.readline().strip() == '# Custom template'
+ with open('migrations/script.py.mako', 'rt') as f:
+ assert f.readline().strip() == '# Custom template'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Migrate-4.0.4/tests/test_migrate.py
new/Flask-Migrate-4.0.5/tests/test_migrate.py
--- old/Flask-Migrate-4.0.4/tests/test_migrate.py 1970-01-01
01:00:00.000000000 +0100
+++ new/Flask-Migrate-4.0.5/tests/test_migrate.py 2023-08-21
20:48:53.000000000 +0200
@@ -0,0 +1,114 @@
+import os
+import shutil
+import unittest
+import subprocess
+import shlex
+
+
+def run_cmd(app, cmd):
+ """Run a command and return a tuple with (stdout, stderr, exit_code)"""
+ os.environ['FLASK_APP'] = app
+ process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = process.communicate()
+ print('\n$ ' + cmd)
+ print(stdout.decode('utf-8'))
+ print(stderr.decode('utf-8'))
+ return stdout, stderr, process.wait()
+
+
+class TestMigrate(unittest.TestCase):
+ def setUp(self):
+ os.chdir(os.path.split(os.path.abspath(__file__))[0])
+ try:
+ os.remove('app.db')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('migrations')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('temp_folder')
+ except OSError:
+ pass
+
+ def tearDown(self):
+ try:
+ os.remove('app.db')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('migrations')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('temp_folder')
+ except OSError:
+ pass
+
+ def atest_alembic_version(self):
+ from flask_migrate import alembic_version
+ self.assertEqual(len(alembic_version), 3)
+ for v in alembic_version:
+ self.assertTrue(isinstance(v, int))
+
+ def test_migrate_upgrade(self):
+ (o, e, s) = run_cmd('app.py', 'flask db init')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app.py', 'flask db check')
+ self.assertTrue(s != 0)
+ (o, e, s) = run_cmd('app.py', 'flask db migrate')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app.py', 'flask db check')
+ self.assertTrue(s != 0)
+ (o, e, s) = run_cmd('app.py', 'flask db upgrade')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app.py', 'flask db check')
+ self.assertTrue(s == 0)
+
+ from .app import app, db, User
+ with app.app_context():
+ db.engine.dispose()
+ db.session.add(User(name='test'))
+ db.session.commit()
+
+ def test_custom_directory(self):
+ (o, e, s) = run_cmd('app_custom_directory.py', 'flask db init')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_custom_directory.py', 'flask db migrate')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_custom_directory.py', 'flask db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app_custom_directory import app, db, User
+ with app.app_context():
+ db.engine.dispose()
+ db.session.add(User(name='test'))
+ db.session.commit()
+
+ def test_custom_directory_path(self):
+ (o, e, s) = run_cmd('app_custom_directory_path.py', 'flask db init')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_custom_directory_path.py', 'flask db migrate')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_custom_directory_path.py', 'flask db upgrade')
+ self.assertTrue(s == 0)
+
+ from .app_custom_directory_path import app, db, User
+ with app.app_context():
+ db.engine.dispose()
+ db.session.add(User(name='test'))
+ db.session.commit()
+
+ def test_compare_type(self):
+ (o, e, s) = run_cmd('app_compare_type1.py', 'flask database init')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_compare_type1.py', 'flask database migrate')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_compare_type1.py', 'flask database upgrade')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_compare_type2.py', 'flask database migrate')
+ self.assertTrue(s == 0)
+ self.assertTrue(b'Detected type change from VARCHAR(length=128) '
+ b'to String(length=10)' in e)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Migrate-4.0.4/tests/test_multidb_migrate.py
new/Flask-Migrate-4.0.5/tests/test_multidb_migrate.py
--- old/Flask-Migrate-4.0.4/tests/test_multidb_migrate.py 1970-01-01
01:00:00.000000000 +0100
+++ new/Flask-Migrate-4.0.5/tests/test_multidb_migrate.py 2023-08-21
20:48:53.000000000 +0200
@@ -0,0 +1,96 @@
+import os
+import shutil
+import unittest
+import subprocess
+import shlex
+import sqlite3
+
+
+def run_cmd(app, cmd):
+ """Run a command and return a tuple with (stdout, stderr, exit_code)"""
+ os.environ['FLASK_APP'] = app
+ process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = process.communicate()
+ print('\n$ ' + cmd)
+ print(stdout.decode('utf-8'))
+ print(stderr.decode('utf-8'))
+ return stdout, stderr, process.wait()
+
+
+class TestMigrate(unittest.TestCase):
+ def setUp(self):
+ os.chdir(os.path.split(os.path.abspath(__file__))[0])
+ try:
+ os.remove('app1.db')
+ os.remove('app2.db')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('migrations')
+ except OSError:
+ pass
+
+ def tearDown(self):
+ try:
+ os.remove('app1.db')
+ os.remove('app2.db')
+ except OSError:
+ pass
+ try:
+ shutil.rmtree('migrations')
+ except OSError:
+ pass
+
+ def test_multidb_migrate_upgrade(self):
+ (o, e, s) = run_cmd('app_multidb.py', 'flask db init --multidb')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_multidb.py', 'flask db migrate')
+ self.assertTrue(s == 0)
+ (o, e, s) = run_cmd('app_multidb.py', 'flask db upgrade')
+ self.assertTrue(s == 0)
+
+ # ensure the tables are in the correct databases
+ conn1 = sqlite3.connect('app1.db')
+ c = conn1.cursor()
+ c.execute('select name from sqlite_master')
+ tables = c.fetchall()
+ conn1.close()
+ self.assertIn(('alembic_version',), tables)
+ self.assertIn(('user',), tables)
+
+ conn2 = sqlite3.connect('app2.db')
+ c = conn2.cursor()
+ c.execute('select name from sqlite_master')
+ tables = c.fetchall()
+ conn2.close()
+ self.assertIn(('alembic_version',), tables)
+ self.assertIn(('group',), tables)
+
+ # ensure the databases can be written to
+ from .app_multidb import app, db, User, Group
+ with app.app_context():
+ db.engine.dispose()
+ db.session.add(User(name='test'))
+ db.session.add(Group(name='group'))
+ db.session.commit()
+
+ # ensure the downgrade works
+ (o, e, s) = run_cmd('app_multidb.py', 'flask db downgrade')
+ self.assertTrue(s == 0)
+
+ conn1 = sqlite3.connect('app1.db')
+ c = conn1.cursor()
+ c.execute('select name from sqlite_master')
+ tables = c.fetchall()
+ conn1.close()
+ self.assertIn(('alembic_version',), tables)
+ self.assertNotIn(('user',), tables)
+
+ conn2 = sqlite3.connect('app2.db')
+ c = conn2.cursor()
+ c.execute('select name from sqlite_master')
+ tables = c.fetchall()
+ conn2.close()
+ self.assertIn(('alembic_version',), tables)
+ self.assertNotIn(('group',), tables)