diff --git a/.appveyor.yml b/.appveyor.yml index 60132a9a35a..6f35a0190d4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,3 +1,10 @@ +skip_commits: + files: + - ".github/**" + - ".gitmodules" + - "docs/**" + - "wheels/**" + version: '{build}' clone_folder: c:\pillow init: @@ -6,29 +13,28 @@ init: # Uncomment previous line to get RDP access during the build. environment: + COVERAGE_CORE: sysmon EXECUTABLE: python.exe TEST_OPTIONS: DEPLOY: YES matrix: - - PYTHON: C:/Python311 + - PYTHON: C:/Python312 ARCHITECTURE: x86 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - PYTHON: C:/Python38-x64 - ARCHITECTURE: x64 + ARCHITECTURE: AMD64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 install: - '%PYTHON%\%EXECUTABLE% --version' - '%PYTHON%\%EXECUTABLE% -m pip install --upgrade pip' -- curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/main.zip - curl -fsSL -o pillow-test-images.zip https://github.com/python-pillow/test-images/archive/main.zip -- 7z x pillow-depends.zip -oc:\ - 7z x pillow-test-images.zip -oc:\ -- mv c:\pillow-depends-main c:\pillow-depends - xcopy /S /Y c:\test-images-main\* c:\pillow\tests\images -- 7z x ..\pillow-depends\nasm-2.16.01-win64.zip -oc:\ -- choco install ghostscript --version=10.0.0.20230317 +- curl -fsSL -o nasm-win64.zip https://raw.githubusercontent.com/python-pillow/pillow-depends/main/nasm-2.16.01-win64.zip +- 7z x nasm-win64.zip -oc:\ +- choco install ghostscript --version=10.3.0 - path c:\nasm-2.16.01;C:\Program Files\gs\gs10.00.0\bin;%PATH% - cd c:\pillow\winbuild\ - ps: | @@ -45,7 +51,7 @@ build_script: test_script: - cd c:\pillow -- '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov pytest-timeout' +- '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov pytest-timeout defusedxml numpy olefile pyroma' - c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE% - '%PYTHON%\%EXECUTABLE% -c "from PIL import Image"' - '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests' diff --git a/.ci/install.sh b/.ci/install.sh index 6e87d386dd0..30b64349d70 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -23,12 +23,13 @@ if [[ $(uname) != CYGWIN* ]]; then sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\ cmake meson imagemagick libharfbuzz-dev libfribidi-dev\ - sway wl-clipboard + sway wl-clipboard libopenblas-dev fi python3 -m pip install --upgrade pip python3 -m pip install --upgrade wheel -PYTHONOPTIMIZE=0 python3 -m pip install cffi +# TODO Update condition when cffi supports 3.13 +if ! [[ "$GHA_PYTHON_VERSION" == "3.13" ]]; then PYTHONOPTIMIZE=0 python3 -m pip install cffi ; fi python3 -m pip install coverage python3 -m pip install defusedxml python3 -m pip install olefile @@ -38,15 +39,25 @@ python3 -m pip install -U pytest-timeout python3 -m pip install pyroma if [[ $(uname) != CYGWIN* ]]; then - # TODO Remove condition when NumPy supports 3.12 - if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi + # TODO Update condition when NumPy supports 3.13 + if ! [[ "$GHA_PYTHON_VERSION" == "3.13" ]]; then python3 -m pip install numpy ; fi # PyQt6 doesn't support PyPy3 - if [[ "$GHA_PYTHON_VERSION" != "3.12-dev" && $GHA_PYTHON_VERSION == 3.* ]]; then + if [[ $GHA_PYTHON_VERSION == 3.* ]]; then sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0 python3 -m pip install pyqt6 fi + # Pyroma uses non-isolated build and fails with old setuptools + if [[ + $GHA_PYTHON_VERSION == pypy3.9 + || $GHA_PYTHON_VERSION == 3.8 + || $GHA_PYTHON_VERSION == 3.9 + ]]; then + # To match pyproject.toml + python3 -m pip install "setuptools>=67.8" + fi + # webp pushd depends && ./install_webp.sh && popd diff --git a/.ci/requirements-cibw.txt b/.ci/requirements-cibw.txt new file mode 100644 index 00000000000..45c2af975ae --- /dev/null +++ b/.ci/requirements-cibw.txt @@ -0,0 +1 @@ +cibuildwheel==2.17.0 diff --git a/.ci/requirements-mypy.txt b/.ci/requirements-mypy.txt new file mode 100644 index 00000000000..6b0535fc1cf --- /dev/null +++ b/.ci/requirements-mypy.txt @@ -0,0 +1 @@ +mypy==1.9.0 diff --git a/.coveragerc b/.coveragerc index f71b6b1a281..018cc1cbfb1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,15 +2,19 @@ [report] # Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma: - pragma: no cover - - # Don't complain if non-runnable code isn't run: +exclude_also = + # Don't complain if non-runnable code isn't run if 0: if __name__ == .__main__.: # Don't complain about debug code if DEBUG: + # Don't complain about compatibility code for missing optional dependencies + except ImportError + if TYPE_CHECKING: + @abc.abstractmethod + # Empty bodies in protocols or abstract methods + ^\s*def [a-zA-Z0-9_]+\(.*\)(\s*->.*)?:\s*\.\.\.(\s*#.*)?$ + ^\s*\.\.\.(\s*#.*)?$ [run] omit = diff --git a/.editorconfig b/.editorconfig index d74549fe2ac..c3627ae4fad 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,7 +13,7 @@ indent_style = space trim_trailing_whitespace = true -[*.yml] +[*.{toml,yml}] # Two-space indentation indent_size = 2 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000000..a2be59c52e4 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,6 @@ +# Flake8 +8de95676e0fd89f2326b3953488ab66ff29cd2d0 +# Format with Black +53a7e3500437a9fd5826bc04758f7116bd7e52dc +# Format the C code with ClangFormat +46b7e86bab79450ec0a2866c6c0c679afb659d17 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e0e6804bfe4..8fc6bd0ad54 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -tidelift: "pypi/Pillow" +tidelift: "pypi/pillow" diff --git a/.github/ISSUE_TEMPLATE/ISSUE_REPORT.md b/.github/ISSUE_TEMPLATE/ISSUE_REPORT.md index 115f6135dfb..ea4c0e92b8e 100644 --- a/.github/ISSUE_TEMPLATE/ISSUE_REPORT.md +++ b/.github/ISSUE_TEMPLATE/ISSUE_REPORT.md @@ -48,6 +48,21 @@ Thank you. * Python: * Pillow: +```text +Please paste here the output of running: + +python3 -m PIL.report +or +python3 -m PIL --report + +Or the output of the following Python code: + +from PIL import report +# or +from PIL import features +features.pilinfo(supported_formats=False) +``` +