Skip to content

Commit

Permalink
Update data
Browse files Browse the repository at this point in the history
  • Loading branch information
meisenzahl committed Nov 12, 2024
1 parent cac04b0 commit 806e240
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion data/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 6 additions & 7 deletions data/update
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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"]:
Expand All @@ -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):
Expand Down

0 comments on commit 806e240

Please sign in to comment.