diff --git a/.github/report_nightly_build_failure.py b/.github/report_nightly_build_failure.py
index 86392b8..8d2cb9d 100644
--- a/.github/report_nightly_build_failure.py
+++ b/.github/report_nightly_build_failure.py
@@ -3,6 +3,7 @@
This reports an error to the #nightly-build-failures Slack channel.
"""
+
import os
import requests
diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml
index 0e6a867..a6901ab 100644
--- a/.github/workflows/ruff.yml
+++ b/.github/workflows/ruff.yml
@@ -15,8 +15,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- - run: python -Im pip install --user ruff
+ - run: python -Im pip install --user ruff==0.5.4
- name: Run ruff
working-directory: ./src
- run: ruff --output-format=github wagtailmedia
+ run: ruff check --output-format=github wagtailmedia
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b019d1d..2ce2e10 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -18,7 +18,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: 'v0.2.0'
+ rev: 'v0.5.4'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
diff --git a/src/wagtailmedia/locale/ru/LC_MESSAGES/django.po b/src/wagtailmedia/locale/ru/LC_MESSAGES/django.po
index 5c26c84..b19d599 100644
--- a/src/wagtailmedia/locale/ru/LC_MESSAGES/django.po
+++ b/src/wagtailmedia/locale/ru/LC_MESSAGES/django.po
@@ -182,7 +182,7 @@ msgstr[0] ""
"%(total)s Медиафайл "
"создан на %(site_name)s"
msgstr[1] ""
-"%(total)s Медиафайлы "
+"%(total)s Медиафайлы "
"созданы на %(site_name)s"
#: src/wagtailmedia/templates/wagtailmedia/media/_file_field.html:4
diff --git a/src/wagtailmedia/settings.py b/src/wagtailmedia/settings.py
index edfc2c0..e69bfff 100644
--- a/src/wagtailmedia/settings.py
+++ b/src/wagtailmedia/settings.py
@@ -8,6 +8,7 @@
This module provides the `wagtailmedia_settings` object, that is used to access
the settings. It checks for user settings first, with fallback to defaults.
"""
+
import warnings
from django.conf import settings
diff --git a/tests/settings.py b/tests/settings.py
index 7078bd2..5b46a23 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -94,7 +94,7 @@
CACHES = {
"default": {
"BACKEND": "redis_cache.RedisCache",
- "LOCATION": "localhost:%s" % REDIS_PORT,
+ "LOCATION": f"localhost:{REDIS_PORT}",
},
}
else:
diff --git a/tests/test_api.py b/tests/test_api.py
index 9078ad5..3f19e32 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -73,7 +73,7 @@ def test_basic(self):
media = Media.objects.get(pk=item["id"])
# Check download_url
self.assertEqual(
- item["meta"]["download_url"], "http://localhost/media/%s" % media.file
+ item["meta"]["download_url"], f"http://localhost/media/{media.file}"
)
self.assertEqual(item["media_type"], media.type)
diff --git a/tests/urls.py b/tests/urls.py
index 5bed048..bc77bd9 100644
--- a/tests/urls.py
+++ b/tests/urls.py
@@ -18,7 +18,7 @@
path("", include(wagtail_urls)),
] + [
path(
- "%s" % prefix.lstrip("/"),
+ f"{prefix.lstrip('/')}",
serve,
kwargs={"document_root": document_root},
)