Skip to content

Commit f38031a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8c26924 commit f38031a

22 files changed

Lines changed: 115 additions & 101 deletions

‎src/coaster/assets.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535

3636
# Version is not used here but is made available for others to import from
3737
__all__ = [
38-
'Version',
39-
'SimpleSpec',
40-
'VersionedAssets',
4138
'AssetNotFound',
4239
'AssetNotFoundError',
40+
'SimpleSpec',
41+
'Version',
42+
'VersionedAssets',
4343
'WebpackManifest',
4444
]
4545

‎src/coaster/auth.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
__all__ = [
3232
'CurrentAuth',
3333
'GetCurrentAuth',
34-
'add_auth_attribute',
3534
'add_auth_anchor',
36-
'request_has_auth',
35+
'add_auth_attribute',
3736
'current_auth',
37+
'request_has_auth',
3838
]
3939

4040

‎src/coaster/compat.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,30 @@
116116
'SansIoRequest',
117117
'SansIoResponse',
118118
'abort',
119-
'app_ctx_object',
120119
'app_ctx',
120+
'app_ctx_object',
121121
'async_make_response',
122-
'async_render_template_string',
123122
'async_render_template',
123+
'async_render_template_string',
124124
'async_request',
125-
'current_app_object',
126125
'current_app',
126+
'current_app_object',
127127
'ensure_sync',
128128
'g',
129129
'has_app_context',
130130
'has_request_context',
131+
'json',
131132
'json_dump',
132133
'json_dumps',
133134
'json_load',
134135
'json_loads',
135-
'json',
136136
'jsonify',
137137
'make_response',
138138
'redirect',
139-
'render_template_string',
140139
'render_template',
141-
'request_ctx',
142-
'request_ctx',
140+
'render_template_string',
143141
'request',
142+
'request_ctx',
144143
'session',
145144
'sync_await',
146145
'url_for',

‎src/coaster/sqlalchemy/annotations.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get(cls, **kwargs):
5757

5858
from ..signals import coaster_signals
5959

60-
__all__ = ['annotations_configured', 'annotation_wrapper']
60+
__all__ = ['annotation_wrapper', 'annotations_configured']
6161

6262
# Global dictionary for temporary storage of annotations until the
6363
# mapper_configured events

‎src/coaster/sqlalchemy/comparators.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
__all__ = [
1616
'SplitIndexComparator',
1717
'SqlSplitIdComparator',
18-
'SqlUuidHexComparator',
19-
'SqlUuidB64Comparator',
2018
'SqlUuidB58Comparator',
19+
'SqlUuidB64Comparator',
20+
'SqlUuidHexComparator',
2121
]
2222

2323

‎src/coaster/sqlalchemy/functions.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
from .query import relationship
1616

1717
__all__ = [
18-
'make_timestamp_columns',
19-
'failsafe_add',
2018
'add_primary_relationship',
2119
'auto_init_default',
20+
'failsafe_add',
2221
'idfilters',
22+
'make_timestamp_columns',
2323
]
2424

2525
T = TypeVar('T')

‎src/coaster/sqlalchemy/immutable_annotation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from .annotations import annotation_wrapper, annotations_configured
1212

13-
__all__ = ['immutable', 'cached', 'ImmutableColumnError']
13+
__all__ = ['ImmutableColumnError', 'cached', 'immutable']
1414

1515

1616
immutable = annotation_wrapper(

‎src/coaster/sqlalchemy/markdown.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ..utils import markdown as markdown_processor
1414

15-
__all__ = ['MarkdownComposite', 'MarkdownColumn', 'markdown_column']
15+
__all__ = ['MarkdownColumn', 'MarkdownComposite', 'markdown_column']
1616

1717

1818
class MarkdownComposite(MutableComposite):

‎src/coaster/sqlalchemy/mixins.py‎

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,24 @@ class MyModel(BaseMixin[int], Model): # Integer serial primary key; alt: UUID
8181
from .roles import ActorType, RoleMixin, with_roles
8282

8383
__all__ = [
84-
'PkeyType',
85-
'IdentityOptions',
86-
'IdMixin',
87-
'TimestampMixin',
88-
'PermissionMixin',
89-
'UrlDict',
90-
'UrlForMixin',
91-
'NoIdMixin',
84+
'BaseIdNameMixin',
9285
'BaseMixin',
9386
'BaseNameMixin',
94-
'BaseScopedNameMixin',
95-
'BaseIdNameMixin',
9687
'BaseScopedIdMixin',
9788
'BaseScopedIdNameMixin',
89+
'BaseScopedNameMixin',
9890
'CoordinatesMixin',
99-
'UuidMixin',
100-
'RoleMixin',
91+
'IdMixin',
92+
'IdentityOptions',
93+
'NoIdMixin',
94+
'PermissionMixin',
95+
'PkeyType',
10196
'RegistryMixin',
97+
'RoleMixin',
98+
'TimestampMixin',
99+
'UrlDict',
100+
'UrlForMixin',
101+
'UuidMixin',
102102
]
103103

104104
PkeyType = TypeVar('PkeyType', int, UUID, default=int)
@@ -703,7 +703,9 @@ class BaseNameMixin(BaseMixin[PkeyType, ActorType]):
703703
# Drop CHECK constraint first in case it was already present
704704
op.drop_constraint(tablename + '_name_check', tablename)
705705
# Create CHECK constraint
706-
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
706+
op.create_check_constraint(
707+
tablename + '_name_check', tablename, "name <> ''"
708+
)
707709
"""
708710

709711
#: Prevent use of these reserved names
@@ -834,7 +836,9 @@ class BaseScopedNameMixin(BaseMixin[PkeyType, ActorType]):
834836
835837
class Event(BaseScopedNameMixin, Model):
836838
__tablename__ = 'event'
837-
organizer_id: Mapped[int] = sa_orm.mapped_column(sa.ForeignKey('organizer.id'))
839+
organizer_id: Mapped[int] = sa_orm.mapped_column(
840+
sa.ForeignKey('organizer.id')
841+
)
838842
organizer: Mapped[Organizer] = relationship(Organizer)
839843
parent = sa_orm.synonym('organizer')
840844
__table_args__ = (sa.UniqueConstraint('organizer_id', 'name'),)
@@ -851,7 +855,9 @@ class Event(BaseScopedNameMixin, Model):
851855
# Drop CHECK constraint first in case it was already present
852856
op.drop_constraint(tablename + '_name_check', tablename)
853857
# Create CHECK constraint
854-
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
858+
op.create_check_constraint(
859+
tablename + '_name_check', tablename, "name <> ''"
860+
)
855861
"""
856862

857863
#: Prevent use of these reserved names
@@ -1022,7 +1028,9 @@ class BaseIdNameMixin(BaseMixin[PkeyType, ActorType]):
10221028
# Drop CHECK constraint first in case it was already present
10231029
op.drop_constraint(tablename + '_name_check', tablename)
10241030
# Create CHECK constraint
1025-
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
1031+
op.create_check_constraint(
1032+
tablename + '_name_check', tablename, "name <> ''"
1033+
)
10261034
"""
10271035

10281036
#: Allow blank names after all?
@@ -1208,7 +1216,9 @@ class BaseScopedIdNameMixin(BaseScopedIdMixin[PkeyType, ActorType]):
12081216
12091217
class Event(BaseScopedIdNameMixin, Model):
12101218
__tablename__ = 'event'
1211-
organizer_id: Mapped[int] = sa_orm.mapped_column(sa.ForeignKey('organizer.id'))
1219+
organizer_id: Mapped[int] = sa_orm.mapped_column(
1220+
sa.ForeignKey('organizer.id')
1221+
)
12121222
organizer: Mapped[Organizer] = relationship(Organizer)
12131223
parent = sa_orm.synonym('organizer')
12141224
__table_args__ = (sa.UniqueConstraint('organizer_id', 'url_id'),)
@@ -1225,7 +1235,9 @@ class Event(BaseScopedIdNameMixin, Model):
12251235
# Drop CHECK constraint first in case it was already present
12261236
op.drop_constraint(tablename + '_name_check', tablename)
12271237
# Create CHECK constraint
1228-
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
1238+
op.create_check_constraint(
1239+
tablename + '_name_check', tablename, "name <> ''"
1240+
)
12291241
"""
12301242

12311243
#: Allow blank names after all?

‎src/coaster/sqlalchemy/model.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ class Other(Model): ...
9090
from flask_sqlalchemy import SQLAlchemy as FlaskSQLAlchemy
9191

9292
__all__ = [
93+
'DeclarativeBase', # From SQLAlchemy, re-exported for convenience
94+
'ModelBase',
9395
'bigint',
94-
'smallint',
9596
'int_pkey',
96-
'uuid4_pkey',
97+
'jsonb',
98+
'smallint',
9799
'timestamp',
98100
'timestamp_now',
99-
'jsonb',
100-
'ModelBase',
101-
'DeclarativeBase', # From SQLAlchemy, re-exported for convenience
101+
'uuid4_pkey',
102102
]
103103

104104
# --- SQLAlchemy type aliases ----------------------------------------------------------

0 commit comments

Comments
 (0)