Skip to content

Commit 051c07d

Browse files
committed
chore: update packages
1 parent 00b25c6 commit 051c07d

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

bundled_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ typing-extensions>=4.4.0
22
click>=8.1.0
33
pluggy>=1.0.0
44
tomli > 2.0.0
5+
tomli_w >= 1.0.0

packages/plugin/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
"Framework :: Robot Framework",
2626
"Framework :: Robot Framework :: Tool",
2727
]
28-
dependencies = ["click>=8.0.0", "pluggy>=1.0.0"]
28+
dependencies = ["click>=8.0.0", "pluggy>=1.0.0", "tomli_w>=1.0.0"]
2929
dynamic = ["version"]
3030

3131
[project.urls]

packages/plugin/src/robotcode/plugin/__init__.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import click
99
import pluggy
10+
import tomli_w
1011
from robotcode.core.dataclasses import as_dict, as_json
1112

1213
__all__ = [
@@ -108,19 +109,13 @@ def print_data(
108109

109110
text = None
110111
if format == OutputFormat.TOML:
111-
try:
112-
import tomli_w
113-
114-
text = tomli_w.dumps(
115-
as_dict(data, remove_defaults=remove_defaults)
116-
if dataclasses.is_dataclass(data)
117-
else data
118-
if isinstance(data, dict)
119-
else {data: data}
120-
)
121-
except ImportError:
122-
self.warning("Package 'tomli_w' is required to use TOML output. Using JSON format instead.")
123-
format = OutputFormat.JSON
112+
text = tomli_w.dumps(
113+
as_dict(data, remove_defaults=remove_defaults)
114+
if dataclasses.is_dataclass(data)
115+
else data
116+
if isinstance(data, dict)
117+
else {data: data}
118+
)
124119

125120
if text is None:
126121
if format in [OutputFormat.JSON, OutputFormat.JSON_INDENT]:

0 commit comments

Comments
 (0)