Browse Source

Merge pull request #499 from saimn/pillow

Remove pin for Pillow 10
pull/503/head
Simon Conseil 2 years ago committed by GitHub
parent
commit
b49f697271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .pre-commit-config.yaml
  2. 2
      pyproject.toml
  3. 4
      src/sigal/gallery.py
  4. 4
      src/sigal/plugins/feeds.py
  5. 4
      tests/test_compress_assets_plugin.py
  6. 5
      tox.ini

4
.pre-commit-config.yaml

@ -12,12 +12,12 @@ repos:
exclude: ".*(galleria|photoswipe|jquery|leaflet).*$"
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.270
rev: v0.0.291
hooks:
- id: ruff
args: [ --fix, --show-fixes, --exit-non-zero-on-fix ]

2
pyproject.toml

@ -29,7 +29,7 @@ dependencies = [
"click",
"Jinja2>=2.7",
"Markdown",
"Pillow>=8.0.0,<10.0.0",
"Pillow>=8.0.0",
"pilkit",
"natsort",
]

4
src/sigal/gallery.py

@ -418,9 +418,7 @@ class Album:
signals.album_initialized.send(self)
def __repr__(self):
return "<{}>(path={!r}, title={!r})".format(
self.__class__.__name__, self.path, self.title
)
return f"<{self.__class__.__name__}>(path={self.path!r}, title={self.title!r})"
def __str__(self):
return f"{self.path} : " + ", ".join(

4
src/sigal/plugins/feeds.py

@ -73,9 +73,7 @@ def generate_feed(gallery, medias, feed_type=None, feed_url="", nb_items=0):
# unique_id='tag:%s,%s:%s' % (urlparse(link).netloc,
# item.date.date(),
# urlparse(link).path.lstrip('/')),
description='<img src="{}/{}/{}" />'.format(
base_url, item.path, item.thumbnail
),
description=f'<img src="{base_url}/{item.path}/{item.thumbnail}" />',
# categories=item.tags if hasattr(item, 'tags') else None,
author_name=getattr(item, "author", ""),
pubdate=item.date or datetime.now(),

4
tests/test_compress_assets_plugin.py

@ -36,9 +36,7 @@ def walk_destination(destination, suffixes, compress_suffix):
for path, dirs, files in os.walk(destination):
for file in files:
original_filename = os.path.join(path, file)
compressed_filename = "{}.{}".format(
os.path.join(path, file), compress_suffix
)
compressed_filename = f"{os.path.join(path, file)}.{compress_suffix}"
path_exists = os.path.exists(compressed_filename)
file_ext = os.path.splitext(file)[1][1:]
if file_ext in suffixes:

5
tox.ini

@ -1,12 +1,12 @@
[tox]
envlist = py{38,39,310,311}-pillow{80,90,-latest},pypy3,check
envlist = py{38,39,310,311}-pillow{80,90,100,-latest},pypy3,check
skip_missing_interpreters = true
[gh-actions]
python =
3.8: py38-pillow80, check
3.9: py39-pillow90
3.10: py310-pillow-latest
3.10: py310-pillow100
3.11: py310-pillow-latest
pypy3: pypy3
@ -16,6 +16,7 @@ wheel_build_env = .pkg
deps =
pillow80: Pillow==8.0.1
pillow90: Pillow==9.0.1
pillow100: Pillow==10.0.1
extras =
all
tests

Loading…
Cancel
Save