Revision 136859ca
Added by koszko over 1 year ago
src/hydrilla/builder/build.py | ||
---|---|---|
43 | 43 |
|
44 | 44 |
index_validator = util.validator_for('package_source-1.schema.json') |
45 | 45 |
|
46 |
schemas_root = 'https://hydrilla.koszko.org/schemas' |
|
47 |
|
|
46 | 48 |
generated_by = { |
47 | 49 |
'name': 'hydrilla.builder', |
48 | 50 |
'version': _version.version |
... | ... | |
284 | 286 |
new_item_obj.update([(p, item_def[p]) for p in copy_props]) |
285 | 287 |
|
286 | 288 |
new_item_obj['version'] = util.normalize_version(item_def['version']) |
287 |
new_item_obj['api_schema_version'] = [1]
|
|
289 |
new_item_obj['$schema'] = f'{schemas_root}/api_{item_def["type"]}_description-1.schema.json'
|
|
288 | 290 |
new_item_obj['source_copyright'] = self.copyright_file_refs |
289 | 291 |
new_item_obj['source_name'] = self.source_name |
290 | 292 |
new_item_obj['generated_by'] = generated_by |
... | ... | |
303 | 305 |
""" |
304 | 306 |
index_validator.validate(index_obj) |
305 | 307 |
|
308 |
schema = f'{schemas_root}/api_source_description-1.schema.json' |
|
309 |
|
|
306 | 310 |
self.source_name = index_obj['source_name'] |
307 | 311 |
|
308 | 312 |
generate_spdx = index_obj.get('reuse_generate_spdx_report', False) |
... | ... | |
334 | 338 |
} |
335 | 339 |
|
336 | 340 |
self.source_description = { |
337 |
'api_schema_version': [1],
|
|
341 |
'$schema': schema,
|
|
338 | 342 |
'source_name': self.source_name, |
339 | 343 |
'source_copyright': self.copyright_file_refs, |
340 | 344 |
'upstream_url': index_obj['upstream_url'], |
src/hydrilla/schemas | ||
---|---|---|
1 |
Subproject commit b19171081e23bcccf9b41588c0464ca9c2c657c0 |
|
1 |
Subproject commit 1d1c93d5a9011ecdf58a4952afcb5a1faff30e76 |
src/test/source-package-example | ||
---|---|---|
1 |
Subproject commit 26c4622417cb786825b1b18083adfe5ce44b2756 |
|
1 |
Subproject commit 48606f288c89aaadb28a021ab71945e1e87fd14e |
src/test/test_hydrilla_builder.py | ||
---|---|---|
62 | 62 |
self.contents = default_contents.copy() |
63 | 63 |
|
64 | 64 |
self.expected_resources = [{ |
65 |
'api_schema_version': [1],
|
|
65 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_resource_description-1.schema.json',
|
|
66 | 66 |
'source_name': 'hello', |
67 | 67 |
'source_copyright': [{ |
68 | 68 |
'file': 'report.spdx', |
... | ... | |
88 | 88 |
}], |
89 | 89 |
'generated_by': expected_generated_by |
90 | 90 |
}, { |
91 |
'api_schema_version': [1],
|
|
91 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_resource_description-1.schema.json',
|
|
92 | 92 |
'source_name': 'hello', |
93 | 93 |
'source_copyright': [{ |
94 | 94 |
'file': 'report.spdx', |
... | ... | |
112 | 112 |
'generated_by': expected_generated_by |
113 | 113 |
}] |
114 | 114 |
self.expected_mapping = { |
115 |
'api_schema_version': [1],
|
|
115 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_mapping_description-1.schema.json',
|
|
116 | 116 |
'source_name': 'hello', |
117 | 117 |
'source_copyright': [{ |
118 | 118 |
'file': 'report.spdx', |
... | ... | |
138 | 138 |
'generated_by': expected_generated_by |
139 | 139 |
} |
140 | 140 |
self.expected_source_description = { |
141 |
'api_schema_version': [1],
|
|
141 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_source_description-1.schema.json',
|
|
142 | 142 |
'source_name': 'hello', |
143 | 143 |
'source_copyright': [{ |
144 | 144 |
'file': 'report.spdx', |
Also available in: Unified diff
specify full schema URL in instances