Skip to content

Commit

Permalink
Merge branch 'main' into winbuild-update
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Oct 11, 2022
2 parents ed990ab + e0c30d2 commit 7242a8a
Show file tree
Hide file tree
Showing 72 changed files with 877 additions and 670 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ install:
- mv c:\pillow-depends-main c:\pillow-depends
- xcopy /S /Y c:\pillow-depends\test_images\* c:\pillow\tests\images
- 7z x ..\pillow-depends\nasm-2.15.05-win64.zip -oc:\
- ..\pillow-depends\gs9561w32.exe /S
- path c:\nasm-2.15.05;C:\Program Files (x86)\gs\gs9.56.1\bin;%PATH%
- ..\pillow-depends\gs1000w32.exe /S
- path c:\nasm-2.15.05;C:\Program Files (x86)\gs\gs10.0.0\bin;%PATH%
- cd c:\pillow\winbuild\
- ps: |
c:\python37\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Fuzzing:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

Expand All @@ -16,15 +20,15 @@ jobs:
- uses: actions/checkout@v3

- name: pre-commit cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: lint-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: |
lint-pre-commit-
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
update_release_draft:
permissions:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
permissions:
issues: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
stale:
if: github.repository_owner == 'python-pillow'
Expand All @@ -16,7 +20,7 @@ jobs:

steps:
- name: "Check issues"
uses: actions/stale@v5
uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
only-labels: "Awaiting OP Action"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
Expand Down Expand Up @@ -44,7 +48,7 @@ jobs:
qt5-devel-tools subversion xorg-server-extra zlib-devel
- name: Add Lapack to PATH
uses: egor-tensin/cleanup-path@v1
uses: egor-tensin/cleanup-path@v2
with:
dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack'

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

Expand Down Expand Up @@ -79,7 +83,7 @@ jobs:
MATRIX_DOCKER: ${{ matrix.docker }}

- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
flags: GHA_Docker
name: ${{ matrix.docker }}
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
Expand Down Expand Up @@ -73,11 +77,11 @@ jobs:
python3 -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests
- name: Upload coverage
run: |
python3 -m pip install codecov
bash <(curl -s https://codecov.io/bash) -F GHA_Windows
env:
CODECOV_NAME: ${{ matrix.name }}
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: GHA_Windows
name: ${{ matrix.name }}

success:
permissions:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
Expand Down Expand Up @@ -36,7 +40,7 @@ jobs:

# sets env: pythonLocation
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand All @@ -55,8 +59,8 @@ jobs:
7z x winbuild\depends\nasm-2.15.05-win64.zip "-o$env:RUNNER_WORKSPACE\"
echo "$env:RUNNER_WORKSPACE\nasm-2.15.05" >> $env:GITHUB_PATH
winbuild\depends\gs9561w32.exe /S
echo "C:\Program Files (x86)\gs\gs9.56.1\bin" >> $env:GITHUB_PATH
winbuild\depends\gs1000w32.exe /S
echo "C:\Program Files (x86)\gs\gs10.0.0\bin" >> $env:GITHUB_PATH
xcopy /S /Y winbuild\depends\test_images\* Tests\images\
Expand All @@ -66,7 +70,7 @@ jobs:

- name: Cache build
id: build-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: winbuild\build
key:
Expand Down Expand Up @@ -180,7 +184,7 @@ jobs:
shell: pwsh

- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: GHA_Windows
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: [push, pull_request, workflow_dispatch]
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

Expand All @@ -30,11 +34,6 @@ jobs:
REVERSE: "--reverse"
- python-version: "3.8"
PYTHONOPTIMIZE: 2
# Include new variables for Codecov
- os: ubuntu-latest
codecov-flag: GHA_Ubuntu
- os: macos-latest
codecov-flag: GHA_macOS

runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
Expand All @@ -43,7 +42,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand Down Expand Up @@ -99,17 +98,18 @@ jobs:
- name: Docs
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.10
run: |
python3 -m pip install furo sphinx-copybutton sphinx-issues sphinx-removed-in sphinxext-opengraph
make doccheck
- name: After success
run: |
.ci/after_success.sh
- name: Upload coverage
run: bash <(curl -s https://codecov.io/bash) -F ${{ matrix.codecov-flag }}
env:
CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }}
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: ${{ matrix.os == 'macos-latest' && 'GHA_macOS' || 'GHA_Ubuntu' }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

success:
permissions:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/tidelift.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Tidelift Align

on:
schedule:
- cron: "30 2 * * *" # daily at 02:30 UTC
Expand All @@ -15,6 +16,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
if: github.repository_owner == 'python-pillow'
Expand Down
30 changes: 30 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ Changelog (Pillow)
9.3.0 (unreleased)
------------------

- Added DDS BC6 reading #6449
[ShadelessFox, REDxEYE, radarhere]

- Added support for opening WhiteIsZero 16-bit integer TIFF images #6642
[JayWiz, radarhere]

- Raise an error when allocating translucent color to RGB palette #6654
[jsbueno, radarhere]

- Added reading of TIFF child images #6569
[radarhere]

- Improved ImageOps palette handling #6596
[PososikTeam, radarhere]

- Defer parsing of palette into colors #6567
[radarhere]

- Apply transparency to P images in ImageTk.PhotoImage #6559
[radarhere]

- Use rounding in ImageOps contain() and pad() #6522
[bibinhashley, radarhere]

- Fixed GIF remapping to palette with duplicate entries #6548
[radarhere]

- Allow remap_palette() to return an image with less than 256 palette entries #6543
[radarhere]

- Corrected BMP and TGA palette size when saving #6500
[radarhere]

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ coverage:

.PHONY: doc
doc:
python3 -c "import PIL" > /dev/null 2>&1 || python3 -m pip install .
$(MAKE) -C docs html

.PHONY: doccheck
doccheck:
$(MAKE) -C docs html
$(MAKE) doc
# Don't make our tests rely on the links in the docs being up every single build.
# We don't control them. But do check, and update them to the target of their redirects.
$(MAKE) -C docs linkcheck || true
Expand Down
Binary file added Tests/images/bc6h.dds
Binary file not shown.
Binary file added Tests/images/bc6h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Tests/images/bc6h_sf.dds
Binary file not shown.
Binary file added Tests/images/bc6h_sf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Tests/images/child_ifd.tiff
Binary file not shown.
Binary file added Tests/images/child_ifd_jpeg.tiff
Binary file not shown.
Binary file modified Tests/images/unimplemented_dxgi_format.dds
Binary file not shown.
17 changes: 8 additions & 9 deletions Tests/test_000_sanity.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import PIL
import PIL.Image
from PIL import Image


def test_sanity():
# Make sure we have the binary extension
PIL.Image.core.new("L", (100, 100))
Image.core.new("L", (100, 100))

# Create an image and do stuff with it.
im = PIL.Image.new("1", (100, 100))
im = Image.new("1", (100, 100))
assert (im.mode, im.size) == ("1", (100, 100))
assert len(im.tobytes()) == 1300

# Create images in all remaining major modes.
PIL.Image.new("L", (100, 100))
PIL.Image.new("P", (100, 100))
PIL.Image.new("RGB", (100, 100))
PIL.Image.new("I", (100, 100))
PIL.Image.new("F", (100, 100))
Image.new("L", (100, 100))
Image.new("P", (100, 100))
Image.new("RGB", (100, 100))
Image.new("I", (100, 100))
Image.new("F", (100, 100))
12 changes: 6 additions & 6 deletions Tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ def test_libimagequant_version():
assert re.search(r"\d+\.\d+\.\d+$", features.version("libimagequant"))


def test_check_modules():
for feature in features.modules:
assert features.check_module(feature) in [True, False]
@pytest.mark.parametrize("feature", features.modules)
def test_check_modules(feature):
assert features.check_module(feature) in [True, False]


def test_check_codecs():
for feature in features.codecs:
assert features.check_codec(feature) in [True, False]
@pytest.mark.parametrize("feature", features.codecs)
def test_check_codecs(feature):
assert features.check_codec(feature) in [True, False]


def test_check_warns_on_nonexistent():
Expand Down
Loading

0 comments on commit 7242a8a

Please sign in to comment.