Skip to content

Commit

Permalink
testwheels
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 14, 2023
1 parent d8952dd commit b55c160
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/wheels-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
EXP_CODECS="jpg jpg_2000 libtiff zlib"
EXP_MODULES="freetype2 littlecms2 pil tkinter webp"
EXP_FEATURES="fribidi harfbuzz libjpeg_turbo raqm transp_webp webp_anim webp_mux xcb"

if [ -n "$IS_MACOS" ]; then
brew install fribidi
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
elif [ -n "$IS_ALPINE" ]; then
apk add curl fribidi
else
apt-get update
apt-get install -y curl libfribidi0 libopenblas-dev pkg-config unzip
fi
if [ -z "$IS_ALPINE" ]; then
python3 -m pip install numpy
fi
python3 -m pip install defusedxml olefile pyroma

curl -fsSL -o pillow-test-images.zip https://github.com/python-pillow/test-images/archive/main.zip
unzip -qq pillow-test-images.zip
mv test-images-main/* ../Tests/images

# Runs tests
python3 selftest.py
python3 -m pytest

# Test against expected codecs, modules and features
codecs=$(python3 -c 'from PIL.features import *; print(" ".join(sorted(get_supported_codecs())))')
if [ "$codecs" != "$EXP_CODECS" ]; then
echo "Codecs should be: '$EXP_CODECS'; but are '$codecs'"
exit 1
fi
modules=$(python3 -c 'from PIL.features import *; print(" ".join(sorted(get_supported_modules())))')
if [ "$modules" != "$EXP_MODULES" ]; then
echo "Modules should be: '$EXP_MODULES'; but are '$modules'"
exit 1
fi
features=$(python3 -c 'from PIL.features import *; print(" ".join(sorted(get_supported_features())))')
if [ "$features" != "$EXP_FEATURES" ]; then
echo "Features should be: '$EXP_FEATURES'; but are '$features'"
exit 1
fi
5 changes: 1 addition & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
archs: [ x86_64 ]
include:
- os: macos-latest
archs: arm64
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Twitter = "https://twitter.com/PythonPillow"

[tool.cibuildwheel]
before-all = ".github/workflows/wheels-dependencies.sh"
test-command = "cd {project} && .github/workflows/wheels-test.sh"
test-requires = "pytest pytest-timeout"

[tool.setuptools]
packages = ["PIL"]
Expand Down

0 comments on commit b55c160

Please sign in to comment.