Skip to content

Commit 1c36f88

Browse files
Remove ruamel-yaml-string package (#1218)
The usage of the `ruamel-yaml-string` package is isolated to one test only. The same functionality is easily be provided with a simple class method.
1 parent 7bd7c69 commit 1c36f88

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

pdm.lock

Lines changed: 3 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ dev = [
9595
"types-PyYAML<7.0.0,>=6.0.3",
9696
"types-certifi<2021.10.9,>=2020.0.0",
9797
"types-python-dateutil<3.0.0,>=2.0.0",
98-
"ruamel-yaml-string>=0.1.1",
9998
"syrupy>=4",
10099
]
101100

tests/test_config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import json
22
import os
3+
from io import StringIO
34
from pathlib import Path
5+
from typing import Any
46

57
import pytest
6-
from ruamel.yaml import YAML
8+
from ruamel.yaml import YAML as _YAML
79

810
from openapi_python_client.config import ConfigFile
911

12+
13+
class YAML(_YAML):
14+
def dump_to_string(self, data: Any, **kwargs: Any) -> str:
15+
stream = StringIO()
16+
self.dump(data=data, stream=stream, **kwargs)
17+
return stream.getvalue()
18+
19+
1020
yaml = YAML(typ=["safe", "string"])
1121

1222

0 commit comments

Comments
 (0)