From 49e8e4b590e964a370c4c683113d0ba199c549ac Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Fri, 8 Jul 2016 13:47:25 +0100 Subject: Add comments explaining UCS4 and prevent variant being used on Python 3.3 and above --- var/spack/repos/builtin/packages/python/package.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 4ef9ec5b4f..6018eeb6f8 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -54,6 +54,13 @@ class Python(Package): extendable = True variant('ucs4', default=False, description='Enable UCS4 (wide) unicode strings') + # From https://docs.python.org/2/c-api/unicode.html: Python's default + # builds use a 16-bit type for Py_UNICODE and store Unicode values + # internally as UCS2. It is also possible to build a UCS4 version of Python + # (most recent Linux distributions come with UCS4 builds of Python). These + # builds then use a 32-bit type for Py_UNICODE and store Unicode data + # internally as UCS4. Note that UCS2 and UCS4 Python builds are not binary + # compatible. depends_on("openssl") depends_on("bzip2") @@ -95,6 +102,9 @@ class Python(Package): config_args.append('--enable-unicode=ucs4') elif spec.satisfies('@3.0:3.2'): config_args.append('--with-wide-unicode') + elif spec.satisfies('@3.3:'): + # https://docs.python.org/3.3/whatsnew/3.3.html + raise ValueError('+ucs4 variant not compatible with Python 3.3 and beyond') # NOQA: ignore=E501 if spec.satisfies('@3:'): config_args.append('--without-ensurepip') -- cgit v1.2.3-70-g09d2