Skip to content

Commit

Permalink
Do not quote Pillow version for setuptools >= 60
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jul 18, 2022
1 parent 2258f23 commit 5a6a26a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/test-windows.yml
Expand Up @@ -11,14 +11,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
architecture: ["x86", "x64"]
include:
# PyPy 7.3.4+ only ships 64-bit binaries for Windows
- python-version: "pypy-3.7"
architecture: "x64"
- python-version: "pypy-3.8"
architecture: "x64"
python-version: ["3.7", "3.8", "3.9"]
architecture: ["x64"]

timeout-minutes: 30

Expand Down
9 changes: 6 additions & 3 deletions setup.py
Expand Up @@ -15,6 +15,7 @@
import sys
import warnings

from setuptools import __version__ as setuptools_version
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext

Expand Down Expand Up @@ -846,14 +847,16 @@ def build_extensions(self):
if struct.unpack("h", b"\0\1")[0] == 1:
defs.append(("WORDS_BIGENDIAN", None))

defs.append(("PILLOW_VERSION", f'"{PILLOW_VERSION}"'))
if (
sys.platform == "win32"
and sys.version_info < (3, 9)
and not (PLATFORM_PYPY or PLATFORM_MINGW)
):
defs.append(("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""'))
else:
defs.append(("PILLOW_VERSION", f'"{PILLOW_VERSION}"'))
from packaging.version import parse as parse_version

if parse_version(setuptools_version) < parse_version("60.0.0"):
defs[-1] = ("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""')

self._update_extension("PIL._imaging", libs, defs)

Expand Down

0 comments on commit 5a6a26a

Please sign in to comment.