Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/getpelican/cookiecutter-pelican-plugin",
"commit": "1c97f677813433969687d75cc1d85b4f51448bda",
"commit": "4aa8104df7e76fa2dcbf583dcec8052e81d915ef",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -18,10 +18,10 @@
"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": "1c97f677813433969687d75cc1d85b4f51448bda"
"_commit": "4aa8104df7e76fa2dcbf583dcec8052e81d915ef"
}
},
"directory": null
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ 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:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu, macos]
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

- 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
Expand All @@ -42,14 +43,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
Expand All @@ -69,12 +70,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
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion pelican/plugins/image_process/image_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions pelican/plugins/image_process/test_image_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,22 @@ 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
assert abs(transformed_pixel[2] - expected_pixel[2]) <= 1
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:
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ 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",
]
requires-python = "~=3.9"
requires-python = ">=3.10"
dependencies = [
"pelican>=4.5",
"beautifulsoup4>=4.9",
Expand All @@ -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",
Expand All @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down