From 4ebb4a05b3efa7b83f0fc6c05245eefd750b2b3e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 14 Mar 2024 23:04:49 +1100 Subject: [PATCH 1/2] Revert "Pin to Python 3.9.16-1" This reverts commit 139320be3a121dbc38d51baefda8d0b97441314d. --- .github/workflows/test-cygwin.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index 4526b945424..c718e56debd 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -50,7 +50,7 @@ jobs: uses: actions/checkout@v4 - name: Install Cygwin - uses: egor-tensin/setup-cygwin@v4 + uses: cygwin/cygwin-install-action@v4 with: packages: > gcc-g++ @@ -71,7 +71,6 @@ jobs: make netpbm perl - python39=3.9.16-1 python3${{ matrix.python-minor-version }}-cffi python3${{ matrix.python-minor-version }}-cython python3${{ matrix.python-minor-version }}-devel @@ -89,7 +88,7 @@ jobs: - name: Select Python version run: | - ln -sf c:/tools/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/tools/cygwin/bin/python3 + ln -sf c:/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/cygwin/bin/python3 - name: Get latest NumPy version id: latest-numpy From e2986e19897e1a5afa328f7325354e086fc392a3 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 15 Mar 2024 20:41:15 +1100 Subject: [PATCH 2/2] Do not upgrade NumPy --- .github/workflows/test-cygwin.yml | 15 ++------------- src/PIL/Image.py | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-cygwin.yml b/.github/workflows/test-cygwin.yml index c718e56debd..9674a466570 100644 --- a/.github/workflows/test-cygwin.yml +++ b/.github/workflows/test-cygwin.yml @@ -90,19 +90,13 @@ jobs: run: | ln -sf c:/cygwin/bin/python3.${{ matrix.python-minor-version }} c:/cygwin/bin/python3 - - name: Get latest NumPy version - id: latest-numpy - shell: bash.exe -eo pipefail -o igncr "{0}" - run: | - python3 -m pip list --outdated | grep numpy | sed -r 's/ +/ /g' | cut -d ' ' -f 3 | sed 's/^/version=/' >> $GITHUB_OUTPUT - - name: pip cache uses: actions/cache@v4 with: path: 'C:\cygwin\home\runneradmin\.cache\pip' - key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-numpy${{ steps.latest-numpy.outputs.version }}-${{ hashFiles('.ci/install.sh') }} + key: ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-${{ hashFiles('.ci/install.sh') }} restore-keys: | - ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}-numpy${{ steps.latest-numpy.outputs.version }}- + ${{ runner.os }}-cygwin-pip3.${{ matrix.python-minor-version }}- - name: Build system information run: | @@ -112,11 +106,6 @@ jobs: run: | bash.exe .ci/install.sh - - name: Upgrade NumPy - shell: dash.exe -l "{0}" - run: | - python3 -m pip install -U "numpy<1.26" - - name: Build shell: bash.exe -eo pipefail -o igncr "{0}" run: | diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 2e28c6868af..ac3a533211b 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -702,7 +702,7 @@ def __array_interface__(self): pass else: if parse_version(numpy.__version__) < parse_version("1.23"): - warnings.warn(e) + warnings.warn(str(e)) raise new["shape"], new["typestr"] = _conv_type_shape(self) return new