diff --git a/.ci/install.sh b/.ci/install.sh index a8e82fa49..77dccaa4a 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -31,7 +31,8 @@ python3 -m pip install -U pytest python3 -m pip install -U pytest-cov python3 -m pip install pyroma python3 -m pip install test-image-results -python3 -m pip install numpy +# TODO Remove condition when numpy supports 3.10 +if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi # TODO Remove when 3.8 / 3.9 / PyPy3 includes setuptools 49.3.2+: if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh index 473412d3b..fb8869c7d 100755 --- a/.github/workflows/macos-install.sh +++ b/.github/workflows/macos-install.sh @@ -13,7 +13,8 @@ python3 -m pip install pyroma python3 -m pip install test-image-results echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg -python3 -m pip install numpy +# TODO Remove condition when numpy supports 3.10 +if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a7fb2bdbc..4d3619edb 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" @@ -182,14 +182,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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fc8a09cb..3da945f39 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", diff --git a/src/display.c b/src/display.c index 2eb4a5855..c95844bbc 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,