From: Mike Bayer Date: Sat, 3 Dec 2011 18:36:59 +0000 (-0500) Subject: - Python 2.5 is supported, needs X-Git-Tag: rel_0_1_1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=192d86c69d97286b2284fae39c74c1752077f798;p=thirdparty%2Fsqlalchemy%2Falembic.git - Python 2.5 is supported, needs __future__.with_statement --- diff --git a/CHANGES b/CHANGES index a60f041e..ff9f4dfe 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ - PyPy is supported. +- Python 2.5 is supported, needs + __future__.with_statement + 0.1.0 ===== - Initial release. Status of features: diff --git a/alembic/op.py b/alembic/op.py index 9861db1e..4f3423d9 100644 --- a/alembic/op.py +++ b/alembic/op.py @@ -42,7 +42,8 @@ def _foreign_key_constraint(name, source, referent, local_cols, remote_cols): def _unique_constraint(name, source, local_cols, **kw): t = schema.Table(source, schema.MetaData(), *[schema.Column(n, NULLTYPE) for n in local_cols]) - uq = schema.UniqueConstraint(*t.c, name=name, **kw) + kw['name'] = name + uq = schema.UniqueConstraint(*t.c, **kw) # TODO: need event tests to ensure the event # is fired off here t.append_constraint(uq) diff --git a/alembic/script.py b/alembic/script.py index 770c6506..4b7eaf25 100644 --- a/alembic/script.py +++ b/alembic/script.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + import os from alembic import util import shutil diff --git a/alembic/templates/generic/env.py b/alembic/templates/generic/env.py index fbd0ada0..73ce4037 100644 --- a/alembic/templates/generic/env.py +++ b/alembic/templates/generic/env.py @@ -1,3 +1,4 @@ +from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config from logging.config import fileConfig diff --git a/alembic/util.py b/alembic/util.py index c61040f9..f58992a0 100644 --- a/alembic/util.py +++ b/alembic/util.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + from mako.template import Template import sys import os diff --git a/tests/__init__.py b/tests/__init__.py index e94079d6..4d84331d 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + from sqlalchemy.engine import url, default import shutil import os diff --git a/tests/test_mssql.py b/tests/test_mssql.py index f86f01d2..88ed9b52 100644 --- a/tests/test_mssql.py +++ b/tests/test_mssql.py @@ -1,5 +1,5 @@ """Test op functions against MSSQL.""" - +from __future__ import with_statement from tests import op_fixture, capture_context_buffer, \ _no_sql_testing_config, assert_raises_message, staging_env, \ three_rev_fixture, clear_staging_env diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py index 157b2e8b..46cd81d6 100644 --- a/tests/test_postgresql.py +++ b/tests/test_postgresql.py @@ -1,4 +1,4 @@ - +from __future__ import with_statement from tests import op_fixture, db_for_dialect, eq_, staging_env, \ clear_staging_env, _no_sql_testing_config,\ capture_context_buffer, requires_07 diff --git a/tests/test_sql_script.py b/tests/test_sql_script.py index 85aa33d5..ab86f19b 100644 --- a/tests/test_sql_script.py +++ b/tests/test_sql_script.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + from tests import clear_staging_env, staging_env, \ _no_sql_testing_config, sqlite_db, eq_, ne_, capture_context_buffer, \ three_rev_fixture diff --git a/tests/test_versioning.py b/tests/test_versioning.py index 75ba348a..4ba09e5a 100644 --- a/tests/test_versioning.py +++ b/tests/test_versioning.py @@ -1,3 +1,4 @@ +from __future__ import with_statement from tests import clear_staging_env, staging_env, _sqlite_testing_config, sqlite_db, eq_, ne_ from alembic import command, util from alembic.script import ScriptDirectory