Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 25, 2024
1 parent 67302e2 commit 5202a77
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 97 deletions.
6 changes: 3 additions & 3 deletions src/coaster/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]

Expand Down
4 changes: 2 additions & 2 deletions src/coaster/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
__all__ = [
'CurrentAuth',
'GetCurrentAuth',
'add_auth_attribute',
'add_auth_anchor',
'request_has_auth',
'add_auth_attribute',
'current_auth',
'request_has_auth',
]


Expand Down
12 changes: 6 additions & 6 deletions src/coaster/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/coaster/sqlalchemy/comparators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
__all__ = [
'SplitIndexComparator',
'SqlSplitIdComparator',
'SqlUuidHexComparator',
'SqlUuidB64Comparator',
'SqlUuidB58Comparator',
'SqlUuidB64Comparator',
'SqlUuidHexComparator',
]


Expand Down
4 changes: 2 additions & 2 deletions src/coaster/sqlalchemy/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/immutable_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from .annotations import annotation_wrapper, annotations_configured

__all__ = ['immutable', 'cached', 'ImmutableColumnError']
__all__ = ['ImmutableColumnError', 'cached', 'immutable']


immutable = annotation_wrapper(
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from ..utils import markdown as markdown_processor

__all__ = ['MarkdownComposite', 'MarkdownColumn', 'markdown_column']
__all__ = ['MarkdownColumn', 'MarkdownComposite', 'markdown_column']


class MarkdownComposite(MutableComposite):
Expand Down
24 changes: 12 additions & 12 deletions src/coaster/sqlalchemy/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/coaster/sqlalchemy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

MAX_PER_PAGE_DEFAULT: Final[int] = 100

__all__ = ['SelectPagination', 'QueryPagination']
__all__ = ['QueryPagination', 'SelectPagination']


class Pagination(Generic[_O]):
Expand Down
6 changes: 3 additions & 3 deletions src/coaster/sqlalchemy/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MyView(ModelView): ...

from ..typing import ReturnDecorator, WrappedFunc

__all__ = ['Registry', 'InstanceRegistry', 'RegistryMixin']
__all__ = ['InstanceRegistry', 'Registry', 'RegistryMixin']


@final
Expand Down
40 changes: 20 additions & 20 deletions src/coaster/sqlalchemy/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__(
Expand Down Expand Up @@ -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__(
Expand Down Expand Up @@ -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]

Expand Down Expand Up @@ -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]]]
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions src/coaster/sqlalchemy/statemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]

Expand Down
6 changes: 3 additions & 3 deletions src/coaster/utils/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

__all__ = [
'DataclassFromType',
'NameTitle',
'LabeledEnum',
'InspectableSet',
'classproperty',
'LabeledEnum',
'NameTitle',
'classmethodproperty',
'classproperty',
]

_T = TypeVar('_T')
Expand Down
8 changes: 4 additions & 4 deletions src/coaster/utils/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]


Expand Down
6 changes: 3 additions & 3 deletions src/coaster/utils/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]


Expand Down
4 changes: 2 additions & 2 deletions src/coaster/utils/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading

0 comments on commit 5202a77

Please sign in to comment.