Skip to content

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

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

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
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ repos:
hooks:
- id: check-pre-commit-ci-config
- repo: https://github.com/mxr/sync-pre-commit-deps
rev: v0.0.2
rev: v0.0.3
hooks:
- id: sync-pre-commit-deps
- repo: https://github.com/peterdemin/pip-compile-multi
rev: v2.7.1
rev: v3.0.0b2
hooks:
- id: pip-compile-multi-verify
files: ^requirements/.*\.(in|txt)$
- repo: https://github.com/pypa/pip-audit
rev: v2.7.3
rev: v2.9.0
hooks:
- id: pip-audit
args: [
Expand All @@ -55,13 +55,13 @@ repos:
- id: pyupgrade
args: ['--keep-runtime-typing', '--py311-plus']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
rev: v0.11.10
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
- id: ruff-format
- repo: https://github.com/PyCQA/pylint
rev: v3.3.3
rev: v3.3.7
hooks:
- id: pylint
args: [
Expand All @@ -73,7 +73,7 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/fredrikaverpil/creosote
rev: v4.0.0
rev: v4.0.3
hooks:
- id: creosote
- repo: https://github.com/shellcheck-py/shellcheck-py
Expand Down Expand Up @@ -124,7 +124,7 @@ repos:
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.4.2
rev: v3.5.3
hooks:
- id: prettier
- repo: https://github.com/ducminh-phan/reformat-gherkin
Expand Down
7 changes: 4 additions & 3 deletions funnel/assets/sass/mui/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ $mui-body-bg-color: $mui-bg-color-accent !default;
$mui-btn-danger-bg-color: $mui-text-danger;

$mui-base-font-color: $mui-text-dark !default;
$mui-base-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Noto Sans Math',
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
$mui-base-font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Helvetica Neue', Arial, sans-serif, 'Noto Sans Math', 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
$mui-base-font-size: 14px !default;
$mui-base-font-size-desktop: 16px !default;
$mui-base-font-weight: 400 !default;
Expand Down
4 changes: 2 additions & 2 deletions funnel/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,12 @@ def coerce(cls, _key: str, value: Any) -> Self:

@classmethod
def create(
cls: type[_MC],
cls,
name: str,
deferred: bool = False,
deferred_group: str | None = None,
**kwargs: Any,
) -> tuple[sa_orm.Composite[_MC], Mapped[str], Mapped[str]]:
) -> tuple[sa_orm.Composite[Self], Mapped[str], Mapped[str]]:
"""Create a composite column and backing individual columns."""
col_text = sa_orm.mapped_column(
name + '_text',
Expand Down
8 changes: 2 additions & 6 deletions funnel/models/membership_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,7 @@ def pickername(self: FrozenAttributionSubclassProtocol) -> str:
return self._title if self._title else self.member.pickername

@with_roles(call={'owner', 'member'})
def freeze_member_attribution(
self: FrozenAttributionType, actor: Account
) -> FrozenAttributionType:
def freeze_member_attribution(self, actor: Account) -> Self:
"""Freeze member attribution and return a replacement record."""
if self._title is None:
membership = self.replace(actor=actor, title=self.member.title)
Expand Down Expand Up @@ -687,9 +685,7 @@ def __setattr__(self, attr: str, value: Any) -> None:
raise AttributeError(
f"{attr} cannot be set",
name=attr,
obj=SimpleNamespace(
**{_: None for _ in self.membership.__data_columns__}
),
obj=SimpleNamespace(**dict.fromkeys(self.membership.__data_columns__)),
)
self._new[attr] = value

Expand Down
10 changes: 5 additions & 5 deletions funnel/models/reorder_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Protocol, TypeVar
from typing import Any, Protocol, Self, TypeVar

from .base import Mapped, db, declarative_mixin, sa, sa_orm
from .typing import ModelIdProtocol
Expand All @@ -23,7 +23,7 @@ class ReorderSubclassProtocol(ModelIdProtocol, Protocol):
@property
def parent_scoped_reorder_query_filter(self) -> sa.ColumnElement[bool]: ...

def reorder_item(self: Reorderable, other: Reorderable, before: bool) -> None: ...
def reorder_item(self, other: Self, before: bool) -> None: ...


Reorderable = TypeVar('Reorderable', bound='ReorderSubclassProtocol')
Expand All @@ -47,7 +47,7 @@ def parent_scoped_reorder_query_filter(
cls = self.__class__
return cls.parent_id == self.parent_id

def reorder_item(self: Reorderable, other: Reorderable, before: bool) -> None:
def reorder_item(self, other: Self, before: bool) -> None:
"""Reorder self before or after other item."""
cls = self.__class__

Expand Down Expand Up @@ -121,10 +121,10 @@ def reorder_item(self: Reorderable, other: Reorderable, before: bool) -> None:
self.seq = new_seq_number
db.session.flush()

def reorder_before(self: Reorderable, other: Reorderable) -> None:
def reorder_before(self, other: Self) -> None:
"""Reorder to be before another item's sequence number."""
self.reorder_item(other, True)

def reorder_after(self: Reorderable, other: Reorderable) -> None:
def reorder_after(self, other: Self) -> None:
"""Reorder to be after another item's sequence number."""
self.reorder_item(other, False)
7 changes: 4 additions & 3 deletions funnel/static/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1690,9 +1690,10 @@ html {
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Noto Sans Math',
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Helvetica Neue', Arial, sans-serif, 'Noto Sans Math', 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
font-size: 14px;
font-weight: 400;
line-height: 1.5;
Expand Down
8 changes: 4 additions & 4 deletions funnel/views/otp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from dataclasses import dataclass
from datetime import timedelta
from typing import Any, Generic, TypeVar
from typing import Any, Generic, Self, TypeVar

import phonenumbers
from flask import current_app, flash, render_template, request, session, url_for
Expand Down Expand Up @@ -134,13 +134,13 @@ def __init_subclass__(cls, *args: Any, **kwargs: Any) -> None:

@classmethod
def make(
cls: type[OtpSessionType],
cls,
reason: str,
user: OptionalAccountType,
anchor: Anchor | None,
phone: str | None = None,
email: str | None = None,
) -> OtpSessionType:
) -> Self:
"""
Create an OTP for login and save it to cache and browser cookie session.

Expand Down Expand Up @@ -172,7 +172,7 @@ def make(
)

@classmethod
def retrieve(cls: type[OtpSessionType], reason: str) -> OtpSessionType:
def retrieve(cls, reason: str) -> Self:
"""Retrieve an OTP from cache using the token in browser cookie session."""
otp_token = session.get('otp')
if not otp_token:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def backup_and_apply_config(
) -> None:
if key in saved_config:
pytest.fail(f"Duplicate mock for {app_name}.config[{key!r}]")
if key in app_fixture.config: # noqa: SIM401
if key in app_fixture.config:
saved_config[key] = app_fixture.config[key]
else:
saved_config[key] = ... # Sentinel value
Expand Down
7 changes: 1 addition & 6 deletions tests/unit/utils/md/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@ def load(cls) -> None:
),
)
for md_configname, config in {
**{
p: None
for p in config.get( # type: ignore[union-attr]
'profiles', []
)
},
**dict.fromkeys(config.get('profiles', [])),
**config.get('custom_profiles', {}), # type: ignore[union-attr]
}.items()
}
Expand Down
Loading