From b9059530e1883f1018191bc211d396299f2206a3 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 2 Nov 2025 14:10:26 +0100 Subject: [PATCH 1/5] chore: Apply upstream template changes via Cruft --- .cruft.json | 4 ++-- .github/workflows/main.yml | 14 +++++++------- .pre-commit-config.yaml | 6 +++--- pyproject.toml | 6 +++--- tasks.py | 5 +++++ 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.cruft.json b/.cruft.json index 63b95cc..2720850 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/getpelican/cookiecutter-pelican-plugin", - "commit": "1c97f677813433969687d75cc1d85b4f51448bda", + "commit": "4aa8104df7e76fa2dcbf583dcec8052e81d915ef", "checkout": null, "context": { "cookiecutter": { @@ -21,7 +21,7 @@ "python_version": ">=3.8.1,<4.0", "pelican_version": ">=4.5", "_template": "https://github.com/getpelican/cookiecutter-pelican-plugin", - "_commit": "1c97f677813433969687d75cc1d85b4f51448bda" + "_commit": "4aa8104df7e76fa2dcbf583dcec8052e81d915ef" } }, "directory": null diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bedc305..ab41083 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: false @@ -42,14 +42,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: persist-credentials: false - name: Set up Python & PDM uses: pdm-project/setup-pdm@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies run: pdm install @@ -69,12 +69,12 @@ jobs: id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.11" - name: Check release id: check_release diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e443687..06b0305 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ ci: # See https://pre-commit.com/hooks.html for info on hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-ast @@ -21,8 +21,8 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.0 + rev: v0.14.2 hooks: - - id: ruff + - id: ruff-check - id: ruff-format args: ["--check"] diff --git a/pyproject.toml b/pyproject.toml index 8866bb9..e9d93fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,11 +15,11 @@ classifiers = [ "License :: OSI Approved :: GNU Affero General Public License v3", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Internet :: WWW/HTTP", "Topic :: Multimedia :: Graphics", "Topic :: Software Development :: Libraries :: Python Modules", @@ -44,7 +44,7 @@ markdown = ["markdown>=3.4"] [dependency-groups] lint = [ "invoke>=2.2", - "ruff>=0.11.0,<1.0.0", + "ruff>=0.14.2,<1.0.0", ] test = [ "invoke>=2.2", @@ -62,7 +62,7 @@ source-includes = [ "CONTRIBUTING.md", ] includes = ["pelican/"] -excludes = ["**/.DS_Store", "**/test_data/**", "tasks.py"] +excludes = ["**/.DS_Store"] [tool.autopub] project-name = "Image Process" diff --git a/tasks.py b/tasks.py index b56e36b..e91434b 100644 --- a/tasks.py +++ b/tasks.py @@ -7,6 +7,11 @@ from invoke import task logger = logging.getLogger(__name__) +level = logging.INFO +logger.setLevel(level) +console_handler = logging.StreamHandler() +console_handler.setLevel(level) +logger.addHandler(console_handler) PKG_NAME = "image_process" PKG_PATH = Path(f"pelican/plugins/{PKG_NAME}") From 501ec58a669a2b6d72fd5ed71a0c6064f207d0c4 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 2 Nov 2025 14:20:28 +0100 Subject: [PATCH 2/5] chore: Increase `requires_python` to 3.10+ --- .cruft.json | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cruft.json b/.cruft.json index 2720850..2044e84 100644 --- a/.cruft.json +++ b/.cruft.json @@ -18,7 +18,7 @@ "repo_url": "https://github.com/pelican-plugins/image-process", "dev_status": "5 - Production/Stable", "tests_exist": true, - "python_version": ">=3.8.1,<4.0", + "python_version": ">=3.10", "pelican_version": ">=4.5", "_template": "https://github.com/getpelican/cookiecutter-pelican-plugin", "_commit": "4aa8104df7e76fa2dcbf583dcec8052e81d915ef" diff --git a/pyproject.toml b/pyproject.toml index e9d93fb..07a8a04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Topic :: Multimedia :: Graphics", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = "~=3.9" +requires-python = ">=3.10" dependencies = [ "pelican>=4.5", "beautifulsoup4>=4.9", From 355aa000486ef3df275f67049ba2574d3217a398 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 2 Nov 2025 14:18:25 +0100 Subject: [PATCH 3/5] style: Adjust code to comply with latest Ruff --- pelican/plugins/image_process/image_process.py | 2 +- pelican/plugins/image_process/test_image_process.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/plugins/image_process/image_process.py b/pelican/plugins/image_process/image_process.py index 82b7c93..7206450 100644 --- a/pelican/plugins/image_process/image_process.py +++ b/pelican/plugins/image_process/image_process.py @@ -374,7 +374,7 @@ def compute_paths(img, settings, derivative): process_dir = settings["IMAGE_PROCESS_DIR"] img_src = urlparse(img["src"]) img_src_path = url2pathname(img_src.path.lstrip("/")) - img_src_dirname, filename = os.path.split(img_src_path) + _img_src_dirname, filename = os.path.split(img_src_path) derivative_path = os.path.join(process_dir, derivative) # urljoin truncates leading ../ elements base_url = posixpath.join( diff --git a/pelican/plugins/image_process/test_image_process.py b/pelican/plugins/image_process/test_image_process.py index d238363..f6d1acb 100644 --- a/pelican/plugins/image_process/test_image_process.py +++ b/pelican/plugins/image_process/test_image_process.py @@ -123,14 +123,14 @@ def test_all_transforms(tmp_path, transform_id, transform_params, image_path): # depending on the platform on which they are run. if transformed.mode == "RGB": for _, (transformed_pixel, expected_pixel) in enumerate( - zip(transformed.getdata(), expected.getdata()) + zip(transformed.getdata(), expected.getdata(), strict=False) ): assert abs(transformed_pixel[0] - expected_pixel[0]) <= 1 assert abs(transformed_pixel[1] - expected_pixel[1]) <= 1 assert abs(transformed_pixel[2] - expected_pixel[2]) <= 1 elif transformed.mode == "RGBA": for _, (transformed_pixel, expected_pixel) in enumerate( - zip(transformed.getdata(), expected.getdata()) + zip(transformed.getdata(), expected.getdata(), strict=False) ): assert abs(transformed_pixel[0] - expected_pixel[0]) <= 1 assert abs(transformed_pixel[1] - expected_pixel[1]) <= 1 @@ -138,7 +138,7 @@ def test_all_transforms(tmp_path, transform_id, transform_params, image_path): assert abs(transformed_pixel[3] - expected_pixel[3]) <= 1 elif transformed.mode == "L": for _, (transformed_pixel, expected_pixel) in enumerate( - zip(transformed.getdata(), expected.getdata()) + zip(transformed.getdata(), expected.getdata(), strict=False) ): assert abs(transformed_pixel - expected_pixel) <= 1 else: From 62e26443f2a0797ae82a6a0bdc0cff17c7d7deef Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 2 Nov 2025 14:38:21 +0100 Subject: [PATCH 4/5] ci: Use ExifTool GitHub Action - - --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab41083..640b0f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,8 +21,8 @@ jobs: with: persist-credentials: false - - name: Install Exiftool - run: sudo apt install libimage-exiftool-perl + - name: Use ExifTool + uses: woss/exiftool-action@v13.40 - name: Set up Python ${{ matrix.python-version }} & PDM uses: pdm-project/setup-pdm@v4 From eb657d0f8750a4510f580fcb6f4a180c3b413689 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 2 Nov 2025 14:32:32 +0100 Subject: [PATCH 5/5] ci: Add MacOS to test matrix --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 640b0f7..0b16cf0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,10 +10,11 @@ permissions: jobs: test: - name: Test - Python ${{ matrix.python-version }} - runs-on: ubuntu-latest + name: Test - Python ${{ matrix.python-version }} - ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest strategy: matrix: + os: [ubuntu, macos] python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: