Commits

Mike Bayer committed 78ca659

absolute imports in core, sql

Comments (0)

Files changed (17)

lib/sqlalchemy/__init__.py

 import inspect as _inspect
 import sys
 
-from sqlalchemy.sql import (
+from .sql import (
     alias,
     and_,
     asc,
     update,
     )
 
-from sqlalchemy.types import (
+from .types import (
     BIGINT,
     BINARY,
     BLOB,
     )
 
 
-from sqlalchemy.schema import (
+from .schema import (
     CheckConstraint,
     Column,
     ColumnDefault,
     UniqueConstraint,
     )
 
-from sqlalchemy.inspection import inspect
+from .inspection import inspect
 
-from sqlalchemy.engine import create_engine, engine_from_config
+from .engine import create_engine, engine_from_config
 
 
 __all__ = sorted(name for name, obj in locals().items()
 
 del _inspect, sys
 
-from sqlalchemy import util as _sa_util
+from . import util as _sa_util
 _sa_util.importlater.resolve_all()

lib/sqlalchemy/event.py

 
 """Base event API."""
 
-from sqlalchemy import util, exc
+from . import util, exc
 
 CANCEL = util.symbol('CANCEL')
 NO_RETVAL = util.symbol('NO_RETVAL')

lib/sqlalchemy/events.py

 
 """Core event interfaces."""
 
-from sqlalchemy import event, exc, util
+from . import event, exc, util
 engine = util.importlater('sqlalchemy', 'engine')
 pool = util.importlater('sqlalchemy', 'pool')
 

lib/sqlalchemy/inspection.py

 of argument.
 """
 
-from sqlalchemy import util
+from . import util
 _registrars = util.defaultdict(list)
 
 def inspect(subject):

lib/sqlalchemy/interfaces.py

 
 """
 
-from sqlalchemy import event, util
+from . import event, util
 
 class PoolListener(object):
     """Hooks into the lifecycle of connections in a :class:`.Pool`.

lib/sqlalchemy/log.py

 
 import logging
 import sys
-from sqlalchemy import util
+from . import util
 
 # set initial level to WARN.  This so that
 # log statements don't occur in the absense of explicit

lib/sqlalchemy/orm/state.py

     SQL_OK, NEVER_SET, ATTR_WAS_SET, NO_VALUE,\
     PASSIVE_NO_INITIALIZE
     )
-
 mapperlib = util.importlater("sqlalchemy.orm", "mapperlib")
 sessionlib = util.importlater("sqlalchemy.orm", "session")
 

lib/sqlalchemy/pool.py

 
 import weakref, time, traceback
 
-from sqlalchemy import exc, log, event, events, interfaces, util
-from sqlalchemy.util import queue as sqla_queue
-from sqlalchemy.util import threading, memoized_property, \
+from . import exc, log, event, events, interfaces, util
+from .util import queue as sqla_queue
+from .util import threading, memoized_property, \
     chop_traceback
 proxies = {}
 

lib/sqlalchemy/schema.py

 
 """
 import re, inspect
-from sqlalchemy import exc, util, dialects
-from sqlalchemy.sql import expression, visitors
-from sqlalchemy import event, events
-
+from . import exc, util, dialects, event, events
+from .sql import expression, visitors
 
 ddl = util.importlater("sqlalchemy.engine", "ddl")
 sqlutil = util.importlater("sqlalchemy.sql", "util")

lib/sqlalchemy/sql/__init__.py

 # This module is part of SQLAlchemy and is released under
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
-from sqlalchemy.sql.expression import (
+from .expression import (
     Alias,
     ClauseElement,
     ColumnCollection,
     update,
     )
 
-from sqlalchemy.sql.visitors import ClauseVisitor
+from .visitors import ClauseVisitor
 
 __tmp = locals().keys()
 __all__ = sorted([i for i in __tmp if not i.startswith('__')])

lib/sqlalchemy/sql/compiler.py

 
 import re
 import sys
-from sqlalchemy import schema, engine, util, exc
-from sqlalchemy.sql import operators, functions, util as sql_util, \
-    visitors
-from sqlalchemy.sql import expression as sql
+from .. import schema, engine, util, exc
+from . import (
+    operators, functions, util as sql_util, visitors, expression as sql
+)
 import decimal
 
 RESERVED_WORDS = set([

lib/sqlalchemy/sql/expression.py

 import itertools, re
 from operator import attrgetter
 
-from sqlalchemy import util, exc
-from sqlalchemy.sql import operators
-from sqlalchemy.sql.operators import Operators, ColumnOperators
-from sqlalchemy.sql.visitors import Visitable, cloned_traverse
+from .. import util, exc
+from . import operators
+from .operators import ColumnOperators
+from .visitors import Visitable, cloned_traverse
 import operator
 
 functions = util.importlater("sqlalchemy.sql", "functions")

lib/sqlalchemy/sql/functions.py

 # This module is part of SQLAlchemy and is released under
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
-from sqlalchemy import types as sqltypes, schema
-from sqlalchemy.sql.expression import (
+from .. import types as sqltypes, schema
+from .expression import (
     ClauseList, Function, _literal_as_binds, text, _type_from_args
     )
-from sqlalchemy.sql import operators
-from sqlalchemy.sql.visitors import VisitableType
+from . import operators
+from .visitors import VisitableType
 
 class _GenericMeta(VisitableType):
     def __call__(self, *args, **kwargs):

lib/sqlalchemy/sql/operators.py

 from operator import (div,)
 # end Py2K
 
-from sqlalchemy.util import symbol
+from ..util import symbol
 
 class Operators(object):
     """Base of comparison and logical operators.

lib/sqlalchemy/sql/util.py

 # This module is part of SQLAlchemy and is released under
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
-from sqlalchemy import exc, schema, util, sql, types as sqltypes
-from sqlalchemy.util import topological
-from sqlalchemy.sql import expression, operators, visitors
+from .. import exc, schema, util, sql
+from ..util import topological
+from . import expression, operators, visitors
 from itertools import chain
 from collections import deque
 

lib/sqlalchemy/sql/visitors.py

 
 from collections import deque
 import re
-from sqlalchemy import util
+from .. import util
 import operator
 
 __all__ = ['VisitableType', 'Visitable', 'ClauseVisitor', 

lib/sqlalchemy/types.py

             'LargeBinary', 'Binary', 'Boolean', 'Unicode', 'Concatenable',
             'UnicodeText','PickleType', 'Interval', 'Enum' ]
 
-import inspect
 import datetime as dt
 import codecs
 
-from sqlalchemy import exc, schema
-from sqlalchemy.sql import expression, operators
-from sqlalchemy.util import pickle
-from sqlalchemy.util.compat import decimal
-from sqlalchemy.sql.visitors import Visitable
-from sqlalchemy import util
-from sqlalchemy import processors, events, event
-import collections
+from . import exc, schema, util, processors, events, event
+from .sql import operators
+from .util import pickle
+from .util.compat import decimal
+from .sql.visitors import Visitable
 default = util.importlater("sqlalchemy.engine", "default")
 
 NoneType = type(None)