Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #487

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ ci:
skip: ['no-commit-to-branch']
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: ['--keep-runtime-typing', '--py39-plus']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
rev: v0.9.2
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
# warn-unused-ignores is unsafe with pre-commit, see
Expand Down Expand Up @@ -46,7 +46,7 @@ repos:
- id: python-check-blanket-type-ignore
- id: python-no-log-warn
- repo: https://github.com/PyCQA/pylint
rev: v3.3.1
rev: v3.3.3
hooks:
- id: pylint
args: [
Expand All @@ -60,15 +60,15 @@ repos:
- sqlalchemy
- tomli
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
rev: 1.8.2
hooks:
- id: bandit
language_version: python3
args: ['-c', 'pyproject.toml']
additional_dependencies:
- bandit[toml]
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.3
rev: v3.4.2
hooks:
- id: prettier
- repo: https://github.com/shellcheck-py/shellcheck-py
Expand Down
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
48 changes: 30 additions & 18 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 Expand Up @@ -703,7 +703,9 @@ class BaseNameMixin(BaseMixin[PkeyType, ActorType]):
# Drop CHECK constraint first in case it was already present
op.drop_constraint(tablename + '_name_check', tablename)
# Create CHECK constraint
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
op.create_check_constraint(
tablename + '_name_check', tablename, "name <> ''"
)
"""

#: Prevent use of these reserved names
Expand Down Expand Up @@ -834,7 +836,9 @@ class BaseScopedNameMixin(BaseMixin[PkeyType, ActorType]):

class Event(BaseScopedNameMixin, Model):
__tablename__ = 'event'
organizer_id: Mapped[int] = sa_orm.mapped_column(sa.ForeignKey('organizer.id'))
organizer_id: Mapped[int] = sa_orm.mapped_column(
sa.ForeignKey('organizer.id')
)
organizer: Mapped[Organizer] = relationship(Organizer)
parent = sa_orm.synonym('organizer')
__table_args__ = (sa.UniqueConstraint('organizer_id', 'name'),)
Expand All @@ -851,7 +855,9 @@ class Event(BaseScopedNameMixin, Model):
# Drop CHECK constraint first in case it was already present
op.drop_constraint(tablename + '_name_check', tablename)
# Create CHECK constraint
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
op.create_check_constraint(
tablename + '_name_check', tablename, "name <> ''"
)
"""

#: Prevent use of these reserved names
Expand Down Expand Up @@ -1022,7 +1028,9 @@ class BaseIdNameMixin(BaseMixin[PkeyType, ActorType]):
# Drop CHECK constraint first in case it was already present
op.drop_constraint(tablename + '_name_check', tablename)
# Create CHECK constraint
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
op.create_check_constraint(
tablename + '_name_check', tablename, "name <> ''"
)
"""

#: Allow blank names after all?
Expand Down Expand Up @@ -1208,7 +1216,9 @@ class BaseScopedIdNameMixin(BaseScopedIdMixin[PkeyType, ActorType]):

class Event(BaseScopedIdNameMixin, Model):
__tablename__ = 'event'
organizer_id: Mapped[int] = sa_orm.mapped_column(sa.ForeignKey('organizer.id'))
organizer_id: Mapped[int] = sa_orm.mapped_column(
sa.ForeignKey('organizer.id')
)
organizer: Mapped[Organizer] = relationship(Organizer)
parent = sa_orm.synonym('organizer')
__table_args__ = (sa.UniqueConstraint('organizer_id', 'url_id'),)
Expand All @@ -1225,7 +1235,9 @@ class Event(BaseScopedIdNameMixin, Model):
# Drop CHECK constraint first in case it was already present
op.drop_constraint(tablename + '_name_check', tablename)
# Create CHECK constraint
op.create_check_constraint(tablename + '_name_check', tablename, "name <> ''")
op.create_check_constraint(
tablename + '_name_check', tablename, "name <> ''"
)
"""

#: Allow blank names after all?
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
Loading
Loading