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
2 changes: 1 addition & 1 deletion .github/maintainer/mkmaintainer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

from __future__ import annotations

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
jobs:
pre-commit:
name: Rerun pre-commit checks
runs-on: ubuntu-latest
runs-on: ubuntu-slim
outputs:
dist-base: ${{ steps.paths.outputs.dist }}
docs-base: ${{ steps.paths.outputs.docs }}
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
docs:
name: Docs
needs: pre-commit
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- name: Check out repo
uses: actions/checkout@v5
Expand All @@ -279,7 +279,7 @@ jobs:
name: pypi
url: https://pypi.org/p/openslide-python
needs: [pre-commit, tests, windows]
runs-on: ubuntu-latest
runs-on: ubuntu-slim
concurrency: release-${{ github.ref }}
permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ repos:
hooks:
- id: mypy
name: Check Python types
additional_dependencies: [flask, openslide-bin, pillow, types-PyYAML, types-setuptools]
additional_dependencies: [flask, openslide-bin, pillow >= 12.1.0, types-PyYAML, types-setuptools]

- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.5
Expand Down
4 changes: 1 addition & 3 deletions openslide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,7 @@ def detect_format(cls, filename: lowlevel.Filename) -> str | None:
If the file format is not recognized, return None."""
try:
with Image.open(filename) as img:
# img currently resolves as Any
# https://github.com/python-pillow/Pillow/pull/8362
return img.format # type: ignore[no-any-return]
return img.format
except OSError:
return None

Expand Down
Loading