spack.schema package

Submodules

spack.schema.compilers module

Schema for compilers.yaml configuration file.

schema = {
    '$schema': 'http://json-schema.org/schema#',
    'title': 'Spack compiler configuration file schema',
    'type': 'object',
    'additionalProperties': False,
    'patternProperties': {
        'compilers': {
            'type': 'array',
            'items': {
                'compiler': {
                    'type': 'object',
                    'additionalProperties': False,
                    'required': [
                        'paths', 'spec', 'modules', 'operating_system'],
                    'properties': {
                        'paths': {
                            'type': 'object',
                            'required': ['cc', 'cxx', 'f77', 'fc'],
                            'additionalProperties': False,
                            'properties': {
                                'cc':  {'anyOf': [{'type': 'string'},
                                                  {'type': 'null'}]},
                                'cxx': {'anyOf': [{'type': 'string'},
                                                  {'type': 'null'}]},
                                'f77': {'anyOf': [{'type': 'string'},
                                                  {'type': 'null'}]},
                                'fc':  {'anyOf': [{'type': 'string'},
                                                  {'type': 'null'}]}}},
                        'flags': {
                            'type': 'object',
                            'additionalProperties': False,
                            'properties': {
                                'cflags': {'anyOf': [{'type': 'string'},
                                                     {'type': 'null'}]},
                                'cxxflags': {'anyOf': [{'type': 'string'},
                                                       {'type': 'null'}]},
                                'fflags': {'anyOf': [{'type': 'string'},
                                                     {'type': 'null'}]},
                                'cppflags': {'anyOf': [{'type': 'string'},
                                                       {'type': 'null'}]},
                                'ldflags': {'anyOf': [{'type': 'string'},
                                                      {'type': 'null'}]},
                                'ldlibs': {'anyOf': [{'type': 'string'},
                                                     {'type': 'null'}]}}},
                        'spec': {'type': 'string'},
                        'operating_system': {'type': 'string'},
                        'alias': {'anyOf': [{'type': 'string'},
                                            {'type': 'null'}]},
                        'modules': {'anyOf': [{'type': 'string'},
                                              {'type': 'null'},
                                              {'type': 'array'}]},
                        'environment': {
                            'type': 'object',
                            'default': {},
                            'additionalProperties': False,
                            'properties': {
                                'set': {
                                    'type': 'object',
                                    'patternProperties': {
                                        r'\w[\w-]*': {  # variable name
                                            'type': 'string'
                                        }
                                    }
                                }
                            }
                        },
                        'extra_rpaths': {
                            'type': 'array',
                            'default': [],
                            'items': {'type': 'string'}
                        }
                    },
                },
            },
        },
    },
}

spack.schema.config module

Schema for config.yaml configuration file.

schema = {
    '$schema': 'http://json-schema.org/schema#',
    'title': 'Spack module file configuration file schema',
    'type': 'object',
    'additionalProperties': False,
    'patternProperties': {
        'config': {
            'type': 'object',
            'default': {},
            'properties': {
                'install_tree': {'type': 'string'},
                'install_hash_length': {'type': 'integer', 'minimum': 1},
                'install_path_scheme': {'type': 'string'},
                'build_stage': {
                    'oneOf': [
                        {'type': 'string'},
                        {'type': 'array',
                         'items': {'type': 'string'}}],
                },
                'template_dirs': {
                    'type': 'array',
                    'items': {'type': 'string'}
                },
                'module_roots': {
                    'type': 'object',
                    'additionalProperties': False,
                    'properties': {
                        'tcl': {'type': 'string'},
                        'lmod': {'type': 'string'},
                        'dotkit': {'type': 'string'},
                    },
                },
                'source_cache': {'type': 'string'},
                'misc_cache': {'type': 'string'},
                'verify_ssl': {'type': 'boolean'},
                'checksum': {'type': 'boolean'},
                'dirty': {'type': 'boolean'},
                'build_jobs': {'type': 'integer', 'minimum': 1},
            }
        },
    },
}

spack.schema.mirrors module

Schema for mirrors.yaml configuration file.

schema = {
    '$schema': 'http://json-schema.org/schema#',
    'title': 'Spack mirror configuration file schema',
    'type': 'object',
    'additionalProperties': False,
    'patternProperties': {
        r'mirrors': {
            'type': 'object',
            'default': {},
            'additionalProperties': False,
            'patternProperties': {
                r'\w[\w-]*': {
                    'type': 'string'},
            },
        },
    },
}

spack.schema.modules module

Schema for modules.yaml configuration file.

schema = {
    '$schema': 'http://json-schema.org/schema#',
    'title': 'Spack module file configuration file schema',
    'type': 'object',
    'additionalProperties': False,
    'definitions': {
        'array_of_strings': {
            'type': 'array',
            'default': [],
            'items': {
                'type': 'string'
            }
        },
        'dictionary_of_strings': {
            'type': 'object',
            'patternProperties': {
                r'\w[\w-]*': {  # key
                    'type': 'string'
                }
            }
        },
        'dependency_selection': {
            'type': 'string',
            'enum': ['none', 'direct', 'all']
        },
        'module_file_configuration': {
            'type': 'object',
            'default': {},
            'additionalProperties': False,
            'properties': {
                'filter': {
                    'type': 'object',
                    'default': {},
                    'additionalProperties': False,
                    'properties': {
                        'environment_blacklist': {
                            'type': 'array',
                            'default': [],
                            'items': {
                                'type': 'string'
                            }
                        }
                    }
                },
                'template': {
                    'type': 'string'
                },
                'autoload': {
                    '$ref': '#/definitions/dependency_selection'},
                'prerequisites': {
                    '$ref': '#/definitions/dependency_selection'},
                'conflict': {
                    '$ref': '#/definitions/array_of_strings'},
                'load': {
                    '$ref': '#/definitions/array_of_strings'},
                'suffixes': {
                    '$ref': '#/definitions/dictionary_of_strings'},
                'environment': {
                    'type': 'object',
                    'default': {},
                    'additionalProperties': False,
                    'properties': {
                        'set': {
                            '$ref': '#/definitions/dictionary_of_strings'},
                        'unset': {
                            '$ref': '#/definitions/array_of_strings'},
                        'prepend_path': {
                            '$ref': '#/definitions/dictionary_of_strings'},
                        'append_path': {
                            '$ref': '#/definitions/dictionary_of_strings'}
                    }
                }
            }
        },
        'module_type_configuration': {
            'type': 'object',
            'default': {},
            'anyOf': [
                {'properties': {
                    'verbose': {
                        'type': 'boolean',
                        'default': False
                    },
                    'hash_length': {
                        'type': 'integer',
                        'minimum': 0,
                        'default': 7
                    },
                    'whitelist': {
                        '$ref': '#/definitions/array_of_strings'},
                    'blacklist': {
                        '$ref': '#/definitions/array_of_strings'},
                    'naming_scheme': {
                        'type': 'string'  # Can we be more specific here?
                    }
                }},
                {'patternProperties': {
                    r'\w[\w-]*': {
                        '$ref': '#/definitions/module_file_configuration'
                    }
                }}
            ]
        }
    },
    'patternProperties': {
        r'modules': {
            'type': 'object',
            'default': {},
            'additionalProperties': False,
            'properties': {
                'prefix_inspections': {
                    'type': 'object',
                    'patternProperties': {
                        # prefix-relative path to be inspected for existence
                        r'\w[\w-]*': {
                            '$ref': '#/definitions/array_of_strings'}}},
                'enable': {
                    'type': 'array',
                    'default': [],
                    'items': {
                        'type': 'string',
                        'enum': ['tcl', 'dotkit', 'lmod']}},
                'lmod': {
                    'allOf': [
                        # Base configuration
                        {'$ref': '#/definitions/module_type_configuration'},
                        {
                            'core_compilers': {
                                '$ref': '#/definitions/array_of_strings'
                            },
                            'hierarchical_scheme': {
                                '$ref': '#/definitions/array_of_strings'
                            }
                        }  # Specific lmod extensions
                    ]},
                'tcl': {
                    'allOf': [
                        # Base configuration
                        {'$ref': '#/definitions/module_type_configuration'},
                        {}  # Specific tcl extensions
                    ]},
                'dotkit': {
                    'allOf': [
                        # Base configuration
                        {'$ref': '#/definitions/module_type_configuration'},
                        {}  # Specific dotkit extensions
                    ]},
            }
        },
    },
}

spack.schema.packages module

Schema for packages.yaml configuration files.

schema = {
    '$schema': 'http://json-schema.org/schema#',
    'title': 'Spack package configuration file schema',
    'type': 'object',
    'additionalProperties': False,
    'patternProperties': {
        r'packages': {
            'type': 'object',
            'default': {},
            'additionalProperties': False,
            'patternProperties': {
                r'\w[\w-]*': {  # package name
                    'type': 'object',
                    'default': {},
                    'additionalProperties': False,
                    'properties': {
                        'version': {
                            'type': 'array',
                            'default': [],
                            # version strings
                            'items': {'anyOf': [{'type': 'string'},
                                                {'type': 'number'}]}},
                        'compiler': {
                            'type': 'array',
                            'default': [],
                            'items': {'type': 'string'}},  # compiler specs
                        'buildable': {
                            'type':  'boolean',
                            'default': True,
                        },
                        'modules': {
                            'type': 'object',
                            'default': {},
                        },
                        'providers': {
                            'type':  'object',
                            'default': {},
                            'additionalProperties': False,
                            'patternProperties': {
                                r'\w[\w-]*': {
                                    'type': 'array',
                                    'default': [],
                                    'items': {'type': 'string'}, }, }, },
                        'paths': {
                            'type': 'object',
                            'default': {},
                        },
                        'variants': {
                            'oneOf': [
                                {'type': 'string'},
                                {'type': 'array',
                                 'items': {'type': 'string'}}],
                        },
                    },
                },
            },
        },
    },
}

spack.schema.repos module

Schema for repos.yaml configuration file.

schema = {
    '$schema': 'http://json-schema.org/schema#',
    'title': 'Spack repository configuration file schema',
    'type': 'object',
    'additionalProperties': False,
    'patternProperties': {
        r'repos': {
            'type': 'array',
            'default': [],
            'items': {
                'type': 'string'},
        },
    },
}

Module contents

This module contains jsonschema files for all of Spack’s YAML formats.