diff --git a/data/requirements.txt b/data/requirements.txt index 22ac8a7..240fcf7 100644 --- a/data/requirements.txt +++ b/data/requirements.txt @@ -9,7 +9,6 @@ pycparser==2.21 PyGithub==1.57 PyJWT==2.6.0 PyNaCl==1.5.0 -PyYAML==6.0 requests==2.28.2 urllib3==1.26.14 wrapt==1.14.1 diff --git a/data/update b/data/update index 06048b0..fe9fbeb 100755 --- a/data/update +++ b/data/update @@ -3,10 +3,10 @@ import argparse import csv import github import jinja2 +import json import os import re import requests -import yaml def get_packages(): @@ -191,16 +191,15 @@ def get_build_options(package_name): def update_recipes(packages): packages_recipes_dir = os.path.abspath("packages") - class Dumper(yaml.Dumper): - def increase_indent(self, flow=False, *args, **kwargs): - return super().increase_indent(flow=flow, indentless=False) - for dirpath, dirnames, filenames in os.walk(packages_recipes_dir): for file in filenames: + if not file.endswith(".json"): + continue + path = os.path.join(dirpath, file) with open(path, "r") as rf: - package = yaml.safe_load(rf) + package = json.load(rf) for p in packages: if package["name"] == p["repository"]["name"]: @@ -222,7 +221,7 @@ def update_recipes(packages): del build_package["build-options"] with open(path, "w") as wf: - yaml.dump(build_package, wf, Dumper=Dumper, sort_keys=False) + json.dump(build_package, wf, indent=2, sort_keys=False) def update_workflows(packages):