[python-migrate] Update to new version compatible with SQLAlchemy 0.7.x.

Toshio くらとみ toshio at fedoraproject.org
Sat Jun 25 15:37:03 UTC 2011


commit 2edd588bf3c73a9f3aec28330267de66ace45b3a
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Sat Jun 25 08:36:43 2011 -0700

    Update to new version compatible with SQLAlchemy 0.7.x.

 migrate-py27.patch                      |   20 ++++-----------
 migrate-scripttest-update.patch         |    6 ++--
 python-migrate-sqlalchemy-migrate.patch |   40 +++++++++++++++---------------
 python-migrate.spec                     |   10 +++++--
 4 files changed, 36 insertions(+), 40 deletions(-)
---
diff --git a/migrate-py27.patch b/migrate-py27.patch
index 2d74db8..1025b87 100644
--- a/migrate-py27.patch
+++ b/migrate-py27.patch
@@ -1,17 +1,9 @@
-Index: sqlalchemy-migrate-0.6/migrate/tests/versioning/test_shell.py
+Index: sqlalchemy-migrate-0.7.1/migrate/tests/versioning/test_shell.py
 ===================================================================
---- sqlalchemy-migrate-0.6.orig/migrate/tests/versioning/test_shell.py
-+++ sqlalchemy-migrate-0.6/migrate/tests/versioning/test_shell.py
-@@ -4,6 +4,7 @@
- import os
- import sys
- import tempfile
-+
- try:
-     from runpy import run_module
- except ImportError:
-@@ -476,8 +477,18 @@ class TestShellDatabase(Shell, DB):
-         self.assert_("tables missing in database: tmp_account_rundiffs" in result.stdout)
+--- sqlalchemy-migrate-0.7.1.orig/migrate/tests/versioning/test_shell.py
++++ sqlalchemy-migrate-0.7.1/migrate/tests/versioning/test_shell.py
+@@ -482,8 +482,18 @@ class TestShellDatabase(Shell, DB):
+         self.assert_("tables missing from database: tmp_account_rundiffs" in result.stdout)
  
          # Test Deprecation
 +        if 'PYTHONWARNINGS' in self.env.environ:
@@ -28,4 +20,4 @@ Index: sqlalchemy-migrate-0.6/migrate/tests/versioning/test_shell.py
 +
          self.assertEqual(result.returncode, 0)
          self.assertTrue("DeprecationWarning" in result.stderr)
-         self.assert_("tables missing in database: tmp_account_rundiffs" in result.stdout)
+         self.assert_("tables missing from database: tmp_account_rundiffs" in result.stdout)
diff --git a/migrate-scripttest-update.patch b/migrate-scripttest-update.patch
index 0fc0dc6..7b9607b 100644
--- a/migrate-scripttest-update.patch
+++ b/migrate-scripttest-update.patch
@@ -1,7 +1,7 @@
-Index: sqlalchemy-migrate-0.6/migrate/tests/fixture/shell.py
+Index: sqlalchemy-migrate-0.7.1/migrate/tests/fixture/shell.py
 ===================================================================
---- sqlalchemy-migrate-0.6.orig/migrate/tests/fixture/shell.py
-+++ sqlalchemy-migrate-0.6/migrate/tests/fixture/shell.py
+--- sqlalchemy-migrate-0.7.1.orig/migrate/tests/fixture/shell.py
++++ sqlalchemy-migrate-0.7.1/migrate/tests/fixture/shell.py
 @@ -22,7 +22,6 @@ class Shell(Pathed):
          log.debug('PATH for ScriptTest: %s', migrate_path)
          self.env = TestFileEnvironment(
diff --git a/python-migrate-sqlalchemy-migrate.patch b/python-migrate-sqlalchemy-migrate.patch
index 8696358..60fa3af 100644
--- a/python-migrate-sqlalchemy-migrate.patch
+++ b/python-migrate-sqlalchemy-migrate.patch
@@ -33,7 +33,7 @@ Index: migrate/tests/versioning/test_shell.py
 ===================================================================
 --- migrate/tests/versioning/test_shell.py.orig
 +++ migrate/tests/versioning/test_shell.py
-@@ -25,15 +25,15 @@ class TestShellCommands(Shell):
+@@ -21,15 +21,15 @@ class TestShellCommands(Shell):
  
      def test_help(self):
          """Displays default help dialog"""
@@ -53,7 +53,7 @@ Index: migrate/tests/versioning/test_shell.py
              self.assertTrue(isinstance(result.stdout, basestring))
              self.assertTrue(result.stdout)
              self.assertFalse(result.stderr)
-@@ -41,10 +41,10 @@ class TestShellCommands(Shell):
+@@ -37,10 +37,10 @@ class TestShellCommands(Shell):
      def test_shutdown_logging(self):
          """Try to shutdown logging output"""
          repos = self.tmp_repos()
@@ -67,7 +67,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assertEqual(result.stdout, '')
  
          # TODO: assert logging messages to 0
-@@ -89,7 +89,7 @@ class TestShellCommands(Shell):
+@@ -94,7 +94,7 @@ class TestShellCommands(Shell):
          repos = self.tmp_repos()
  
          # Creating a file that doesn't exist should succeed
@@ -76,7 +76,7 @@ Index: migrate/tests/versioning/test_shell.py
  
          # Files should actually be created
          self.assert_(os.path.exists(repos))
-@@ -99,35 +99,35 @@ class TestShellCommands(Shell):
+@@ -104,35 +104,35 @@ class TestShellCommands(Shell):
          self.assertNotEquals(repos_.config.get('db_settings', 'version_table'), 'None')
  
          # Can't create it again: it already exists
@@ -120,7 +120,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assert_(os.path.exists('%s/versions/002_postgres_upgrade.sql' % repos))
          self.assert_(os.path.exists('%s/versions/002_postgres_downgrade.sql' % repos))
  
-@@ -139,7 +139,7 @@ class TestShellCommands(Shell):
+@@ -144,7 +144,7 @@ class TestShellCommands(Shell):
          self.assert_(not os.path.exists(script))
  
          # No attempt is made to verify correctness of the repository path here
@@ -129,7 +129,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assert_(os.path.exists(script))
  
  
-@@ -150,41 +150,41 @@ class TestShellRepository(Shell):
+@@ -155,41 +155,41 @@ class TestShellRepository(Shell):
          """Create repository, python change script"""
          super(TestShellRepository, self).setUp()
          self.path_repos = self.tmp_repos()
@@ -180,7 +180,7 @@ Index: migrate/tests/versioning/test_shell.py
              (filename, self.path_repos))
          self.assert_(os.path.exists(filename))
          fd = open(filename)
-@@ -204,17 +204,17 @@ class TestShellDatabase(Shell, DB):
+@@ -209,17 +209,17 @@ class TestShellDatabase(Shell, DB):
          """Ensure we can set version control on a database"""
          path_repos = repos = self.tmp_repos()
          url = self.url
@@ -203,7 +203,7 @@ Index: migrate/tests/versioning/test_shell.py
              % locals(), expect_error=True)
          self.assertEqual(result.returncode, 1)
  
-@@ -223,41 +223,41 @@ class TestShellDatabase(Shell, DB):
+@@ -228,41 +228,41 @@ class TestShellDatabase(Shell, DB):
          """Commands with default arguments set by manage.py"""
          path_repos = repos = self.tmp_repos()
          url = self.url
@@ -256,7 +256,7 @@ Index: migrate/tests/versioning/test_shell.py
  
      @usedb()
      def test_upgrade(self):
-@@ -265,67 +265,67 @@ class TestShellDatabase(Shell, DB):
+@@ -270,67 +270,67 @@ class TestShellDatabase(Shell, DB):
          # Create a repository
          repos_name = 'repos_name'
          repos_path = self.tmp()
@@ -345,7 +345,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assertEquals(self.run_version(repos_path), 1)
          self.assertEquals(len(os.listdir(os.path.join(repos_path, 'versions'))), beforeCount + 2)
  
-@@ -335,11 +335,11 @@ class TestShellDatabase(Shell, DB):
+@@ -340,11 +340,11 @@ class TestShellDatabase(Shell, DB):
          self.assertEquals(self.run_db_version(self.url, repos_path), 0)
          self.assertRaises(Exception, self.engine.text('select * from t_table').execute)
  
@@ -359,7 +359,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assertEquals(self.run_db_version(self.url, repos_path), 0)
          self.assertRaises(Exception, self.engine.text('select * from t_table').execute)
  
-@@ -379,15 +379,15 @@ class TestShellDatabase(Shell, DB):
+@@ -384,15 +384,15 @@ class TestShellDatabase(Shell, DB):
          repos_name = 'repos_name'
          repos_path = self.tmp()
  
@@ -380,7 +380,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assertEquals(self.run_version(repos_path), 1)
          self.assertEquals(self.run_db_version(self.url, repos_path), 0)
  
-@@ -409,7 +409,7 @@ class TestShellDatabase(Shell, DB):
+@@ -414,7 +414,7 @@ class TestShellDatabase(Shell, DB):
          file.write(script_text)
          file.close()
  
@@ -389,7 +389,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assertEqual(result.returncode, 2)
          self.assertEquals(self.run_version(repos_path), 1)
          self.assertEquals(self.run_db_version(self.url, repos_path), 0)
-@@ -440,7 +440,7 @@ class TestShellDatabase(Shell, DB):
+@@ -445,7 +445,7 @@ class TestShellDatabase(Shell, DB):
          file = open(script_path, 'w')
          file.write(script_text)
          file.close()
@@ -398,7 +398,7 @@ Index: migrate/tests/versioning/test_shell.py
          self.assertEquals(self.run_version(repos_path), 1)
          self.assertEquals(self.run_db_version(self.url, repos_path), 0)
          
-@@ -460,19 +460,19 @@ class TestShellDatabase(Shell, DB):
+@@ -465,19 +465,19 @@ class TestShellDatabase(Shell, DB):
          self.meta.reflect()
          self.meta.drop_all()  # in case junk tables are lying around in the test database
  
@@ -421,9 +421,9 @@ Index: migrate/tests/versioning/test_shell.py
 -        result = self.env.run('migrate compare_model_to_db %s %s --model=%s' \
 +        result = self.env.run('sqlalchemy-migrate compare_model_to_db %s %s --model=%s' \
              % (self.url, repos_path, model_module))
-         self.assert_("tables missing in database: tmp_account_rundiffs" in result.stdout)
+         self.assert_("tables missing from database: tmp_account_rundiffs" in result.stdout)
  
-@@ -482,7 +482,7 @@ class TestShellDatabase(Shell, DB):
+@@ -487,7 +487,7 @@ class TestShellDatabase(Shell, DB):
          else:
              warnings = None
          self.env.environ['PYTHONWARNINGS'] = 'default'
@@ -432,8 +432,8 @@ Index: migrate/tests/versioning/test_shell.py
              % (self.url, repos_path, model_module.replace(":", ".")), expect_error=True)
          if warnings == None:
              del(self.env.environ['PYTHONWARNINGS'])
-@@ -494,19 +494,19 @@ class TestShellDatabase(Shell, DB):
-         self.assert_("tables missing in database: tmp_account_rundiffs" in result.stdout)
+@@ -499,19 +499,19 @@ class TestShellDatabase(Shell, DB):
+         self.assert_("tables missing from database: tmp_account_rundiffs" in result.stdout)
  
          # Update db to latest model.
 -        result = self.env.run('migrate update_db_from_model %s %s %s'\
@@ -457,7 +457,7 @@ Index: migrate/tests/versioning/test_shell.py
          temp_dict = dict()
          exec result.stdout in temp_dict
  
-@@ -520,10 +520,10 @@ class TestShellDatabase(Shell, DB):
+@@ -525,10 +525,10 @@ class TestShellDatabase(Shell, DB):
    ##Column('passwd', String(length=None, convert_unicode=False, assert_unicode=None))""" in result.stdout)
  
          ## We're happy with db changes, make first db upgrade script to go from version 0 -> 1.
@@ -470,7 +470,7 @@ Index: migrate/tests/versioning/test_shell.py
              #% (self.url, repos_path, old_model_module, model_module))
          #self.assertEqualsIgnoreWhitespace(result_script.stdout,
          #'''from sqlalchemy import *
-@@ -550,11 +550,11 @@ class TestShellDatabase(Shell, DB):
+@@ -555,11 +555,11 @@ class TestShellDatabase(Shell, DB):
              #tmp_account_rundiffs.drop()''')
      
          ## Save the upgrade script.
diff --git a/python-migrate.spec b/python-migrate.spec
index 3b39bd1..815b2bc 100644
--- a/python-migrate.spec
+++ b/python-migrate.spec
@@ -5,8 +5,8 @@
 %global srcname sqlalchemy-migrate
 
 Name: python-migrate
-Version: 0.6
-Release: 4%{?dist}
+Version: 0.7.1
+Release: 1%{?dist}
 Summary: Schema migration tools for SQLAlchemy
 
 Group: Development/Languages
@@ -85,16 +85,20 @@ nosetests
 
 %files
 %defattr(-,root,root,-)
-%doc README TODO docs/
+%doc README docs/
 %{_bindir}/*
 %{python_sitelib}/*
 
 %changelog
+* Sat Jun 25 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 0.7-1
+- Update to new version compatible with SQLAlchemy 0.7.x.
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
 * Thu Jan 13 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 0.6-3
 - Fix SQLAlchemy Requires -- need >= 0.5, not 0.6
+
 * Sun Aug 1 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 0.6-2
 - Update to unittests to work with newer scripttest API
 


More information about the scm-commits mailing list