Merge pull request #2855 from hugovk/warn-win-3.7

Warn if trying to install for Py3.7 on Windows
This commit is contained in:
wiredfool 2017-11-25 13:28:21 +00:00 committed by GitHub
commit 753b61e4e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,22 +8,34 @@
# Your cheese is so fresh most people think it's a cream: Mascarpone # Your cheese is so fresh most people think it's a cream: Mascarpone
# ------------------------------ # ------------------------------
from __future__ import print_function from __future__ import print_function
import glob import glob
import os import os
import platform as plat import platform as plat
import re import re
import struct import struct
import sys
import subprocess import subprocess
import sys
import warnings
from distutils import ccompiler, sysconfig
from distutils.command.build_ext import build_ext 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. # monkey patch import hook. Even though flake8 says it's not used, it is.
# comment this out to disable multi threaded builds. # comment this out to disable multi threaded builds.
import mp_compile 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") _IMAGING = ("decode", "encode", "map", "display", "outline", "path")
_LIB_IMAGING = ( _LIB_IMAGING = (
@ -735,6 +747,7 @@ class pil_build_ext(build_ext):
def debug_build(): def debug_build():
return hasattr(sys, 'gettotalrefcount') return hasattr(sys, 'gettotalrefcount')
try: try:
setup(name=NAME, setup(name=NAME,
version=PILLOW_VERSION, version=PILLOW_VERSION,