Skip to content

Commit 65edcc4

Browse files
committed
Merge branch 'main' into PPMheaders
2 parents f5b9e2c + 92c26a7 commit 65edcc4

File tree

544 files changed

+30100
-19440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

544 files changed

+30100
-19440
lines changed

.appveyor.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ environment:
1010
TEST_OPTIONS:
1111
DEPLOY: YES
1212
matrix:
13-
- PYTHON: C:/Python39
13+
- PYTHON: C:/Python310
1414
ARCHITECTURE: x86
15-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
16-
- PYTHON: C:/Python36-x64
15+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
16+
- PYTHON: C:/Python37-x64
1717
ARCHITECTURE: x64
1818
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
1919

2020

2121
install:
22-
- curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/master.zip
22+
- '%PYTHON%\%EXECUTABLE% --version'
23+
- curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/main.zip
2324
- 7z x pillow-depends.zip -oc:\
24-
- mv c:\pillow-depends-master c:\pillow-depends
25+
- mv c:\pillow-depends-main c:\pillow-depends
2526
- xcopy /S /Y c:\pillow-depends\test_images\* c:\pillow\tests\images
26-
- 7z x ..\pillow-depends\nasm-2.14.02-win64.zip -oc:\
27-
- ..\pillow-depends\gs9533w32.exe /S
28-
- path c:\nasm-2.14.02;C:\Program Files (x86)\gs\gs9.53.3\bin;%PATH%
27+
- 7z x ..\pillow-depends\nasm-2.15.05-win64.zip -oc:\
28+
- ..\pillow-depends\gs9550w32.exe /S
29+
- path c:\nasm-2.15.05;C:\Program Files (x86)\gs\gs9.55.0\bin;%PATH%
2930
- cd c:\pillow\winbuild\
3031
- ps: |
3132
c:\python37\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
3233
c:\pillow\winbuild\build\build_dep_all.cmd
3334
$host.SetShouldExit(0)
3435
- path C:\pillow\winbuild\build\bin;%PATH%
35-
- '%PYTHON%\%EXECUTABLE% -m pip install -U "setuptools>=49.3.2"'
3636

3737
build_script:
3838
- ps: |
@@ -45,6 +45,7 @@ test_script:
4545
- cd c:\pillow
4646
- '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov'
4747
- c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE%
48+
- '%PYTHON%\%EXECUTABLE% -c "from PIL import Image"'
4849
- '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests'
4950
#- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%' TODO TEST_OPTIONS with pytest?
5051

@@ -83,7 +84,7 @@ deploy:
8384
artifact: /.*egg|wheel/
8485
on:
8586
APPVEYOR_REPO_NAME: python-pillow/Pillow
86-
branch: master
87+
branch: main
8788
deploy: YES
8889

8990

.ci/after_success.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# gather the coverage data
4-
pip3 install codecov
4+
python3 -m pip install codecov
55
if [[ $MATRIX_DOCKER ]]; then
66
coverage xml --ignore-errors
77
else

.ci/install.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,23 @@ set -e
1919

2020
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
2121
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
22-
cmake imagemagick libharfbuzz-dev libfribidi-dev
22+
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
2323

2424
python3 -m pip install --upgrade pip
25+
python3 -m pip install --upgrade wheel
2526
PYTHONOPTIMIZE=0 python3 -m pip install cffi
2627
python3 -m pip install coverage
28+
python3 -m pip install defusedxml
2729
python3 -m pip install olefile
2830
python3 -m pip install -U pytest
2931
python3 -m pip install -U pytest-cov
32+
python3 -m pip install -U pytest-timeout
3033
python3 -m pip install pyroma
3134
python3 -m pip install test-image-results
32-
# TODO Remove condition when numpy supports 3.10
33-
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
34-
35-
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
36-
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
37-
if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
35+
python3 -m pip install numpy
3836

3937
# PyQt5 doesn't support PyPy3
40-
# Wheel doesn't yet support 3.10
41-
if [[ $GHA_PYTHON_VERSION == 3.* && $GHA_PYTHON_VERSION != "3.10-dev" ]]; then
38+
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
4239
# arm64, ppc64le, s390x CPUs:
4340
# "ERROR: Could not find a version that satisfies the requirement pyqt5"
4441
sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools

.ci/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
set -e
44

5-
python -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests
5+
python3 -c "from PIL import Image"
6+
7+
python3 -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests $REVERSE

.clang-format

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# A clang-format style that approximates Python's PEP 7
2+
# Useful for IDE integration
3+
BasedOnStyle: Google
4+
AlwaysBreakAfterReturnType: All
5+
AllowShortIfStatementsOnASingleLine: false
6+
AlignAfterOpenBracket: AlwaysBreak
7+
BinPackArguments: false
8+
BinPackParameters: false
9+
BreakBeforeBraces: Attach
10+
ColumnLimit: 88
11+
DerivePointerAlignment: false
12+
IndentWidth: 4
13+
Language: Cpp
14+
PointerAlignment: Right
15+
ReflowComments: true
16+
SortIncludes: false
17+
SpaceBeforeParens: ControlStatements
18+
SpacesInParentheses: false
19+
TabWidth: 4
20+
UseTab: Never

.github/CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ Bug fixes, feature additions, tests, documentation and more can be contributed v
44

55
## Bug fixes, feature additions, etc.
66

7-
Please send a pull request to the master branch. Please include [documentation](https://pillow.readthedocs.io) and [tests](../Tests/README.rst) for new features. Tests or documentation without bug fixes or feature additions are welcome too. Feel free to ask questions [via issues](https://github.com/python-pillow/Pillow/issues/new), [Gitter](https://gitter.im/python-pillow/Pillow) or irc://irc.freenode.net#pil
7+
Please send a pull request to the `main` branch. Please include [documentation](https://pillow.readthedocs.io) and [tests](../Tests/README.rst) for new features. Tests or documentation without bug fixes or feature additions are welcome too. Feel free to ask questions [via issues](https://github.com/python-pillow/Pillow/issues/new), [Gitter](https://gitter.im/python-pillow/Pillow) or irc://irc.freenode.net#pil
88

99
- Fork the Pillow repository.
10-
- Create a branch from master.
10+
- Create a branch from `main`.
1111
- Develop bug fixes, features, tests, etc.
1212
- Run the test suite. You can enable GitHub Actions (https://github.com/MY-USERNAME/Pillow/actions) and [AppVeyor](https://ci.appveyor.com/projects/new) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests.
13-
- Create a pull request to pull the changes from your branch to the Pillow master.
13+
- Create a pull request to pull the changes from your branch to the Pillow `main`.
1414

1515
### Guidelines
1616

1717
- Separate code commits from reformatting commits.
1818
- Provide tests for any newly added code.
1919
- Follow PEP 8.
2020
- When committing only documentation changes please include `[ci skip]` in the commit message to avoid running tests on AppVeyor.
21+
- Include [release notes](https://github.com/python-pillow/Pillow/tree/main/docs/releasenotes) as needed or appropriate with your bug fixes, feature additions and tests.
2122

2223
## Reporting Issues
2324

@@ -34,4 +35,4 @@ The best reproductions are self-contained scripts with minimal dependencies. If
3435

3536
## Security vulnerabilities
3637

37-
Please see our [security policy](https://github.com/python-pillow/Pillow/blob/master/.github/SECURITY.md).
38+
Please see our [security policy](https://github.com/python-pillow/Pillow/blob/main/.github/SECURITY.md).

.github/mergify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pull_request_rules:
77
- status-success=Test Successful
88
- status-success=Docker Test Successful
99
- status-success=Windows Test Successful
10+
- status-success=MinGW Test Successful
1011
- status-success=continuous-integration/appveyor/pr
1112
actions:
1213
merge:

.github/workflows/cifuzz.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CIFuzz
2+
3+
on:
4+
push:
5+
paths:
6+
- "**.c"
7+
- "**.h"
8+
pull_request:
9+
paths:
10+
- "**.c"
11+
- "**.h"
12+
workflow_dispatch:
13+
14+
jobs:
15+
Fuzzing:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Build Fuzzers
19+
id: build
20+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
21+
with:
22+
oss-fuzz-project-name: 'pillow'
23+
language: python
24+
dry-run: false
25+
- name: Run Fuzzers
26+
id: run
27+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
28+
with:
29+
oss-fuzz-project-name: 'pillow'
30+
fuzz-seconds: 600
31+
language: python
32+
dry-run: false
33+
- name: Upload New Crash
34+
uses: actions/upload-artifact@v2
35+
if: failure() && steps.build.outcome == 'success'
36+
with:
37+
name: artifacts
38+
path: ./out/artifacts
39+
- name: Upload Legacy Crash
40+
uses: actions/upload-artifact@v2
41+
if: steps.run.outcome == 'success'
42+
with:
43+
name: crash
44+
path: ./out/crash*
45+
- name: Fail on legacy crash
46+
if: success()
47+
run: |
48+
[ ! -e out/crash-* ]
49+
echo No legacy crash detected

.github/workflows/lint.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
build:
@@ -12,14 +12,6 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414

15-
- name: pip cache
16-
uses: actions/cache@v2
17-
with:
18-
path: ~/.cache/pip
19-
key: lint-pip-${{ hashFiles('**/setup.py') }}
20-
restore-keys: |
21-
lint-pip-
22-
2315
- name: pre-commit cache
2416
uses: actions/cache@v2
2517
with:
@@ -31,18 +23,19 @@ jobs:
3123
- name: Set up Python
3224
uses: actions/setup-python@v2
3325
with:
34-
python-version: 3.8
26+
python-version: "3.10"
27+
cache: pip
28+
cache-dependency-path: "setup.py"
3529

3630
- name: Build system information
37-
run: python .github/workflows/system-info.py
31+
run: python3 .github/workflows/system-info.py
3832

3933
- name: Install dependencies
4034
run: |
41-
python -m pip install -U pip
42-
python -m pip install -U tox
35+
python3 -m pip install -U pip
36+
python3 -m pip install -U tox
4337
4438
- name: Lint
4539
run: tox -e lint
4640
env:
4741
PRE_COMMIT_COLOR: always
48-

.github/workflows/macos-install.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype op
66

77
PYTHONOPTIMIZE=0 python3 -m pip install cffi
88
python3 -m pip install coverage
9+
python3 -m pip install defusedxml
910
python3 -m pip install olefile
1011
python3 -m pip install -U pytest
1112
python3 -m pip install -U pytest-cov
13+
python3 -m pip install -U pytest-timeout
1214
python3 -m pip install pyroma
1315
python3 -m pip install test-image-results
1416

1517
echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
16-
# TODO Remove condition when numpy supports 3.10
17-
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
18-
19-
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
20-
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
21-
if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi
18+
python3 -m pip install numpy
2219

2320
# extra test images
2421
pushd depends && ./install_extra_test_images.sh && popd

0 commit comments

Comments
 (0)