From 1e4d81f160ce37de635bd45a5162cf5c080a55fa Mon Sep 17 00:00:00 2001 From: nulano Date: Wed, 14 Oct 2020 17:31:21 +0100 Subject: [PATCH 1/4] add Python 3.10-dev to GHA --- .github/workflows/test-windows.yml | 2 +- .github/workflows/test.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index d384a7d2987..0ebeed7cd5c 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev", "pypy3"] architecture: ["x86", "x64"] include: - architecture: "x86" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6cb09964028..72291876aae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,7 @@ jobs: ] python-version: [ "pypy3", + "3.10-dev", "3.9", "3.8", "3.7", From 26cfe04fea451f689e9a4d137fc8ff8dbf292993 Mon Sep 17 00:00:00 2001 From: nulano Date: Wed, 14 Oct 2020 20:52:16 +0100 Subject: [PATCH 2/4] fix PY_SSIZE_T_CLEAN in display.c --- src/display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/display.c b/src/display.c index 2eb4a58556d..c95844bbcd6 100644 --- a/src/display.c +++ b/src/display.c @@ -22,7 +22,7 @@ * See the README file for information on usage and redistribution. */ - +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "libImaging/Imaging.h" @@ -196,7 +196,7 @@ static PyObject* _frombytes(ImagingDisplayObject* display, PyObject* args) { char* ptr; - int bytes; + Py_ssize_t bytes; if (!PyArg_ParseTuple(args, "y#:frombytes", &ptr, &bytes)) { return NULL; @@ -777,7 +777,7 @@ PyImaging_DrawWmf(PyObject* self, PyObject* args) char* ptr; char* data; - int datasize; + Py_ssize_t datasize; int width, height; int x0, y0, x1, y1; if (!PyArg_ParseTuple(args, "y#(ii)(iiii):_load", &data, &datasize, From bdcc48f0a2d5af58155c6e10a127536d4ac79374 Mon Sep 17 00:00:00 2001 From: nulano Date: Wed, 14 Oct 2020 20:59:19 +0100 Subject: [PATCH 3/4] skip wheels on 3.10-dev due to wheel#354 --- .github/workflows/test-windows.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 0ebeed7cd5c..7c28b5075f7 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -187,14 +187,16 @@ jobs: - name: Build wheel id: wheel - if: "github.event_name == 'push'" + # Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354 + if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')" run: | for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel shell: cmd - uses: actions/upload-artifact@v2 - if: "github.event_name == 'push'" + # Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354 + if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')" with: name: ${{ steps.wheel.outputs.dist }} path: dist\*.whl From b305f99416aafbdf6b799418bb2b9bf1af6be3f1 Mon Sep 17 00:00:00 2001 From: nulano Date: Wed, 14 Oct 2020 19:26:45 +0100 Subject: [PATCH 4/4] skip numpy on 3.10-dev due to wheel#354 --- .ci/install.sh | 3 ++- .github/workflows/macos-install.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/install.sh b/.ci/install.sh index afb88eb17f2..8e1e263e175 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -31,7 +31,8 @@ pip install -U pytest pip install -U pytest-cov pip install pyroma pip install test-image-results -pip install numpy +# TODO Remove condition when numpy supports 3.10 +if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then pip install numpy ; fi # TODO Remove when 3.8 / 3.9 / PyPy3 includes setuptools 49.3.2+: if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then pip install -U "setuptools>=49.3.2" ; fi diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh index 16f532edf7c..4d5e54b2726 100755 --- a/.github/workflows/macos-install.sh +++ b/.github/workflows/macos-install.sh @@ -13,7 +13,8 @@ pip install pyroma pip install test-image-results echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg -pip install numpy +# TODO Remove condition when numpy supports 3.10 +if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then pip install numpy ; fi # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then pip install -U "setuptools>=49.3.2" ; fi