Skip to content

Commit 3a5c336

Browse files
authored
Merge pull request #4980 from nulano/3.10
GHA: Add 3.10-dev
2 parents 662f565 + 732bf12 commit 3a5c336

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

.ci/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ python3 -m pip install -U pytest
3131
python3 -m pip install -U pytest-cov
3232
python3 -m pip install pyroma
3333
python3 -m pip install test-image-results
34-
python3 -m pip install numpy
34+
# TODO Remove condition when numpy supports 3.10
35+
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
3536

3637
# TODO Remove when 3.8 / 3.9 / PyPy3 includes setuptools 49.3.2+:
3738
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi

.github/workflows/macos-install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ python3 -m pip install pyroma
1313
python3 -m pip install test-image-results
1414

1515
echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg
16-
python3 -m pip install numpy
16+
# TODO Remove condition when numpy supports 3.10
17+
if ! [ "$GHA_PYTHON_VERSION" == "3.10-dev" ]; then python3 -m pip install numpy ; fi
1718

1819
# TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+:
1920
if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi

.github/workflows/test-windows.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"]
11+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev", "pypy3"]
1212
architecture: ["x86", "x64"]
1313
include:
1414
- architecture: "x86"
@@ -182,14 +182,16 @@ jobs:
182182

183183
- name: Build wheel
184184
id: wheel
185-
if: "github.event_name == 'push'"
185+
# Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354
186+
if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')"
186187
run: |
187188
for /f "tokens=3 delims=/" %%a in ("${{ github.ref }}") do echo ::set-output name=dist::dist-%%a
188189
winbuild\\build\\build_pillow.cmd --disable-imagequant bdist_wheel
189190
shell: cmd
190191

191192
- uses: actions/upload-artifact@v2
192-
if: "github.event_name == 'push'"
193+
# Skip wheels on 3.10 due to https://github.com/pypa/wheel/issues/354
194+
if: "github.event_name == 'push' && !contains(matrix.python-version, '3.10')"
193195
with:
194196
name: ${{ steps.wheel.outputs.dist }}
195197
path: dist\*.whl

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
]
1515
python-version: [
1616
"pypy3",
17+
"3.10-dev",
1718
"3.9",
1819
"3.8",
1920
"3.7",

src/display.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* See the README file for information on usage and redistribution.
2323
*/
2424

25-
25+
#define PY_SSIZE_T_CLEAN
2626
#include "Python.h"
2727

2828
#include "libImaging/Imaging.h"
@@ -196,7 +196,7 @@ static PyObject*
196196
_frombytes(ImagingDisplayObject* display, PyObject* args)
197197
{
198198
char* ptr;
199-
int bytes;
199+
Py_ssize_t bytes;
200200

201201
if (!PyArg_ParseTuple(args, "y#:frombytes", &ptr, &bytes)) {
202202
return NULL;
@@ -777,7 +777,7 @@ PyImaging_DrawWmf(PyObject* self, PyObject* args)
777777
char* ptr;
778778

779779
char* data;
780-
int datasize;
780+
Py_ssize_t datasize;
781781
int width, height;
782782
int x0, y0, x1, y1;
783783
if (!PyArg_ParseTuple(args, "y#(ii)(iiii):_load", &data, &datasize,

0 commit comments

Comments
 (0)