]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- repair argspec to work with py3k also
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 11 Feb 2013 22:19:42 +0000 (17:19 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 11 Feb 2013 22:19:42 +0000 (17:19 -0500)
- relying upon SQLA argspec compat here, so let's also bump compatibility
to 0.7.3, as 0.6 is working poorly in any case

alembic/command.py
alembic/util.py
docs/build/changelog.rst
docs/build/front.rst

index b3341472981fd1834fb82a77ac354786280c6302..0ed984357cebdfd7bc93615bda0e769abbb57a9d 100644 (file)
@@ -1,6 +1,6 @@
 from alembic.script import ScriptDirectory
 from alembic.environment import EnvironmentContext
-from alembic import util, ddl, autogenerate as autogen
+from alembic import util, autogenerate as autogen
 import os
 
 def list_templates(config):
@@ -76,7 +76,6 @@ def revision(config, message=None, autogenerate=False, sql=False):
 
     if autogenerate:
         environment = True
-        util.requires_07("autogenerate")
         def retrieve_migrations(rev, context):
             if script.get_revision(rev) is not script.get_revision("head"):
                 raise util.CommandError("Target database is not up to date.")
index 6d7caf087f57be72e22e91e7374d62fdeab1185e..7f06f4aff4cf7453ce2d3e242df999222535fa7b 100644 (file)
@@ -10,7 +10,6 @@ import warnings
 import re
 import inspect
 import uuid
-from sqlalchemy.util import format_argspec_plus, update_wrapper
 
 class CommandError(Exception):
     pass
@@ -22,21 +21,15 @@ def _safe_int(value):
     except:
         return value
 _vers = tuple([_safe_int(x) for x in re.findall(r'(\d+|[abc]\d)', __version__)])
-sqla_06 = _vers > (0, 6)
-sqla_07 = _vers > (0, 7)
+sqla_07 = _vers > (0, 7, 2)
 sqla_08 = _vers >= (0, 8, 0, 'b2')
-if not sqla_06:
+if not sqla_07:
     raise CommandError(
-            "SQLAlchemy 0.6 or greater is required. "
-            "Version 0.7 or above required for full featureset.")
-
-def requires_07(feature):
-    if not sqla_07:
-        raise CommandError(
-            "The %s feature requires "
-            "SQLAlchemy 0.7 or greater."
-            % feature
-        )
+            "SQLAlchemy 0.7.3 or greater is required. ")
+
+from sqlalchemy.util import format_argspec_plus, update_wrapper
+from sqlalchemy.util.compat import inspect_getfullargspec
+
 try:
     width = int(os.environ['COLUMNS'])
 except (KeyError, ValueError):
@@ -85,7 +78,7 @@ def create_module_class_proxy(cls, globals_, locals_):
             num_defaults += len(spec[3])
         name_args = spec[0]
         if num_defaults:
-            defaulted_vals = name_args[0-num_defaults:]
+            defaulted_vals = name_args[0 - num_defaults:]
         else:
             defaulted_vals = ()
 
@@ -114,10 +107,10 @@ def create_module_class_proxy(cls, globals_, locals_):
             return _proxy.%(name)s(%(apply_kw)s)
             e
         """ % {
-            'name':name,
-            'args':args[1:-1],
-            'apply_kw':apply_kw[1:-1],
-            'doc':fn.__doc__,
+            'name': name,
+            'args': args[1:-1],
+            'apply_kw': apply_kw[1:-1],
+            'doc': fn.__doc__,
         })
         lcl = {}
         exec func_text in globals_, lcl
@@ -173,7 +166,7 @@ def msg(msg, newline=True):
     lines = textwrap.wrap(msg, width)
     if len(lines) > 1:
         for line in lines[0:-1]:
-            sys.stdout.write("  " +line + "\n")
+            sys.stdout.write("  " + line + "\n")
     sys.stdout.write("  " + lines[-1] + ("\n" if newline else ""))
 
 def load_python_file(dir_, filename):
@@ -256,7 +249,8 @@ class immutabledict(dict):
 
 def _with_legacy_names(translations):
     def decorate(fn):
-        spec = inspect.getargspec(fn)
+
+        spec = inspect_getfullargspec(fn)
         metadata = dict(target='target', fn='fn')
         metadata.update(format_argspec_plus(spec, grouped=False))
 
index 8e52544f5fb2fbd8bcd49af96fd785685cac00bf..15e57ddb389fbcabb5a443456b4f9e3554f7e4ff 100644 (file)
@@ -6,6 +6,12 @@ Changelog
 .. changelog::
     :version: 0.5.0
 
+    .. change::
+        :tags: change
+
+      SQLAlchemy 0.6 is no longer supported by Alembic - minimum version is 0.7.3,
+      full support is as of 0.7.9.
+
     .. change::
         :tags: bug
         :tickets: 104
index c595ea4a356f4ebcfb8cc56a4747c972daa9a863..71444a38cb9a144d78833e764f4ed95cfd067f37 100644 (file)
@@ -48,8 +48,11 @@ Dependencies
 
 Alembic's install process will ensure that `SQLAlchemy <http://www.sqlalchemy.org>`_
 is installed, in addition to other dependencies.  Alembic will work with
-SQLAlchemy as of version **0.6**, though with a limited featureset.
-The latest version of SQLAlchemy within the **0.7** or **0.8** series is strongly recommended.
+SQLAlchemy as of version **0.7.3**.   The latest version of SQLAlchemy within
+the **0.7** or **0.8** series is strongly recommended.
+
+.. versionchanged:: 0.5.0
+       Support for SQLAlchemy 0.6 has been dropped.
 
 
 Community