From fb6d850637fd1399232a08f27d63da318eb474d2 Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Thu, 7 Jul 2016 13:09:08 +0100 Subject: Add more python versions --- var/spack/repos/builtin/packages/python/package.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index d019133585..524f42633a 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -38,9 +38,15 @@ class Python(Package): homepage = "http://www.python.org" url = "http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz" + version('3.5.2', '3fe8434643a78630c61c6464fe2e7e72') version('3.5.1', 'be78e48cdfc1a7ad90efff146dce6cfe') version('3.5.0', 'a56c0c0b45d75a0ec9c6dee933c41c36') - version('2.7.11', '6b6076ec9e93f05dd63e47eb9c15728b', preferred=True) + version('3.4.3', '4281ff86778db65892c05151d5de738d') + version('3.3.6', 'cdb3cd08f96f074b3f3994ccb51063e9') + version('3.2.6', '23815d82ae706e9b781ca65865353d39') + version('3.1.5', '02196d3fc7bc76bdda68aa36b0dd16ab') + version('2.7.12', '88d61f82e3616a4be952828b3694109d', preferred=True) + version('2.7.11', '6b6076ec9e93f05dd63e47eb9c15728b') version('2.7.10', 'd7547558fd673bd9d38e2108c6b42521') version('2.7.9', '5eebcaa0030dc4061156d3429657fb83') version('2.7.8', 'd4bca0159acb0b44a781292b5231936f') -- cgit v1.2.3-70-g09d2 From 8c1274bbbbc25f18bcfea4850bbf49db1b86ca47 Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Thu, 7 Jul 2016 13:12:43 +0100 Subject: Fix Python configure arguments for ucs4 variant on Python 3.0 and above --- var/spack/repos/builtin/packages/python/package.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 524f42633a..ce5377483d 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -53,7 +53,7 @@ class Python(Package): extendable = True - variant('ucs4', default=False, description='Enable UCS4 unicode strings') + variant('ucs4', default=False, description='Enable UCS4 (wide) unicode strings') depends_on("openssl") depends_on("bzip2") @@ -91,7 +91,10 @@ class Python(Package): ] if '+ucs4' in spec: - config_args.append('--enable-unicode=ucs4') + if spec.satisfies('@:3.0'): + config_args.append('--enable-unicode=ucs4') + elif spec.satisfies('@3.0:3.2'): + config_args.append('--with-wide-unicode') if spec.satisfies('@3:'): config_args.append('--without-ensurepip') -- cgit v1.2.3-70-g09d2 From 719b6bfffddb1e99606f5cfc71ec6b70e2ea08e7 Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Thu, 7 Jul 2016 13:18:40 +0100 Subject: Modify range for ucs4 2.* configure arguments --- var/spack/repos/builtin/packages/python/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index ce5377483d..735b8c9099 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -91,7 +91,7 @@ class Python(Package): ] if '+ucs4' in spec: - if spec.satisfies('@:3.0'): + if spec.satisfies('@:2.7'): config_args.append('--enable-unicode=ucs4') elif spec.satisfies('@3.0:3.2'): config_args.append('--with-wide-unicode') -- cgit v1.2.3-70-g09d2 From a2be05f24bd3c3e378dcdf4c336fb9c6c0058672 Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Thu, 7 Jul 2016 14:00:37 +0100 Subject: Fix whitespace --- var/spack/repos/builtin/packages/python/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 735b8c9099..4ef9ec5b4f 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -94,7 +94,7 @@ class Python(Package): if spec.satisfies('@:2.7'): config_args.append('--enable-unicode=ucs4') elif spec.satisfies('@3.0:3.2'): - config_args.append('--with-wide-unicode') + config_args.append('--with-wide-unicode') if spec.satisfies('@3:'): config_args.append('--without-ensurepip') -- cgit v1.2.3-70-g09d2 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(+) (limited to 'var') 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