Skip to content

Commit 4047632

Browse files
committed
adjust pre-commit and github action workflows
dropped black in fvor of ruff updated versions ran ruff format on the project
1 parent 97f3f6c commit 4047632

File tree

7 files changed

+19
-33
lines changed

7 files changed

+19
-33
lines changed

.github/workflows/black.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/ruff.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v4
8-
- uses: chartboost/ruff-action@v1
8+
- uses: astral-sh/ruff-action@v3
9+
with:
10+
version: "latest"
11+
- run: ruff check
12+
- run: ruff format

.pre-commit-config.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ repos:
33
rev: 1.25.0
44
hooks:
55
- id: django-upgrade
6-
args: [--target-version, "5.1"]
7-
8-
- repo: https://github.com/psf/black
9-
rev: 25.1.0
10-
hooks:
11-
- id: black
6+
args: [--target-version, "5.2"]
127

138
- repo: https://github.com/astral-sh/ruff-pre-commit
149
rev: v0.12.4
1510
hooks:
16-
- id: ruff
11+
- id: ruff-check
12+
- id: ruff-format

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ brotli = [
5858
[dependency-groups]
5959
dev = [
6060
"anyio>=4.9.0",
61-
"black>=25.1.0",
6261
"coverage>=7.8.0",
6362
"django-cmd>=2.6",
6463
"django-coverage-plugin>=3.1.0",
@@ -70,7 +69,7 @@ dev = [
7069
"pytest-django>=4.11.1",
7170
"pytest-mock>=3.14.0",
7271
"pytest-subtests>=0.14.1",
73-
"ruff>=0.11.6",
72+
"ruff>=0.12.5",
7473
]
7574
docs = [
7675
"mkdocs>=1.6.1",
@@ -111,4 +110,4 @@ parallel = true
111110

112111

113112
[tool.ruff.lint.per-file-ignores]
114-
"__init__.py" = ["E402", "F401", "F403"]
113+
"__init__.py" = ["E402", "F401", "F403"]

tests/test_cache_options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ def test_keys(self, key_prefix_cache: ValkeyCache, with_prefix_cache: ValkeyCach
270270
def test_custom_key_function(cache: ValkeyCache, settings: SettingsWrapper):
271271
caches_setting = copy.deepcopy(settings.CACHES)
272272
caches_setting["default"]["KEY_FUNCTION"] = "tests.test_cache_options.make_key"
273-
caches_setting["default"][
274-
"REVERSE_KEY_FUNCTION"
275-
] = "tests.test_cache_options.reverse_key"
273+
caches_setting["default"]["REVERSE_KEY_FUNCTION"] = (
274+
"tests.test_cache_options.reverse_key"
275+
)
276276
settings.CACHES = caches_setting
277277

278278
if isinstance(cache.client, ShardClient):

tests/tests_async/test_cache_options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ async def test_keys(
267267
async def test_custom_key_function(cache: AsyncValkeyCache, settings: SettingsWrapper):
268268
caches_setting = copy.deepcopy(settings.CACHES)
269269
caches_setting["default"]["KEY_FUNCTION"] = "tests.test_cache_options.make_key"
270-
caches_setting["default"][
271-
"REVERSE_KEY_FUNCTION"
272-
] = "tests.test_cache_options.reverse_key"
270+
caches_setting["default"]["REVERSE_KEY_FUNCTION"] = (
271+
"tests.test_cache_options.reverse_key"
272+
)
273273
settings.CACHES = caches_setting
274274

275275
for key in ["foo-aa", "foo-ab", "foo-bb", "foo-bc"]:

tests/tests_cluster/test_cache_options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def test_keys(
2323
def test_custom_key_function(cache: ClusterValkeyCache, settings: SettingsWrapper):
2424
caches_setting = copy.deepcopy(settings.CACHES)
2525
caches_setting["default"]["KEY_FUNCTION"] = "tests.test_cache_options.make_key"
26-
caches_setting["default"][
27-
"REVERSE_KEY_FUNCTION"
28-
] = "tests.test_cache_options.reverse_key"
26+
caches_setting["default"]["REVERSE_KEY_FUNCTION"] = (
27+
"tests.test_cache_options.reverse_key"
28+
)
2929
settings.CACHES = caches_setting
3030

3131
for key in ["{foo}-aa", "{foo}-ab", "{foo}-bb", "{foo}-bc"]:

0 commit comments

Comments
 (0)