From cbd77e3a8d22f389041c216ba743eda601fe3754 Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Wed, 2 May 2018 15:26:30 -0400 Subject: [PATCH] make symlinking python3->python optional (#7960) * Make symlinking python3->python optional * Added reference to PEP 394 --- var/spack/repos/builtin/packages/python/package.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 8dc46f113d..30774332fd 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -93,6 +93,10 @@ class Python(AutotoolsPackage): default=False, description='Enable expensive build-time optimizations, if available' ) + # See https://legacy.python.org/dev/peps/pep-0394/ + variant('pythoncmd', default=True, + description="Symlink 'python3' executable to 'python' " + "(not PEP 394 compliant)") depends_on("openssl") depends_on("bzip2") @@ -231,7 +235,7 @@ def post_install(self): os.symlink(os.path.join(src, f), os.path.join(dst, f)) - if spec.satisfies('@3:'): + if spec.satisfies('@3:') and spec.satisfies('+pythoncmd'): os.symlink(os.path.join(prefix.bin, 'python3'), os.path.join(prefix.bin, 'python')) os.symlink(os.path.join(prefix.bin, 'python3-config'),