summaryrefslogtreecommitdiff
path: root/lib/spack/spack/schema/spec.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/schema/spec.py')
-rw-r--r--lib/spack/spack/schema/spec.py99
1 files changed, 19 insertions, 80 deletions
diff --git a/lib/spack/spack/schema/spec.py b/lib/spack/spack/schema/spec.py
index 54a5d990a3..8d2390b2f3 100644
--- a/lib/spack/spack/schema/spec.py
+++ b/lib/spack/spack/schema/spec.py
@@ -14,44 +14,26 @@ TODO: This needs to be updated? Especially the hashes under properties.
target = {
"oneOf": [
- {
- "type": "string",
- },
+ {"type": "string"},
{
"type": "object",
"additionalProperties": False,
- "required": [
- "name",
- "vendor",
- "features",
- "generation",
- "parents",
- ],
+ "required": ["name", "vendor", "features", "generation", "parents"],
"properties": {
"name": {"type": "string"},
"vendor": {"type": "string"},
- "features": {
- "type": "array",
- "items": {"type": "string"},
- },
+ "features": {"type": "array", "items": {"type": "string"}},
"generation": {"type": "integer"},
- "parents": {
- "type": "array",
- "items": {"type": "string"},
- },
+ "parents": {"type": "array", "items": {"type": "string"}},
},
},
- ],
+ ]
}
arch = {
"type": "object",
"additionalProperties": False,
- "properties": {
- "platform": {},
- "platform_os": {},
- "target": target,
- },
+ "properties": {"platform": {}, "platform_os": {}, "target": target},
}
dependencies = {
@@ -61,12 +43,9 @@ dependencies = {
"type": "object",
"properties": {
"hash": {"type": "string"},
- "type": {
- "type": "array",
- "items": {"type": "string"},
- },
+ "type": {"type": "array", "items": {"type": "string"}},
},
- },
+ }
},
}
@@ -90,13 +69,7 @@ properties = {
"items": {
"type": "object",
"additionalProperties": False,
- "required": [
- "version",
- "arch",
- "compiler",
- "namespace",
- "parameters",
- ],
+ "required": ["version", "arch", "compiler", "namespace", "parameters"],
"properties": {
"name": {"type": "string"},
"hash": {"type": "string"},
@@ -104,12 +77,7 @@ properties = {
# these hashes were used on some specs prior to 0.18
"full_hash": {"type": "string"},
"build_hash": {"type": "string"},
- "version": {
- "oneOf": [
- {"type": "string"},
- {"type": "number"},
- ],
- },
+ "version": {"oneOf": [{"type": "string"}, {"type": "number"}]},
"arch": arch,
"compiler": {
"type": "object",
@@ -119,12 +87,7 @@ properties = {
"version": {"type": "string"},
},
},
- "develop": {
- "anyOf": [
- {"type": "boolean"},
- {"type": "string"},
- ],
- },
+ "develop": {"anyOf": [{"type": "boolean"}, {"type": "string"}]},
"namespace": {"type": "string"},
"parameters": {
"type": "object",
@@ -138,40 +101,16 @@ properties = {
],
"additionalProperties": True,
"properties": {
- "patches": {
- "type": "array",
- "items": {"type": "string"},
- },
- "cflags": {
- "type": "array",
- "items": {"type": "string"},
- },
- "cppflags": {
- "type": "array",
- "items": {"type": "string"},
- },
- "cxxflags": {
- "type": "array",
- "items": {"type": "string"},
- },
- "fflags": {
- "type": "array",
- "items": {"type": "string"},
- },
- "ldflags": {
- "type": "array",
- "items": {"type": "string"},
- },
- "ldlib": {
- "type": "array",
- "items": {"type": "string"},
- },
+ "patches": {"type": "array", "items": {"type": "string"}},
+ "cflags": {"type": "array", "items": {"type": "string"}},
+ "cppflags": {"type": "array", "items": {"type": "string"}},
+ "cxxflags": {"type": "array", "items": {"type": "string"}},
+ "fflags": {"type": "array", "items": {"type": "string"}},
+ "ldflags": {"type": "array", "items": {"type": "string"}},
+ "ldlib": {"type": "array", "items": {"type": "string"}},
},
},
- "patches": {
- "type": "array",
- "items": {},
- },
+ "patches": {"type": "array", "items": {}},
"dependencies": dependencies,
"build_spec": build_spec,
},