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
8 changes: 6 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ charset = utf-8
[*.py]
max_line_length = 99

# Smaller indent for YAML
[*.{yaml,yml}]
# Smaller indent for TOML/YAML
[*.{toml,yaml,yml}]
indent_size = 2

# Use 2 spaces for the HTML files
[*.html]
indent_size = 2

# Makefiles always use tabs for indentation
Expand Down
32 changes: 17 additions & 15 deletions .github/matrix.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# noqa:INP001
import fileinput
import json
import re
Expand All @@ -9,21 +10,22 @@
def main():
actions_matrix = []

for tox_env in fileinput.input():
tox_env = tox_env.rstrip()

if python_match := PY_VERSIONS_RE.match(tox_env):
version_tuple = python_match.groups()
else:
version_tuple = sys.version_info[0:2]

python_version = "{}.{}".format(*version_tuple)
actions_matrix.append(
{
"python": python_version,
"tox_env": tox_env,
}
)
with fileinput.input() as f:
for tox_env_line in f:
tox_env = tox_env_line.rstrip()

if python_match := PY_VERSIONS_RE.match(tox_env):
version_tuple = python_match.groups()
else:
version_tuple = sys.version_info[0:2]

python_version = "{}.{}".format(*version_tuple)
actions_matrix.append(
{
"python": python_version,
"tox_env": tox_env,
}
)

print(json.dumps(actions_matrix)) # noqa:T201

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.13"
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Run tox
Expand All @@ -37,12 +37,12 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: "pip"
Expand All @@ -52,7 +52,7 @@ jobs:
pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt)
tox -e ${{ matrix.tox_env }}
- name: Upload coverage data
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: coverage-data-${{ matrix.tox_env }}
include-hidden-files: true
Expand All @@ -66,17 +66,17 @@ jobs:
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.13"
python-version: "3.14"
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
with:
pattern: coverage-data-*
merge-multiple: true
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.13"
python-version: "3.14"
- name: Build packages
run: |
pip install -r requirements/testing.txt
make package
- name: Upload packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: python-package-distributions
path: dist/
Expand All @@ -44,7 +44,7 @@ jobs:

steps:
- name: Download packages
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
Expand All @@ -65,28 +65,22 @@ jobs:

steps:
- name: Download packages
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
- name: Sign packages
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create
"$GITHUB_REF_NAME"
--repo '${{ github.repository }}'
--repo "$GITHUB_REPOSITORY"
--title "${GITHUB_REPOSITORY#*/} $GITHUB_REF_NAME"
- name: Upload artifact signatures to GitHub Release
- name: Upload files to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release upload
"$GITHUB_REF_NAME" dist/**
--repo '${{ github.repository }}'
--repo "$GITHUB_REPOSITORY"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2024, Developer Society Limited
Copyright (c) 2024-2026, Developer Society Limited
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
109 changes: 80 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ version = '0.1'
description = 'ExifTool optimizer for Willow'
readme = 'README.md'
maintainers = [{ name = 'The Developer Society', email = 'studio@dev.ngo' }]
requires-python = '>= 3.9'
requires-python = '>= 3.10'
dependencies = [
'Willow>=1.6.0',
'Willow>=1.11.0',
]
license = 'BSD-3-Clause'
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'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',
]

[project.urls]
Homepage = "https://github.com/developersociety/willow-exiftool"

[build-system]
requires = ['setuptools >= 61.0']
requires = ['setuptools >= 77.0.3']
build-backend = 'setuptools.build_meta'

[tool.setuptools]
Expand All @@ -36,30 +36,81 @@ include = ['willow_exiftool*']

[tool.ruff]
line-length = 99
target-version = 'py39'
target-version = 'py310'

[tool.ruff.lint]
select = [
'F', # pyflakes
'E', # pycodestyle
'W', # pycodestyle
'I', # isort
'N', # pep8-naming
'UP', # pyupgrade
'S', # flake8-bandit
'BLE', # flake8-blind-except
'C4', # flake8-comprehensions
'EM', # flake8-errmsg
'T20', # flake8-print
'RET', # flake8-return
'RUF', # ruff
extend-select = [
'ERA', # eradicate
'YTT', # flake8-2020
'ASYNC', # flake8-async
'S', # flake8-bandit
'BLE', # flake8-blind-except
'B', # flake8-bugbear
'A', # flake8-builtins
'COM', # flake8-commas
'C4', # flake8-comprehensions
'DTZ', # flake8-datetimez
'T10', # flake8-debugger
'DJ', # flake8-django
'EM', # flake8-errmsg
'EXE', # flake8-executable
'FA', # flake8-future-annotations
'INT', # flake8-gettext
'ISC', # flake8-implicit-str-concat
'ICN', # flake8-import-conventions
'LOG', # flake8-logging
'G', # flake8-logging-format
'INP', # flake8-no-pep420
'PIE', # flake8-pie
'T20', # flake8-print
'PYI', # flake8-pyi
'Q', # flake8-quotes
'RSE', # flake8-raise
'RET', # flake8-return
'SLOT', # flake8-slots
'SIM', # flake8-simplify
'TID', # flake8-tidy-imports
'TD', # flake8-todos
'TCH', # flake8-type-checking
'PTH', # flake8-use-pathlib
'FLY', # flynt
'I', # isort
'NPY', # numpy-specific rules
'PD', # pandas-vet
'N', # pep8-naming
'PERF', # perflint
'E', # pycodestyle
'W', # pycodestyle
'F', # pyflakes
'PGH', # pygrep-hooks
'PLC', # pylint
'PLE', # pylint
'PLW', # pylint
'UP', # pyupgrade
'FURB', # refurb
'RUF', # ruff-specific rules
'TRY', # tryceratops
]
ignore = [
'EM101', # flake8-errmsg: raw-string-in-exception
'COM812', # flake8-commas: missing-trailing-comma
'EM101', # flake8-errmsg: raw-string-in-exception
'ISC001', # flake8-implicit-str-concat: single-line-implicit-string-concatenation
'RUF012', # ruff-specific rules: mutable-class-default
'SIM105', # flake8-simplify: suppressible-exception
'SIM108', # flake8-simplify: if-else-block-instead-of-if-exp
'TD002', # flake8-todos: missing-todo-author
'TRY003', # tryceratops: raise-vanilla-args
]

[tool.ruff.lint.isort]
combine-as-imports = true

[tool.ruff.lint.pep8-naming]
extend-ignore-names = ['assert*']

[tool.mypy]
mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs"

[[tool.mypy.overrides]]
module = 'willow.registry'
ignore_missing_imports = true
6 changes: 3 additions & 3 deletions requirements/local.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r testing.txt

bump-my-version==0.28.1
tox==4.23.2
tox-uv==1.16.1
bump-my-version==1.2.6
tox==4.34.1
tox-uv==1.29.0
Willow<2.0
16 changes: 8 additions & 8 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
build==1.2.2.post1
check-wheel-contents==0.6.1
coverage==7.6.9
mypy==1.13.0
pipdeptree==2.24.0
pytest==8.3.4
ruff==0.8.3
twine==6.0.1
build==1.4.0
check-wheel-contents==0.6.3
coverage==7.13.3
mypy==1.19.1
pipdeptree==2.30.0
pytest==9.0.2
ruff==0.15.0
twine==6.2.0
16 changes: 7 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@
env_list =
check
lint
{py39,py310,py311,py312}-willow1.6
{py39,py310,py311,py312}-willow1.8
{py39,py310,py311,py312,py313}-willow1.9
{py310,py311,py312,py313}-willow1.11
{py310,py311,py312,py313,py314}-willow1.12
coverage
no_package = true

[testenv]
deps =
-rrequirements/testing.txt
willow1.6: Willow[heif]>=1.6,<1.7
willow1.8: Willow[heif]>=1.8,<1.9
willow1.9: Willow[heif]>=1.9,<2.0
willow1.11: Willow[heif]>=1.11,<1.12
willow1.12: Willow[heif]>=1.12,<1.13
allowlist_externals = make
commands = make test
package = editable

[testenv:check]
base_python = python3.13
base_python = python3.14
commands = make check
uv_seed = true

[testenv:lint]
base_python = python3.13
base_python = python3.14
commands = make lint

[testenv:coverage]
base_python = python3.13
base_python = python3.14
commands = make coverage-report
Loading