[python-migrate/el6-havana] look for python-sqlalchemy0.7

Pádraig Brady pbrady at fedoraproject.org
Wed Sep 11 15:11:30 UTC 2013


commit 1a1fe7fedfa77e564128c2aeba8d66814f263c79
Author: Pádraig Brady <P at draigBrady.com>
Date:   Wed Sep 11 16:10:28 2013 +0100

    look for python-sqlalchemy0.7

 python-migrate-newdeps.patch |   28 ++++++++++++++++++++++++++++
 python-migrate.spec          |    3 +++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/python-migrate-newdeps.patch b/python-migrate-newdeps.patch
new file mode 100644
index 0000000..e0a867b
--- /dev/null
+++ b/python-migrate-newdeps.patch
@@ -0,0 +1,28 @@
+diff -Naur sqlalchemy-migrate-0.7.2.orig/migrate/__init__.py sqlalchemy-migrate-0.7.2/migrate/__init__.py
+--- sqlalchemy-migrate-0.7.2.orig/migrate/__init__.py	2011-11-01 20:22:48.000000000 +0000
++++ sqlalchemy-migrate-0.7.2/migrate/__init__.py	2013-09-11 15:08:35.490188662 +0000
+@@ -9,3 +9,24 @@
+ from migrate.changeset import *
+ 
+ __version__ = '0.7.2'
++
++import sys
++import pkg_resources
++
++# If there is a conflicting non egg module,
++# i.e. an older standard system module installed,
++# then replace it with this requirement
++def replace_dist(requirement):
++    try:
++        return pkg_resources.require(requirement)
++    except pkg_resources.VersionConflict:
++        e = sys.exc_info()[1]
++        dist=e.args[0]
++        req=e.args[1]
++        if dist.key == req.key and not dist.location.endswith('.egg'):
++            del pkg_resources.working_set.by_key[dist.key]
++            # We assume there is no need to adjust sys.path
++            # and the associated pkg_resources.working_set.entries
++            return pkg_resources.require(requirement)
++
++replace_dist("SQLAlchemy >= 0.6.3")
diff --git a/python-migrate.spec b/python-migrate.spec
index 2d7be66..9be6baf 100644
--- a/python-migrate.spec
+++ b/python-migrate.spec
@@ -23,6 +23,8 @@ Patch2: migrate-test-int-overflow.patch
 Patch3: python-migrate-sqlalchemy-0.8.patch
 # Local patch to rename /usr/bin/migrate to sqlalchemy-migrate
 Patch100: python-migrate-sqlalchemy-migrate.patch
+# Look for parallel installable sqlalchemy version
+Patch200: python-migrate-newdeps.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -65,6 +67,7 @@ database change sets and database repository versioning.
 %patch2 -p1 -b .pynew
 %patch3 -p1 -b .sql0.8
 %patch100 -p1 -b .rename
+%patch200 -p1 -b .newdeps
 
 # use real unittest in python 2.7 and up
 %if 0%{?fedora} || 0%{?rhel} > 6


More information about the scm-commits mailing list