diff --git a/src/coaster/assets.py b/src/coaster/assets.py index d002f3c6..1dfe3ecf 100644 --- a/src/coaster/assets.py +++ b/src/coaster/assets.py @@ -35,11 +35,11 @@ # Version is not used here but is made available for others to import from __all__ = [ - 'Version', - 'SimpleSpec', - 'VersionedAssets', 'AssetNotFound', 'AssetNotFoundError', + 'SimpleSpec', + 'Version', + 'VersionedAssets', 'WebpackManifest', ] diff --git a/src/coaster/auth.py b/src/coaster/auth.py index e0d724fc..3c3a755f 100644 --- a/src/coaster/auth.py +++ b/src/coaster/auth.py @@ -31,10 +31,10 @@ __all__ = [ 'CurrentAuth', 'GetCurrentAuth', - 'add_auth_attribute', 'add_auth_anchor', - 'request_has_auth', + 'add_auth_attribute', 'current_auth', + 'request_has_auth', ] diff --git a/src/coaster/compat.py b/src/coaster/compat.py index 00a24a28..660ec1fb 100644 --- a/src/coaster/compat.py +++ b/src/coaster/compat.py @@ -116,31 +116,31 @@ 'SansIoRequest', 'SansIoResponse', 'abort', - 'app_ctx_object', 'app_ctx', + 'app_ctx_object', 'async_make_response', - 'async_render_template_string', 'async_render_template', + 'async_render_template_string', 'async_request', - 'current_app_object', 'current_app', + 'current_app_object', 'ensure_sync', 'g', 'has_app_context', 'has_request_context', + 'json', 'json_dump', 'json_dumps', 'json_load', 'json_loads', - 'json', 'jsonify', 'make_response', 'redirect', - 'render_template_string', 'render_template', + 'render_template_string', + 'request', 'request_ctx', 'request_ctx', - 'request', 'session', 'sync_await', 'url_for', diff --git a/src/coaster/sqlalchemy/annotations.py b/src/coaster/sqlalchemy/annotations.py index eff7e39d..50a0253f 100644 --- a/src/coaster/sqlalchemy/annotations.py +++ b/src/coaster/sqlalchemy/annotations.py @@ -57,7 +57,7 @@ def get(cls, **kwargs): from ..signals import coaster_signals -__all__ = ['annotations_configured', 'annotation_wrapper'] +__all__ = ['annotation_wrapper', 'annotations_configured'] # Global dictionary for temporary storage of annotations until the # mapper_configured events diff --git a/src/coaster/sqlalchemy/comparators.py b/src/coaster/sqlalchemy/comparators.py index 4566065b..0f7829f2 100644 --- a/src/coaster/sqlalchemy/comparators.py +++ b/src/coaster/sqlalchemy/comparators.py @@ -15,9 +15,9 @@ __all__ = [ 'SplitIndexComparator', 'SqlSplitIdComparator', - 'SqlUuidHexComparator', - 'SqlUuidB64Comparator', 'SqlUuidB58Comparator', + 'SqlUuidB64Comparator', + 'SqlUuidHexComparator', ] diff --git a/src/coaster/sqlalchemy/functions.py b/src/coaster/sqlalchemy/functions.py index ae4b0492..d986ef7b 100644 --- a/src/coaster/sqlalchemy/functions.py +++ b/src/coaster/sqlalchemy/functions.py @@ -15,11 +15,11 @@ from .query import relationship __all__ = [ - 'make_timestamp_columns', - 'failsafe_add', 'add_primary_relationship', 'auto_init_default', + 'failsafe_add', 'idfilters', + 'make_timestamp_columns', ] T = TypeVar('T') diff --git a/src/coaster/sqlalchemy/immutable_annotation.py b/src/coaster/sqlalchemy/immutable_annotation.py index 4af79940..2be39861 100644 --- a/src/coaster/sqlalchemy/immutable_annotation.py +++ b/src/coaster/sqlalchemy/immutable_annotation.py @@ -10,7 +10,7 @@ from .annotations import annotation_wrapper, annotations_configured -__all__ = ['immutable', 'cached', 'ImmutableColumnError'] +__all__ = ['ImmutableColumnError', 'cached', 'immutable'] immutable = annotation_wrapper( diff --git a/src/coaster/sqlalchemy/markdown.py b/src/coaster/sqlalchemy/markdown.py index 80d601a6..4944ca94 100644 --- a/src/coaster/sqlalchemy/markdown.py +++ b/src/coaster/sqlalchemy/markdown.py @@ -12,7 +12,7 @@ from ..utils import markdown as markdown_processor -__all__ = ['MarkdownComposite', 'MarkdownColumn', 'markdown_column'] +__all__ = ['MarkdownColumn', 'MarkdownComposite', 'markdown_column'] class MarkdownComposite(MutableComposite): diff --git a/src/coaster/sqlalchemy/mixins.py b/src/coaster/sqlalchemy/mixins.py index ed3d05b1..1c2261ee 100644 --- a/src/coaster/sqlalchemy/mixins.py +++ b/src/coaster/sqlalchemy/mixins.py @@ -81,24 +81,24 @@ class MyModel(BaseMixin[int], Model): # Integer serial primary key; alt: UUID from .roles import ActorType, RoleMixin, with_roles __all__ = [ - 'PkeyType', - 'IdentityOptions', - 'IdMixin', - 'TimestampMixin', - 'PermissionMixin', - 'UrlDict', - 'UrlForMixin', - 'NoIdMixin', + 'BaseIdNameMixin', 'BaseMixin', 'BaseNameMixin', - 'BaseScopedNameMixin', - 'BaseIdNameMixin', 'BaseScopedIdMixin', 'BaseScopedIdNameMixin', + 'BaseScopedNameMixin', 'CoordinatesMixin', - 'UuidMixin', - 'RoleMixin', + 'IdMixin', + 'IdentityOptions', + 'NoIdMixin', + 'PermissionMixin', + 'PkeyType', 'RegistryMixin', + 'RoleMixin', + 'TimestampMixin', + 'UrlDict', + 'UrlForMixin', + 'UuidMixin', ] PkeyType = TypeVar('PkeyType', int, UUID, default=int) diff --git a/src/coaster/sqlalchemy/model.py b/src/coaster/sqlalchemy/model.py index 2a79d201..3fe7b2b6 100644 --- a/src/coaster/sqlalchemy/model.py +++ b/src/coaster/sqlalchemy/model.py @@ -90,15 +90,15 @@ class Other(Model): ... from flask_sqlalchemy import SQLAlchemy as FlaskSQLAlchemy __all__ = [ + 'DeclarativeBase', # From SQLAlchemy, re-exported for convenience + 'ModelBase', 'bigint', - 'smallint', 'int_pkey', - 'uuid4_pkey', + 'jsonb', + 'smallint', 'timestamp', 'timestamp_now', - 'jsonb', - 'ModelBase', - 'DeclarativeBase', # From SQLAlchemy, re-exported for convenience + 'uuid4_pkey', ] # --- SQLAlchemy type aliases ---------------------------------------------------------- diff --git a/src/coaster/sqlalchemy/pagination.py b/src/coaster/sqlalchemy/pagination.py index 0d9a5781..78ca128e 100644 --- a/src/coaster/sqlalchemy/pagination.py +++ b/src/coaster/sqlalchemy/pagination.py @@ -22,7 +22,7 @@ MAX_PER_PAGE_DEFAULT: Final[int] = 100 -__all__ = ['SelectPagination', 'QueryPagination'] +__all__ = ['QueryPagination', 'SelectPagination'] class Pagination(Generic[_O]): diff --git a/src/coaster/sqlalchemy/query.py b/src/coaster/sqlalchemy/query.py index 720fcab2..61fc6fa6 100644 --- a/src/coaster/sqlalchemy/query.py +++ b/src/coaster/sqlalchemy/query.py @@ -33,15 +33,15 @@ from .pagination import QueryPagination __all__ = [ + 'AppenderQuery', 'BackrefWarning', + 'DynamicMapped', 'ModelWarning', 'Query', - 'AppenderQuery', 'QueryProperty', - 'DynamicMapped', 'Relationship', - 'relationship', 'backref', + 'relationship', ] _T = TypeVar('_T', bound=Any) diff --git a/src/coaster/sqlalchemy/registry.py b/src/coaster/sqlalchemy/registry.py index ac0ebb84..7db1244c 100644 --- a/src/coaster/sqlalchemy/registry.py +++ b/src/coaster/sqlalchemy/registry.py @@ -54,7 +54,7 @@ class MyView(ModelView): ... from ..typing import ReturnDecorator, WrappedFunc -__all__ = ['Registry', 'InstanceRegistry', 'RegistryMixin'] +__all__ = ['InstanceRegistry', 'Registry', 'RegistryMixin'] @final diff --git a/src/coaster/sqlalchemy/roles.py b/src/coaster/sqlalchemy/roles.py index 84105e3d..71f1d0ec 100644 --- a/src/coaster/sqlalchemy/roles.py +++ b/src/coaster/sqlalchemy/roles.py @@ -181,15 +181,15 @@ def roles_for( __all__ = [ 'ActorType', - 'RoleGrantABC', + 'ConditionalRole', + 'DynamicAssociationProxy', 'LazyRoleSet', 'RoleAccessProxy', - 'DynamicAssociationProxy', + 'RoleGrantABC', 'RoleMixin', 'WithRoles', - 'ConditionalRole', - 'with_roles', 'role_check', + 'with_roles', ] # Global dictionary for temporary storage of roles until the mapper_configured events @@ -414,13 +414,13 @@ class LazyRoleSet(abc.MutableSet): """Set that provides lazy evaluations for whether a role is present.""" __slots__ = ( - 'obj', - 'actor', - 'anchors', - '_present', + '_contents_fully_evaluated', '_not_present', + '_present', '_scanned_granted_by', - '_contents_fully_evaluated', + 'actor', + 'anchors', + 'obj', ) def __init__( @@ -695,7 +695,7 @@ class DynamicAssociationProxy(Generic[_V, _R]): when the relationship includes joins """ - __slots__ = ('rel', 'attr', 'qattr', 'name') + __slots__ = ('attr', 'name', 'qattr', 'rel') name: Optional[str] def __init__( @@ -750,7 +750,7 @@ def __get__( class DynamicAssociationProxyBind(abc.Mapping, Generic[_T, _V, _R]): """:class:`DynamicAssociationProxy` bound to an instance.""" - __slots__ = ('obj', 'rel', 'relattr', 'attr', 'qattr') + __slots__ = ('attr', 'obj', 'qattr', 'rel', 'relattr') relattr: QueryBase qattr: Optional[QueryableAttribute] @@ -862,20 +862,20 @@ class RoleAccessProxy(abc.Mapping, Generic[RoleMixinType]): """ __slots__ = ( - '_obj', - 'current_roles', - '_roles', '_actor', '_anchors', - '_datasets', - '_dataset_attrs', '_call', - '_read', - '_write', + '_dataset_attrs', + '_datasets', + '_dir_cache', '_no_call', '_no_read', '_no_write', - '_dir_cache', + '_obj', + '_read', + '_roles', + '_write', + 'current_roles', ) _obj: RoleMixinType current_roles: InspectableSet[Union[LazyRoleSet, set[str]]] @@ -1481,7 +1481,7 @@ def __get__( class ConditionalRoleBind(abc.Container, abc.Iterable, Generic[_CRM, _CRA]): """Wrapper for :class:`ConditionalRole` bound to an instance of the host class.""" - __slots__ = ('__weakref__', '__self__', '_rolecheck') + __slots__ = ('__self__', '__weakref__', '_rolecheck') def __init__(self, __cr: ConditionalRole[_CRM, _CRA], __obj: _CRM) -> None: self._rolecheck = __cr diff --git a/src/coaster/sqlalchemy/statemanager.py b/src/coaster/sqlalchemy/statemanager.py index b416e221..330589b9 100644 --- a/src/coaster/sqlalchemy/statemanager.py +++ b/src/coaster/sqlalchemy/statemanager.py @@ -249,18 +249,18 @@ class has more than one. All state managers must be in a valid ``from`` state fo from .roles import RoleAccessProxy, RoleMixin __all__ = [ - 'StateManager', + 'AbortTransition', 'ManagedState', 'ManagedStateGroup', - 'StateTransition', - 'StateManagerInstance', 'ManagedStateInstance', - 'StateTransitionWrapper', + 'StateManager', + 'StateManagerInstance', + 'StateTransition', 'StateTransitionError', - 'AbortTransition', - 'transition_error', - 'transition_before', + 'StateTransitionWrapper', 'transition_after', + 'transition_before', + 'transition_error', 'transition_exception', ] diff --git a/src/coaster/utils/classes.py b/src/coaster/utils/classes.py index ce148f85..4167cdc7 100644 --- a/src/coaster/utils/classes.py +++ b/src/coaster/utils/classes.py @@ -24,11 +24,11 @@ __all__ = [ 'DataclassFromType', - 'NameTitle', - 'LabeledEnum', 'InspectableSet', - 'classproperty', + 'LabeledEnum', + 'NameTitle', 'classmethodproperty', + 'classproperty', ] _T = TypeVar('_T') diff --git a/src/coaster/utils/datetime.py b/src/coaster/utils/datetime.py index e5ee4af5..fb37dcda 100644 --- a/src/coaster/utils/datetime.py +++ b/src/coaster/utils/datetime.py @@ -13,13 +13,13 @@ from pytz import BaseTzInfo, utc __all__ = [ - 'utcnow', - 'parse_isoformat', - 'parse_duration', + 'ParseError', 'isoweek_datetime', 'midnight_to_utc', + 'parse_duration', + 'parse_isoformat', 'sorted_timezones', - 'ParseError', + 'utcnow', ] diff --git a/src/coaster/utils/markdown.py b/src/coaster/utils/markdown.py index 95d8aba4..54083371 100644 --- a/src/coaster/utils/markdown.py +++ b/src/coaster/utils/markdown.py @@ -35,11 +35,11 @@ ) __all__ = [ - 'markdown', 'MARKDOWN_HTML_TAGS', - 'default_markdown_extensions_html', - 'default_markdown_extensions', 'default_markdown_extension_configs', + 'default_markdown_extensions', + 'default_markdown_extensions_html', + 'markdown', ] diff --git a/src/coaster/utils/text.py b/src/coaster/utils/text.py index e21cfe69..1480511c 100644 --- a/src/coaster/utils/text.py +++ b/src/coaster/utils/text.py @@ -16,9 +16,9 @@ from markupsafe import Markup __all__ = [ - 'VALID_TAGS', - 'LINKIFY_SKIP_TAGS', 'LINKIFY_CALLBACKS', + 'LINKIFY_SKIP_TAGS', + 'VALID_TAGS', 'compress_whitespace', 'deobfuscate_email', 'normalize_spaces', diff --git a/src/coaster/views/classview.py b/src/coaster/views/classview.py index dab096d5..9cc85f79 100644 --- a/src/coaster/views/classview.py +++ b/src/coaster/views/classview.py @@ -617,7 +617,7 @@ async def __call__( # type: ignore[override] class ViewMethodBind(Generic[_P, _R_co]): """Wrapper for :class:`ViewMethod` binding it to an instance of the view class.""" - __slots__ = ('__weakref__', '_view_method', '__self__') + __slots__ = ('__self__', '__weakref__', '_view_method') # Provide type hints for proxied attributes __name__: str diff --git a/src/coaster/views/decorators.py b/src/coaster/views/decorators.py index ac2a2bc2..a99bc009 100644 --- a/src/coaster/views/decorators.py +++ b/src/coaster/views/decorators.py @@ -48,18 +48,18 @@ from ..utils import InspectableSet, is_collection __all__ = [ - 'ReturnRenderWith', + 'Redirect', 'RequestTypeError', 'RequestValueError', - 'Redirect', - 'requestargs', - 'requestvalues', - 'requestform', - 'requestbody', + 'ReturnRenderWith', + 'cors', 'load_model', 'load_models', 'render_with', - 'cors', + 'requestargs', + 'requestbody', + 'requestform', + 'requestvalues', 'requires_permission', ] diff --git a/src/coaster/views/misc.py b/src/coaster/views/misc.py index 5bee3062..9d0d1dfb 100644 --- a/src/coaster/views/misc.py +++ b/src/coaster/views/misc.py @@ -21,7 +21,7 @@ url_for, ) -__all__ = ['get_current_url', 'get_next_url', 'jsonp', 'endpoint_for'] +__all__ = ['endpoint_for', 'get_current_url', 'get_next_url', 'jsonp'] __jsoncallback_re = re.compile(r'^[a-z$_][0-9a-z$_]*$', re.I)