Skip to content

Commit 95cfbe1

Browse files
author
Peter Amstutz
committed
List out files in schema salad. Fix for older versions of setuptools.
1 parent 2848cbd commit 95cfbe1

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

schema_salad/schema.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@
1818

1919
_logger = logging.getLogger("salad")
2020

21+
salad_files = ('metaschema.yml',
22+
'salad.md',
23+
'field_name.yml',
24+
'import_include.md',
25+
'link_res.yml',
26+
'ident_res.yml',
27+
'vocab_res.yml',
28+
'vocab_res.yml',
29+
'field_name_schema.yml',
30+
'field_name_src.yml',
31+
'field_name_proc.yml',
32+
'ident_res_schema.yml',
33+
'ident_res_src.yml',
34+
'ident_res_proc.yml',
35+
'link_res_schema.yml',
36+
'link_res_src.yml',
37+
'link_res_proc.yml',
38+
'vocab_res_schema.yml',
39+
'vocab_res_src.yml',
40+
'vocab_res_proc.yml')
41+
2142
def get_metaschema():
2243
loader = ref_resolver.Loader({
2344
"Any": "https://w3id.org/cwl/salad#Any",
@@ -105,28 +126,10 @@ def get_metaschema():
105126
"xsd": "http://www.w3.org/2001/XMLSchema#"
106127
})
107128

108-
for f in ('metaschema.yml',
109-
'salad.md',
110-
'field_name.yml',
111-
'import_include.md',
112-
'link_res.yml',
113-
'ident_res.yml',
114-
'vocab_res.yml',
115-
'vocab_res.yml',
116-
'field_name_schema.yml',
117-
'field_name_src.yml',
118-
'field_name_proc.yml',
119-
'ident_res_schema.yml',
120-
'ident_res_src.yml',
121-
'ident_res_proc.yml',
122-
'link_res_schema.yml',
123-
'link_res_src.yml',
124-
'link_res_proc.yml',
125-
'vocab_res_schema.yml',
126-
'vocab_res_src.yml',
127-
'vocab_res_proc.yml'):
128-
with resource_stream(__name__, 'metaschema/' + f) as rs:
129-
loader.cache["https://w3id.org/cwl/" + f] = rs.read()
129+
for f in salad_files:
130+
rs = resource_stream(__name__, 'metaschema/' + f):
131+
loader.cache["https://w3id.org/cwl/" + f] = rs.read()
132+
rs.close()
130133

131134
j = yaml.load(loader.cache["https://w3id.org/cwl/metaschema.yml"])
132135
j, _ = loader.resolve_all(j, "https://w3id.org/cwl/salad#")

0 commit comments

Comments
 (0)