mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-26 16:50:33 +03:00
Merge pull request #4642 from nulano/gha-msys
This commit is contained in:
commit
3bbcd7b3de
|
@ -16,12 +16,6 @@ environment:
|
||||||
ARCHITECTURE: x86
|
ARCHITECTURE: x86
|
||||||
- PYTHON: C:/Python35-x64
|
- PYTHON: C:/Python35-x64
|
||||||
ARCHITECTURE: x64
|
ARCHITECTURE: x64
|
||||||
- PYTHON: C:/msys64/mingw32
|
|
||||||
EXECUTABLE: bin/python3
|
|
||||||
ARCHITECTURE: x86
|
|
||||||
PIP_DIR: bin
|
|
||||||
TEST_OPTIONS: --processes=0
|
|
||||||
DEPLOY: NO
|
|
||||||
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
@ -35,31 +29,15 @@ install:
|
||||||
- path c:\nasm-2.14.02;C:\Program Files (x86)\gs\gs9.52\bin;%PATH%
|
- path c:\nasm-2.14.02;C:\Program Files (x86)\gs\gs9.52\bin;%PATH%
|
||||||
- cd c:\pillow\winbuild\
|
- cd c:\pillow\winbuild\
|
||||||
- ps: |
|
- ps: |
|
||||||
if ($env:PYTHON -eq "c:/msys64/mingw32")
|
|
||||||
{
|
|
||||||
c:\msys64\usr\bin\bash -l -c c:\\pillow\\winbuild\\appveyor_install_msys2_deps.sh
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
c:\python37\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
|
c:\python37\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\
|
||||||
c:\pillow\winbuild\build\build_dep_all.cmd
|
c:\pillow\winbuild\build\build_dep_all.cmd
|
||||||
$host.SetShouldExit(0)
|
$host.SetShouldExit(0)
|
||||||
}
|
|
||||||
- path C:\pillow\winbuild\build\bin;%PATH%
|
- path C:\pillow\winbuild\build\bin;%PATH%
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
if ($env:PYTHON -eq "c:/msys64/mingw32")
|
|
||||||
{
|
|
||||||
c:\msys64\usr\bin\bash -l -c c:\\pillow\\winbuild\\appveyor_build_msys2.sh
|
|
||||||
Write-Host "through install"
|
|
||||||
$host.SetShouldExit(0)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
c:\pillow\winbuild\build\build_pillow.cmd install
|
c:\pillow\winbuild\build\build_pillow.cmd install
|
||||||
$host.SetShouldExit(0)
|
$host.SetShouldExit(0)
|
||||||
}
|
|
||||||
- cd c:\pillow
|
- cd c:\pillow
|
||||||
- '%PYTHON%\%EXECUTABLE% selftest.py --installed'
|
- '%PYTHON%\%EXECUTABLE% selftest.py --installed'
|
||||||
|
|
||||||
|
|
73
.github/workflows/test-windows.yml
vendored
73
.github/workflows/test-windows.yml
vendored
|
@ -154,3 +154,76 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.wheel.outputs.dist }}
|
name: ${{ steps.wheel.outputs.dist }}
|
||||||
path: dist\*.whl
|
path: dist\*.whl
|
||||||
|
|
||||||
|
msys:
|
||||||
|
runs-on: windows-2019
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
mingw: ["MINGW32", "MINGW64"]
|
||||||
|
include:
|
||||||
|
- mingw: "MINGW32"
|
||||||
|
package: "mingw-w64-i686"
|
||||||
|
- mingw: "MINGW64"
|
||||||
|
package: "mingw-w64-x86_64"
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash.exe --login -eo pipefail "{0}"
|
||||||
|
env:
|
||||||
|
MSYSTEM: ${{ matrix.mingw }}
|
||||||
|
CHERE_INVOKING: 1
|
||||||
|
|
||||||
|
timeout-minutes: 30
|
||||||
|
name: MSYS2 ${{ matrix.mingw }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up shell
|
||||||
|
run: echo ::add-path::C:\msys64\usr\bin\
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
pacman -S --noconfirm \
|
||||||
|
${{ matrix.package }}-python3-pip \
|
||||||
|
${{ matrix.package }}-python3-setuptools \
|
||||||
|
${{ matrix.package }}-python3-pytest \
|
||||||
|
${{ matrix.package }}-python3-pytest-cov \
|
||||||
|
${{ matrix.package }}-python3-cffi \
|
||||||
|
${{ matrix.package }}-python3-olefile \
|
||||||
|
${{ matrix.package }}-python3-numpy \
|
||||||
|
${{ matrix.package }}-python3-pyqt5 \
|
||||||
|
${{ matrix.package }}-python3-numpy \
|
||||||
|
${{ matrix.package }}-freetype \
|
||||||
|
${{ matrix.package }}-lcms2 \
|
||||||
|
${{ matrix.package }}-libwebp \
|
||||||
|
${{ matrix.package }}-libjpeg-turbo \
|
||||||
|
${{ matrix.package }}-openjpeg2 \
|
||||||
|
${{ matrix.package }}-libimagequant \
|
||||||
|
${{ matrix.package }}-libraqm \
|
||||||
|
${{ matrix.package }}-ghostscript \
|
||||||
|
subversion
|
||||||
|
|
||||||
|
python3 -m pip install pyroma
|
||||||
|
|
||||||
|
pushd depends && ./install_extra_test_images.sh && popd
|
||||||
|
|
||||||
|
- name: Build Pillow
|
||||||
|
run: |
|
||||||
|
# libtiff is unable to open files
|
||||||
|
CFLAGS="-coverage" python3 setup.py build_ext --disable-tiff install
|
||||||
|
|
||||||
|
- name: Test Pillow
|
||||||
|
run: |
|
||||||
|
python3 selftest.py --installed
|
||||||
|
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: MSYS2 ${{ matrix.mingw }}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
import sysconfig
|
||||||
import tempfile
|
import tempfile
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
|
@ -288,6 +289,10 @@ def is_pypy():
|
||||||
return hasattr(sys, "pypy_translation_info")
|
return hasattr(sys, "pypy_translation_info")
|
||||||
|
|
||||||
|
|
||||||
|
def is_mingw():
|
||||||
|
return sysconfig.get_platform() == "mingw"
|
||||||
|
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
IMCONVERT = os.environ.get("MAGICK_HOME", "")
|
IMCONVERT = os.environ.get("MAGICK_HOME", "")
|
||||||
if IMCONVERT:
|
if IMCONVERT:
|
||||||
|
|
|
@ -13,6 +13,7 @@ from .helper import (
|
||||||
assert_image_equal,
|
assert_image_equal,
|
||||||
assert_image_similar,
|
assert_image_similar,
|
||||||
assert_image_similar_tofile,
|
assert_image_similar_tofile,
|
||||||
|
is_mingw,
|
||||||
is_pypy,
|
is_pypy,
|
||||||
is_win32,
|
is_win32,
|
||||||
skip_unless_feature,
|
skip_unless_feature,
|
||||||
|
@ -660,6 +661,7 @@ class TestImageFont:
|
||||||
{"name": b"Size", "minimum": 0, "maximum": 300, "default": 0}
|
{"name": b"Size", "minimum": 0, "maximum": 300, "default": 0}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@pytest.mark.skipif(is_mingw(), reason="epsilon too high for meaningful test")
|
||||||
def test_variation_set_by_name(self):
|
def test_variation_set_by_name(self):
|
||||||
font = self.get_font()
|
font = self.get_font()
|
||||||
|
|
||||||
|
@ -692,6 +694,7 @@ class TestImageFont:
|
||||||
font.set_variation_by_name(name)
|
font.set_variation_by_name(name)
|
||||||
_check_text(font, "Tests/images/variation_tiny_name.png", 40)
|
_check_text(font, "Tests/images/variation_tiny_name.png", 40)
|
||||||
|
|
||||||
|
@pytest.mark.skipif(is_mingw(), reason="epsilon too high for meaningful test")
|
||||||
def test_variation_set_by_axes(self):
|
def test_variation_set_by_axes(self):
|
||||||
font = self.get_font()
|
font = self.get_font()
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ def test_complex_unicode_text():
|
||||||
|
|
||||||
target = "Tests/images/test_complex_unicode_text2.png"
|
target = "Tests/images/test_complex_unicode_text2.png"
|
||||||
with Image.open(target) as target_img:
|
with Image.open(target) as target_img:
|
||||||
assert_image_similar(im, target_img, 2.3)
|
assert_image_similar(im, target_img, 2.33)
|
||||||
|
|
||||||
|
|
||||||
def test_text_direction_rtl():
|
def test_text_direction_rtl():
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -711,7 +711,7 @@ class pil_build_ext(build_ext):
|
||||||
if feature.jpeg2000:
|
if feature.jpeg2000:
|
||||||
libs.append(feature.jpeg2000)
|
libs.append(feature.jpeg2000)
|
||||||
defs.append(("HAVE_OPENJPEG", None))
|
defs.append(("HAVE_OPENJPEG", None))
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32" and not PLATFORM_MINGW:
|
||||||
defs.append(("OPJ_STATIC", None))
|
defs.append(("OPJ_STATIC", None))
|
||||||
if feature.zlib:
|
if feature.zlib:
|
||||||
libs.append(feature.zlib)
|
libs.append(feature.zlib)
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#define KEEP_PY_UNICODE
|
#define KEEP_PY_UNICODE
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#ifndef _WIN32
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -155,20 +155,24 @@ setraqm(void)
|
||||||
p_raqm.raqm = NULL;
|
p_raqm.raqm = NULL;
|
||||||
|
|
||||||
/* Microsoft needs a totally different system */
|
/* Microsoft needs a totally different system */
|
||||||
#if !defined(_MSC_VER)
|
#ifndef _WIN32
|
||||||
p_raqm.raqm = dlopen("libraqm.so.0", RTLD_LAZY);
|
p_raqm.raqm = dlopen("libraqm.so.0", RTLD_LAZY);
|
||||||
if (!p_raqm.raqm) {
|
if (!p_raqm.raqm) {
|
||||||
p_raqm.raqm = dlopen("libraqm.dylib", RTLD_LAZY);
|
p_raqm.raqm = dlopen("libraqm.dylib", RTLD_LAZY);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
p_raqm.raqm = LoadLibrary("libraqm");
|
p_raqm.raqm = LoadLibrary("libraqm");
|
||||||
|
/* MSYS */
|
||||||
|
if (!p_raqm.raqm) {
|
||||||
|
p_raqm.raqm = LoadLibrary("libraqm-0");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!p_raqm.raqm) {
|
if (!p_raqm.raqm) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#ifndef _WIN32
|
||||||
p_raqm.version_atleast = (t_raqm_version_atleast)dlsym(p_raqm.raqm, "raqm_version_atleast");
|
p_raqm.version_atleast = (t_raqm_version_atleast)dlsym(p_raqm.raqm, "raqm_version_atleast");
|
||||||
p_raqm.create = (t_raqm_create)dlsym(p_raqm.raqm, "raqm_create");
|
p_raqm.create = (t_raqm_create)dlsym(p_raqm.raqm, "raqm_create");
|
||||||
p_raqm.set_text = (t_raqm_set_text)dlsym(p_raqm.raqm, "raqm_set_text");
|
p_raqm.set_text = (t_raqm_set_text)dlsym(p_raqm.raqm, "raqm_set_text");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user