Skip to content

Commit bec92fe

Browse files
author
a.pirogov
committed
re-enable codemetapy workaround (still broken)
1 parent d5b74b5 commit bec92fe

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/somesy/codemeta/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""Integration with codemetapy (to re-generate codemeta as part of somesy sync)."""
22
import contextlib
3-
import json
43
import logging
54
from pathlib import Path
65

76
from ..core.models import SomesyConfig
87
from .exec import gen_codemeta
9-
from .utils import cff_codemeta_tempfile
8+
from .utils import cff_codemeta_tempfile, update_codemeta_file
109

1110
log = logging.getLogger("somesy")
1211

@@ -51,16 +50,17 @@ def update_codemeta(conf: SomesyConfig):
5150
with temp_cff_cm:
5251
cm_harvest = gen_codemeta(cm_sources)
5352

54-
# check output and write file if needed
55-
# return update_codemeta_file(conf.codemeta_file, cm_harvest)
56-
# NOTE: since codemetapy 2.5.1 we should not need
53+
# NOTE: once codemetapy is fixed (still broken with 2.5.1), we should not need
5754
# update_codemeta_file + codemeta context dump + most of utils.py + their tests anymore
5855
# we'll first disable the workaround and see for a while if everything works
5956
# as expected, and if it does, the cleanup can be completed.
60-
57+
#
6158
# save to file with same settings as used by codemetapy
62-
with open(conf.codemeta_file, "w") as f:
63-
f.write(json.dumps(cm_harvest, indent=4, ensure_ascii=False, sort_keys=True))
59+
# with open(conf.codemeta_file, "w") as f:
60+
# f.write(json.dumps(cm_harvest, indent=4, ensure_ascii=False, sort_keys=True))
61+
62+
# check output and write file if needed (with workaround checking graph equivalence)
63+
return update_codemeta_file(conf.codemeta_file, cm_harvest)
6464

6565

6666
__all__ = ["update_codemeta"]

0 commit comments

Comments
 (0)