fixed python issues
This commit is contained in:
1 parent
7df34bdf7f
commit
3da5e1c88c
3 files changed
+9
-7
No files matched your search
@@ -21,6 +21,7 @@ setuptools.setup(
|
|||||||
"pre-commit==2.13.0",
|
"pre-commit==2.13.0",
|
||||||
"vulture==2.3",
|
"vulture==2.3",
|
||||||
"types-requests==2.25.6",
|
"types-requests==2.25.6",
|
||||||
|
"types-PyYAML==6.0.7",
|
||||||
"requests==2.27.0",
|
"requests==2.27.0",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import yaml
|
|
||||||
import io
|
import io
|
||||||
from typing import Any, TextIO, Union
|
from typing import Any, TextIO, Union
|
||||||
|
|
||||||
from src.yaml_serializer.loader import YamlSafeLoader
|
import yaml
|
||||||
|
|
||||||
from src.yaml_serializer.dumper import YamlSafeDumper
|
from src.yaml_serializer.dumper import YamlSafeDumper
|
||||||
|
from src.yaml_serializer.loader import YamlSafeLoader
|
||||||
|
|
||||||
|
|
||||||
def dump_yaml(obj: Any) -> str:
|
def dump_yaml(obj: Any) -> str:
|
||||||
@@ -16,7 +17,7 @@ def dump_yaml(obj: Any) -> str:
|
|||||||
str
|
str
|
||||||
"""
|
"""
|
||||||
stream = io.StringIO()
|
stream = io.StringIO()
|
||||||
yaml.dump(
|
yaml.dump( # nosec
|
||||||
obj,
|
obj,
|
||||||
stream,
|
stream,
|
||||||
default_flow_style=False,
|
default_flow_style=False,
|
||||||
@@ -37,4 +38,4 @@ def load_yaml(yaml_stream: TextIO) -> Union[dict, list]:
|
|||||||
Returns:
|
Returns:
|
||||||
List[dict, list]
|
List[dict, list]
|
||||||
"""
|
"""
|
||||||
return yaml.load(yaml_stream, Loader=YamlSafeLoader)
|
return yaml.load(yaml_stream, Loader=YamlSafeLoader) # nosec
|
||||||
@@ -11,6 +11,6 @@ class YamlSafeDumper(yaml.SafeDumper):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
YamlSafeDumper.add_representer(IncludedYaml, IncludedYaml.to_yaml)
|
YamlSafeDumper.add_representer(IncludedYaml, IncludedYaml.to_yaml) # type: ignore
|
||||||
YamlSafeDumper.add_representer(SecretValue, SecretValue.to_yaml)
|
YamlSafeDumper.add_representer(SecretValue, SecretValue.to_yaml) # type: ignore
|
||||||
YamlSafeDumper.add_representer(IncludedYamlDir, IncludedYamlDir.to_yaml)
|
YamlSafeDumper.add_representer(IncludedYamlDir, IncludedYamlDir.to_yaml) # type: ignore
|
||||||
Reference in new issue
Block a user