Skip to content

Commit 99852f5

Browse files
committed
fix wrapper usage
1 parent 7501ab9 commit 99852f5

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/somesy/codemeta/writer.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""codemeta.json creation module."""
2-
import json
32
import logging
43
from collections import OrderedDict
54
from pathlib import Path
@@ -9,7 +8,7 @@
98

109
from somesy.core.models import Person, ProjectMetadata
1110
from somesy.core.writer import ProjectMetadataWriter
12-
from somesy.utils import json_dump_wrapper
11+
from somesy.json_wrapper import json
1312

1413
logger = logging.getLogger("somesy")
1514

@@ -74,7 +73,6 @@ def _validate(self) -> None:
7473
f"No validation for codemeta.json files {Codemeta.__name__}: {pretty_repr(config)}"
7574
)
7675

77-
@json_dump_wrapper
7876
def _init_new_file(self) -> None:
7977
data = {
8078
"@context": [
@@ -91,7 +89,6 @@ def _init_new_file(self) -> None:
9189
with self.path.open("w+") as f:
9290
json.dump(data, f)
9391

94-
@json_dump_wrapper
9592
def save(self, path: Optional[Path] = None) -> None:
9693
"""Save the codemeta.json file."""
9794
path = path or self.path

src/somesy/package_json/writer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""package.json parser and saver."""
2-
import json
32
import logging
43
from collections import OrderedDict
54
from pathlib import Path
@@ -9,8 +8,8 @@
98

109
from somesy.core.models import Person, ProjectMetadata
1110
from somesy.core.writer import ProjectMetadataWriter
11+
from somesy.json_wrapper import json
1212
from somesy.package_json.models import PackageJsonConfig
13-
from somesy.utils import json_dump_wrapper
1413

1514
logger = logging.getLogger("somesy")
1615

@@ -66,7 +65,6 @@ def _validate(self) -> None:
6665
)
6766
PackageJsonConfig(**config)
6867

69-
@json_dump_wrapper
7068
def save(self, path: Optional[Path] = None) -> None:
7169
"""Save the package.json file."""
7270
path = path or self.path

tests/output/test_codemeta.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from somesy.codemeta import Codemeta
2-
from somesy.utils import json_dump_wrapper
3-
import json
2+
from somesy.json_wrapper import json
43

54

6-
@json_dump_wrapper
75
def test_update_codemeta(somesy_input, tmp_path):
86
codemeta_file = tmp_path / "codemeta.json"
97

0 commit comments

Comments
 (0)