rename Mac OS X to macos
This commit is contained in:
parent
6b03770602
commit
c7dfa1699a
3 changed files with 19 additions and 21 deletions
|
@ -1,28 +1,29 @@
|
|||
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.
|
||||
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",
|
||||
mac_releases = {'10.6': "snowleopard",
|
||||
"10.7": "lion",
|
||||
"10.8": "mountainlion",
|
||||
"10.9": "mavericks",
|
||||
"10.10": "yosemite",
|
||||
"10.11": "elcapitan"}
|
||||
"10.11": "elcapitan",
|
||||
"10.12": "sierra"}
|
||||
|
||||
mac_ver = py_platform.mac_ver()[0][:-2]
|
||||
name = mac_releases.get(mac_ver, "mac_osx")
|
||||
super(MacOsx, self).__init__(name, mac_ver)
|
||||
name = mac_releases.get(mac_ver, "macos")
|
||||
super(MacOs, self).__init__(name, mac_ver)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
|
@ -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)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
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 @@ def setUp(self):
|
|||
|
||||
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 @@ def test_linux_operating_system(self):
|
|||
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)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue