Skip to content

Commit 22ed2fd

Browse files
ci: pre-commit autoupdate (#6759)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
1 parent 68f2a64 commit 22ed2fd

File tree

7 files changed

+27
-16
lines changed

7 files changed

+27
-16
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.14.11
4+
rev: v0.15.2
55
hooks:
66
# Run the linter.
77
- id: ruff
@@ -44,7 +44,7 @@ repos:
4444
stages: [pre-push]
4545

4646
- repo: https://github.com/python-poetry/poetry
47-
rev: 2.2.1
47+
rev: 2.3.2
4848
hooks:
4949
- id: poetry-check
5050
args: ["-C", "api"]

api/features/versioning/serializers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,10 @@ def _update_feature_state(
279279
)
280280
updated_mvfsv_dict = next(
281281
filter(
282-
lambda d: d["multivariate_feature_option"]
283-
== existing_mvfsv.multivariate_feature_option_id,
282+
lambda d: (
283+
d["multivariate_feature_option"]
284+
== existing_mvfsv.multivariate_feature_option_id
285+
),
284286
updated_mvfsv_dicts,
285287
),
286288
None,

api/metrics/metrics_service.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def _get_segment_metrics(
6767
Returns a callable that counts the number of segment overrides for the environment.
6868
"""
6969
return {
70-
EnvMetricsName.SEGMENT_OVERRIDES: lambda: self.environment.get_segment_metrics_queryset().count(),
70+
EnvMetricsName.SEGMENT_OVERRIDES: lambda: (
71+
self.environment.get_segment_metrics_queryset().count()
72+
),
7173
}
7274

7375
def _get_identity_metrics(self) -> dict[EnvMetricsName, Callable[[], int]]:
@@ -129,8 +131,12 @@ def _get_workflow_metrics(
129131
Returns callables that counts the number of open change requests and scheduled changes for the environment.
130132
"""
131133
return {
132-
EnvMetricsName.OPEN_CHANGE_REQUESTS: lambda: self.environment.get_change_requests_metrics_queryset().count(),
133-
EnvMetricsName.TOTAL_SCHEDULED_CHANGES: lambda: self.environment.get_scheduled_metrics_queryset().count(),
134+
EnvMetricsName.OPEN_CHANGE_REQUESTS: lambda: (
135+
self.environment.get_change_requests_metrics_queryset().count()
136+
),
137+
EnvMetricsName.TOTAL_SCHEDULED_CHANGES: lambda: (
138+
self.environment.get_scheduled_metrics_queryset().count()
139+
),
134140
}
135141

136142
def _build_payload(

api/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name = "flagsmith-api"
88
version = "2.68.0"
99
description = "The API component for the Flagsmith application."
1010
authors = [{ name = "Flagsmith", email = "support@flagsmith.com" }]
11-
readme = "readme.md"
11+
readme = "README.md"
1212
requires-python = ">=3.11, <3.14"
1313
dynamic = ["dependencies"]
1414

api/tests/integration/edge_api/identities/test_edge_identity_viewset.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,10 @@ def test_edge_identities_update_trait( # type: ignore[no-untyped-def]
617617
assert name == "put_item"
618618
assert list(
619619
filter(
620-
lambda trait: trait["trait_key"] == trait_key
621-
and trait["trait_value"] == updated_trait_value,
620+
lambda trait: (
621+
trait["trait_key"] == trait_key
622+
and trait["trait_value"] == updated_trait_value
623+
),
622624
args[0]["identity_traits"],
623625
)
624626
)

api/tests/unit/organisations/test_unit_organisations_permissions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def test_user_organisation_permissions_has_permission_permits_users_with_manage_
6161
mock_request = mocker.MagicMock(user=mock_user)
6262
mock_view = mocker.MagicMock(kwargs={"organisation_pk": organisation.id})
6363

64-
mock_user.has_organisation_permission.side_effect = (
65-
lambda o, perm: o == organisation and perm == MANAGE_USER_GROUPS
64+
mock_user.has_organisation_permission.side_effect = lambda o, perm: (
65+
o == organisation and perm == MANAGE_USER_GROUPS
6666
)
6767

6868
# When
@@ -82,8 +82,8 @@ def test_user_organisation_permissions_has_object_permission_permits_users_with_
8282
mock_request = mocker.MagicMock(user=mock_user)
8383
mock_view = mocker.MagicMock(kwargs={"organisation_pk": organisation.id})
8484

85-
mock_user.has_organisation_permission.side_effect = (
86-
lambda o, perm: o == organisation and perm == MANAGE_USER_GROUPS
85+
mock_user.has_organisation_permission.side_effect = lambda o, perm: (
86+
o == organisation and perm == MANAGE_USER_GROUPS
8787
)
8888

8989
# When

api/tests/unit/webhooks/test_unit_webhooks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,9 @@ def test_send_test_request_to_webhook_returns_correct_response(
446446
),
447447
(
448448
"",
449-
lambda headers, expected_signature: FLAGSMITH_SIGNATURE_HEADER
450-
not in headers,
449+
lambda headers, expected_signature: (
450+
FLAGSMITH_SIGNATURE_HEADER not in headers
451+
),
451452
),
452453
],
453454
)

0 commit comments

Comments
 (0)