Fix the ruff lints; remove dependency
- ID
f27bca6- date
2025-12-06 15:41:22+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
e1bc6bf- message
Fix the ruff lints; remove dependency- changed files
7 files, 16 additions, 12 deletions
Changed files
CHANGELOG.md (1684) → CHANGELOG.md (1767)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7fb43c..69d457d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v15 - 2025-12-06
+
+Fix a bunch of lints from ruff; remove an unused dependency.
+
## v14 - 2025-12-06
Improve the error message on failed assertions in `StaticSiteTestSuite`.
pyproject.toml (1358) → pyproject.toml (1336)
diff --git a/pyproject.toml b/pyproject.toml
index a7b7379..0b2df40 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,7 +25,7 @@ license = "MIT"
[project.optional-dependencies]
media = ["Pillow"]
-static_site_tests = ["javascript-data-files[typed]", "pytest", "rapidfuzz"]
+static_site_tests = ["pytest", "rapidfuzz"]
urls = ["httpx", "hyperlink"]
[project.urls]
@@ -58,5 +58,5 @@ mypy_path = "src"
strict = true
[tool.ruff.lint]
-select = ["D"]
+select = ["D", "E", "F"]
ignore = ["D200", "D203", "D204", "D205", "D212", "D401"]
src/chives/__init__.py (391) → src/chives/__init__.py (391)
diff --git a/src/chives/__init__.py b/src/chives/__init__.py
index d6279fa..90d3ad0 100644
--- a/src/chives/__init__.py
+++ b/src/chives/__init__.py
@@ -11,4 +11,4 @@ I share across multiple sites.
"""
-__version__ = "14"
+__version__ = "15"
src/chives/media.py (10428) → src/chives/media.py (10418)
diff --git a/src/chives/media.py b/src/chives/media.py
index 910b6dc..7dcff63 100644
--- a/src/chives/media.py
+++ b/src/chives/media.py
@@ -186,7 +186,7 @@ def create_image_entity(
"""
Create an ImageEntity for a saved image.
"""
- from PIL import Image, ImageOps
+ from PIL import Image
with Image.open(path) as im:
entity: ImageEntity = {
src/chives/static_site_tests.py (7110) → src/chives/static_site_tests.py (7077)
diff --git a/src/chives/static_site_tests.py b/src/chives/static_site_tests.py
index fe831f4..23ce2e6 100644
--- a/src/chives/static_site_tests.py
+++ b/src/chives/static_site_tests.py
@@ -10,9 +10,8 @@ import itertools
import os
from pathlib import Path
import subprocess
-from typing import cast, TypedDict, TypeVar
+from typing import TypeVar
-from javascript_data_files import read_typed_js
import pytest
from rapidfuzz import fuzz
@@ -133,7 +132,8 @@ class StaticSiteTestSuite[M](ABC):
paths_saved_locally = self.list_paths_saved_locally(site_root)
assert paths_in_metadata - paths_saved_locally == set(), (
- f"Paths in metadata not saved locally: {paths_in_metadata - paths_saved_locally}"
+ f"Paths in metadata not saved locally: "
+ f"{paths_in_metadata - paths_saved_locally}"
)
def test_every_local_file_is_in_metadata(
@@ -146,7 +146,8 @@ class StaticSiteTestSuite[M](ABC):
paths_saved_locally = self.list_paths_saved_locally(site_root)
assert paths_saved_locally - paths_in_metadata == set(), (
- f"Paths saved locally not in metadata: {paths_saved_locally - paths_in_metadata}"
+ f"Paths saved locally not in metadata: "
+ f"{paths_saved_locally - paths_in_metadata}"
)
def test_every_path_is_url_safe(self, site_root: Path) -> None:
src/chives/urls.py (3523) → src/chives/urls.py (3494)
diff --git a/src/chives/urls.py b/src/chives/urls.py
index 04bba03..2ba952d 100644
--- a/src/chives/urls.py
+++ b/src/chives/urls.py
@@ -2,7 +2,6 @@
from pathlib import Path
import re
-from typing import TypedDict
__all__ = [
tests/test_dates.py (2107) → tests/test_dates.py (2110)
diff --git a/tests/test_dates.py b/tests/test_dates.py
index 107cff2..fe91ffd 100644
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -12,9 +12,9 @@ def test_find_all_dates() -> None:
json_value = json.loads("""{
"doc1": {"id": "1", "date_created": "2025-10-14T05:34:07+0000"},
"shapes": [
- {"color": "blue", "date_saved": "2015-03-01 23:34:39 +00:00"},
- {"color": "yellow", "date_saved": "2013-9-21 13:43:00Z", "is_square": true},
- {"color": "green", "date_saved": null}
+ {"color": "blue", "date_saved": "2015-03-01 23:34:39 +00:00"},
+ {"color": "yellow", "date_saved": "2013-9-21 13:43:00Z", "is_square": true},
+ {"color": "green", "date_saved": null}
],
"date_verified": "2024-08-30"
}""")