Skip to content

Commit

Permalink
Remove ruamel.yaml usages
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Jun 4, 2024
1 parent d6b2c04 commit 4943487
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions catalog_reader/scripts/apps_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import argparse
import os
import pathlib
import ruamel.yaml
import shutil
import yaml

Expand All @@ -12,10 +11,6 @@
from catalog_reader.names import get_library_path, get_library_hashes_path, get_base_library_dir_name_from_version


YAML = ruamel.yaml.YAML()
YAML.indent(mapping=2, sequence=4, offset=2)


def update_catalog_hashes(catalog_path: str) -> None:
if not os.path.exists(catalog_path):
raise CatalogDoesNotExist(catalog_path)
Expand Down Expand Up @@ -54,7 +49,7 @@ def update_catalog_hashes(catalog_path: str) -> None:
continue

with open(str(app_metadata_file), 'r') as f:
app_config = YAML.load(f)
app_config = yaml.safe_load(f.read())

if (lib_version := app_config.get('lib_version')) and lib_version not in hashes:
print(
Expand All @@ -74,7 +69,7 @@ def update_catalog_hashes(catalog_path: str) -> None:

app_config['lib_version_hash'] = hashes[lib_version]
with open(str(app_metadata_file), 'w') as f:
YAML.dump(app_config, f)
yaml.safe_dump(app_config)

print(f'[\033[92mOK\x1B[0m]\tUpdated library hash for {app_dir.name!r} in {train_dir.name}')

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ jinja2
jsonschema==4.10.3
markdown
pyyaml
ruamel.yaml
semantic_version

0 comments on commit 4943487

Please sign in to comment.