-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta issue referencing extension updates #2041
Comments
@jcfr can you please review this comment: QIICR/SlicerDevelopmentToolbox#45 (comment) ? Extension build stopped working today, which coincided with your PR... |
Thanks for pointing this out, I will have a look later when back on the 👨💻 |
List of pull requests and issues intended to fix and consolidate extension metadata for extension not yet integrated:
For future reference, following code was used to generate the import json
import sys
from pathlib import Path
extensions_index_dir = Path("/home/jcfr/Projects/ExtensionsIndex")
updated_extensions_index_dir = extensions_index_dir
def parse_s4ext(ext_file_path):
"""Parse a Slicer extension description file.
:param ext_file_path: Path to a Slicer extension description file.
"""
ext_metadata = {}
with open(ext_file_path) as ext_file:
for line in ext_file:
if not line.strip() or line.startswith("#"):
continue
fields = [field.strip() for field in line.split(' ', 1)]
assert(len(fields) <= 2)
ext_metadata[fields[0]] = fields[1] if len(fields) == 2 else None
return ext_metadata
# Collect s4ext files
s4ext_filepaths = list(extensions_index_dir.glob("*.s4ext"))
print(f"Found {len(s4ext_filepaths)} extension files (.s4ext)")
# Parse s4ext files and generate corresponding json files
for index, filepath in enumerate(s4ext_filepaths):
metadata = parse_s4ext(filepath)
#print("filepath", filepath)
updated_metadata = {
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json#",
"scm_url": metadata["scmurl"],
"scm_revision": metadata["scmrevision"],
"build_dependencies": [] if metadata.get("depends", "NA") == "NA" else metadata["depends"].split(" "),
"category": metadata["category"],
"build_subdirectory": metadata["build_subdirectory"],
}
with open(updated_extensions_index_dir / f"{filepath.stem}.json", 'w') as fileContents:
fileContents.write(json.dumps(updated_metadata, sort_keys=True, indent=2))
fileContents.write("\n")
print(f"Generated {index + 1} extension files (.json)")
from pprint import pprint as pp
print(f"\nMetadata of extension #{index + 1} ({filepath.stem}):\n")
pp(updated_metadata) |
These pull requests were created in the context of #2011
List of pull requests intended to fix and consolidate extension metadata:
The text was updated successfully, but these errors were encountered: