Merge pull request #4205 from hugovk/include-version-in-windows-wheel-warning

Include Pillow version in Windows wheel warning
This commit is contained in:
Andrew Murray 2019-11-15 20:39:28 +11:00 committed by GitHub
commit f6114ee373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,11 +24,31 @@ from setuptools import Extension, setup
# comment this out to disable multi threaded builds.
import mp_compile
def get_version():
version_file = "src/PIL/_version.py"
with open(version_file, "r") as f:
exec(compile(f.read(), version_file, "exec"))
return locals()["__version__"]
NAME = "Pillow"
PILLOW_VERSION = get_version()
FREETYPE_ROOT = None
IMAGEQUANT_ROOT = None
JPEG2K_ROOT = None
JPEG_ROOT = None
LCMS_ROOT = None
TIFF_ROOT = None
ZLIB_ROOT = None
if sys.platform == "win32" and sys.version_info >= (3, 9):
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),
"Pillow {} does not support Python {}.{} and does not provide prebuilt "
"Windows binaries. We do not recommend building from source on Windows.".format(
PILLOW_VERSION, sys.version_info.major, sys.version_info.minor
),
RuntimeWarning,
)
@ -233,24 +253,6 @@ def _read(file):
return fp.read()
def get_version():
version_file = "src/PIL/_version.py"
with open(version_file, "r") as f:
exec(compile(f.read(), version_file, "exec"))
return locals()["__version__"]
NAME = "Pillow"
PILLOW_VERSION = get_version()
JPEG_ROOT = None
JPEG2K_ROOT = None
ZLIB_ROOT = None
IMAGEQUANT_ROOT = None
TIFF_ROOT = None
FREETYPE_ROOT = None
LCMS_ROOT = None
def _pkg_config(name):
try:
command = os.environ.get("PKG_CONFIG", "pkg-config")