summaryrefslogtreecommitdiff
path: root/alembic/script
diff options
context:
space:
mode:
Diffstat (limited to 'alembic/script')
-rw-r--r--alembic/script/__init__.py3
-rw-r--r--alembic/script/base.py13
-rw-r--r--alembic/script/revision.py5
3 files changed, 12 insertions, 9 deletions
diff --git a/alembic/script/__init__.py b/alembic/script/__init__.py
index 65562b4..540d627 100644
--- a/alembic/script/__init__.py
+++ b/alembic/script/__init__.py
@@ -1,3 +1,4 @@
-from .base import ScriptDirectory, Script # noqa
+from .base import Script # noqa
+from .base import ScriptDirectory # noqa
__all__ = ["ScriptDirectory", "Script"]
diff --git a/alembic/script/base.py b/alembic/script/base.py
index 1c63e08..b386dea 100644
--- a/alembic/script/base.py
+++ b/alembic/script/base.py
@@ -1,14 +1,15 @@
+from contextlib import contextmanager
import datetime
-from dateutil import tz
import os
import re
import shutil
-from .. import util
-from ..util import compat
+
+from dateutil import tz
+
from . import revision
+from .. import util
from ..runtime import migration
-
-from contextlib import contextmanager
+from ..util import compat
_sourceless_rev_file = re.compile(r"(?!\.\#|__init__)(.*\.py)(c|o)?$")
_only_source_rev_file = re.compile(r"(?!\.\#|__init__)(.*\.py)$")
@@ -42,7 +43,7 @@ class ScriptDirectory(object):
def __init__(
self,
- dir,
+ dir, # noqa
file_template=_default_file_template,
truncate_slug_length=40,
version_locations=None,
diff --git a/alembic/script/revision.py b/alembic/script/revision.py
index 832cce1..af08688 100644
--- a/alembic/script/revision.py
+++ b/alembic/script/revision.py
@@ -1,8 +1,9 @@
-import re
import collections
+import re
-from .. import util
from sqlalchemy import util as sqlautil
+
+from .. import util
from ..util import compat
_relative_destination = re.compile(r"(?:(.+?)@)?(\w+)?((?:\+|-)\d+)")