From e3da10ea5e00a5468f502987f70b97d56f02d761 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 14 Nov 2017 16:47:59 +0200 Subject: [PATCH] Warn if trying to install for Py3.7 on Windows --- setup.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 487e8d6ba..a359cc67f 100755 --- a/setup.py +++ b/setup.py @@ -8,22 +8,34 @@ # Your cheese is so fresh most people think it's a cream: Mascarpone # ------------------------------ from __future__ import print_function + import glob import os import platform as plat import re import struct -import sys import subprocess - +import sys +import warnings +from distutils import ccompiler, sysconfig from distutils.command.build_ext import build_ext -from distutils import sysconfig, ccompiler -from setuptools import Extension, setup, find_packages + +from setuptools import Extension, find_packages, setup # monkey patch import hook. Even though flake8 says it's not used, it is. # comment this out to disable multi threaded builds. import mp_compile + +if sys.platform == "win32" and sys.version_info >= (3, 7): + warnings.warn( + "Pillow does not yet support Python {}.{} and does not yet provide " + "prebuilt Windows binaries. We do not recommend building from " + "source on Windows.".format(sys.version_info.major, + sys.version_info.minor), + RuntimeWarning) + + _IMAGING = ("decode", "encode", "map", "display", "outline", "path") _LIB_IMAGING = ( @@ -750,6 +762,7 @@ class pil_build_ext(build_ext): def debug_build(): return hasattr(sys, 'gettotalrefcount') + try: setup(name=NAME, version=PILLOW_VERSION,