From c7dfa1699a2898250e51bdcccc4eb568161a7c1c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 16 Jun 2016 10:43:12 -0700 Subject: rename Mac OS X to macos --- lib/spack/spack/operating_systems/mac_os.py | 29 ++++++++++++++++++++++++++++ lib/spack/spack/operating_systems/mac_osx.py | 28 --------------------------- lib/spack/spack/platforms/darwin.py | 6 +++--- lib/spack/spack/test/operating_system.py | 13 +++++-------- 4 files changed, 37 insertions(+), 39 deletions(-) create mode 100644 lib/spack/spack/operating_systems/mac_os.py delete mode 100644 lib/spack/spack/operating_systems/mac_osx.py diff --git a/lib/spack/spack/operating_systems/mac_os.py b/lib/spack/spack/operating_systems/mac_os.py new file mode 100644 index 0000000000..f35b3ca577 --- /dev/null +++ b/lib/spack/spack/operating_systems/mac_os.py @@ -0,0 +1,29 @@ +import platform as py_platform +from spack.architecture import OperatingSystem + +class MacOs(OperatingSystem): + """This class represents the macOS operating system. This will be + auto detected using the python platform.mac_ver. The macOS + platform will be represented using the major version operating + system name, i.e el capitan, yosemite...etc. + """ + + def __init__(self): + """ Autodetects the mac version from a dictionary. Goes back as + far as 10.6 snowleopard. If the user has an older mac then + the version will just be a generic mac_os. + """ + mac_releases = {'10.6': "snowleopard", + "10.7": "lion", + "10.8": "mountainlion", + "10.9": "mavericks", + "10.10": "yosemite", + "10.11": "elcapitan", + "10.12": "sierra"} + + mac_ver = py_platform.mac_ver()[0][:-2] + name = mac_releases.get(mac_ver, "macos") + super(MacOs, self).__init__(name, mac_ver) + + def __str__(self): + return self.name diff --git a/lib/spack/spack/operating_systems/mac_osx.py b/lib/spack/spack/operating_systems/mac_osx.py deleted file mode 100644 index 3cf9b4e12e..0000000000 --- a/lib/spack/spack/operating_systems/mac_osx.py +++ /dev/null @@ -1,28 +0,0 @@ -import platform as py_platform -from spack.architecture import OperatingSystem - -class MacOsx(OperatingSystem): - """ This class represents the MAC_OSX operating system. This will be auto - detected using the python platform.mac_ver. The MAC_OSX platform - will be represented using the major version operating system name, i.e - el capitan, yosemite...etc. - """ - - def __init__(self): - """ Autodetects the mac version from a dictionary. Goes back as - far as 10.6 snowleopard. If the user has an older mac then - the version will just be a generic mac_os. - """ - mac_releases = {'10.6': "snowleopard", - "10.7": "lion", - "10.8": "mountainlion", - "10.9": "mavericks", - "10.10": "yosemite", - "10.11": "elcapitan"} - - mac_ver = py_platform.mac_ver()[0][:-2] - name = mac_releases.get(mac_ver, "mac_osx") - super(MacOsx, self).__init__(name, mac_ver) - - def __str__(self): - return self.name diff --git a/lib/spack/spack/platforms/darwin.py b/lib/spack/spack/platforms/darwin.py index 8c8af83d55..d47dd640f9 100644 --- a/lib/spack/spack/platforms/darwin.py +++ b/lib/spack/spack/platforms/darwin.py @@ -1,6 +1,6 @@ import subprocess from spack.architecture import Platform, Target -from spack.operating_systems.mac_osx import MacOsx +from spack.operating_systems.mac_os import MacOs class Darwin(Platform): priority = 89 @@ -11,8 +11,8 @@ class Darwin(Platform): def __init__(self): super(Darwin, self).__init__('darwin') self.add_target(self.default, Target(self.default)) - mac_os = MacOsx() - + mac_os = MacOs() + self.default_os = str(mac_os) self.front_os = str(mac_os) self.back_os = str(mac_os) diff --git a/lib/spack/spack/test/operating_system.py b/lib/spack/spack/test/operating_system.py index 205408db3f..ed5f6ff8ad 100644 --- a/lib/spack/spack/test/operating_system.py +++ b/lib/spack/spack/test/operating_system.py @@ -10,7 +10,7 @@ from spack.platforms.cray_xc import CrayXc from spack.platforms.linux import Linux from spack.platforms.darwin import Darwin from spack.operating_system.linux_distro import LinuxDistro -from spack.operating_system.mac_osx import MacOSX +from spack.operating_system.mac_os import MacOs from spack.operating_system.cnl import ComputeNodeLinux class TestOperatingSystem(unittest.TestCase): @@ -27,12 +27,12 @@ class TestOperatingSystem(unittest.TestCase): def test_cray_front_end_operating_system(self): self.assertIsInstance(self.cray_operating_sys, LinuxDistro) - + def test_cray_front_end_compiler_strategy(self): self.assertEquals(self.cray_operating_sys.compiler_strategy, "PATH") def test_cray_back_end_operating_system(self): - self.assertIsInstance(self.cray_back_os,ComputeNodeLinux) + self.assertIsInstance(self.cray_back_os,ComputeNodeLinux) def test_cray_back_end_compiler_strategy(self): self.assertEquals(self.cray_back_os.compiler_strategy, "MODULES") @@ -43,16 +43,13 @@ class TestOperatingSystem(unittest.TestCase): def test_linux_compiler_strategy(self): self.assertEquals(self.linux_operating_sys.compiler_strategy, "PATH") - + def test_cray_front_end_compiler_list(self): """ Operating systems will now be in charge of finding compilers. So, depending on which operating system you want to build for - or which operating system you are on, then you could detect + or which operating system you are on, then you could detect compilers in a certain way. Cray linux environment on the front end is just a regular linux distro whereas the Cray linux compute node is a stripped down version which modules are important """ self.assertEquals(True, False) - - - -- cgit v1.2.3-70-g09d2